#fusionios_49211
1 messages · Page 1 of 1 (latest)
Can you share which guide you're following?
Sure... I will send
i have following our stripe (https://docs.stripe.com/terminal/payments/collect-payment?terminal-sdk-platform=ios)
Thanks for sharing! The Payment Intent can be created via server which supports transfer_data: https://docs.stripe.com/terminal/payments/collect-payment?terminal-sdk-platform=ios#create-server-side
transfer_data: https://docs.stripe.com/api/payment_intents/create#create_payment_intent-transfer_data
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
Is there any possible way to send transfer amount in iOS side
Can you share more details about the ask ? any concrete example ?
sure
As mentioned above screenshot to create payment intend using below params (PaymentIntentParametersBuilder)
let builder = PaymentIntentParametersBuilder(amount: UInt(self.convertAmt * 100.0), currency: "gbp")
builder.setPaymentMethodTypes(["card_present"])
builder.setCaptureMethod(.manual)
builder.setOnBehalfOf(ConstantManager.appConstant.paymentDataModel?.connectid ?? "")
builder.setTransferDataDestination(ConstantManager.appConstant.paymentDataModel?.connectid ?? "")
do {
let params = try builder.build()
Terminal.shared.createPaymentIntent(params) { createResult, createError in
Actually i have send total amount above mentioned params PaymentIntentParametersBuilder(amount:)
and i need to send the money after deducting charges in another account using connect_id method... so our android dev using this method and transfer amount
let transferData = STPPaymentIntentTransferDataParams.Builder()
.setDestination(pref.string(forKey: "connectid"))
.setAmount(NSNumber(value: Int(amttotransfer)))
.build()
// Create PaymentIntentCreateParams
var params = STPPaymentIntentParams()
params.amount = NSNumber(value: Int(toatlamt))
params.currency = "gbp"
params.paymentMethodTypes = ["card_present"]
params.captureMethod = .manual
params.statementDescriptor = description
params.onBehalfOf = pref.string(forKey: "connectid")
params.transferData = transferData
Not available in iOS below method
let transferData = STPPaymentIntentTransferDataParams.Builder()
.setDestination(pref.string(forKey: "connectid"))
.setAmount(NSNumber(value: Int(amttotransfer)))
.build()
so i couldn't send the transfer amount (params.transferData = transferData)
) this kind of params?
IS any other method available to transfer amount?
Yes, because iOS is a client-side SDK – you don't create Payment Intents client-side. The other code you shared is from our backend Java SDK, not the Android SDK
Thanks for the update, How to overcome this issue ?
Well you'd have a backend API that is creating the Payment Intents that your iOS app calls I suspect?
Nope
Then you're going to need to add one: https://docs.stripe.com/connect/creating-a-payments-page?platform=ios&destination-or-direct=destination-charges#ios-create-payment-intent
This is a full end-to-end iOS guide for destination charges