Closed tapannathvani closed 3 years ago
Hello! I'm not sure what you're using the stripeId for, but it looks like you need to cast the selectedPaymentOption: (paymentContext.selectedPaymentOption as STPPaymentMethod).stripeId
. For this sort of question, you may have a faster response by using the Contact support
button on https://support.stripe.com/.
StripeId is one kind of TransactionId right? that we need to send it to our server for data records.
@tapannathvani the stripeId
property is the Stripe object's ID.
e.g. in your case, you have a PaymentMethod object, so stripeId
would be the PaymentMethod object ID, like pm_123. It is not a transaction ID, it is the ID of a token that represents a customer's card.
You still have to "confirm" a PaymentIntent to actually create the payment. You would use this PaymentMethod and a PaymentIntent's client_secret to confirm a payment as explained here: https://stripe.com/docs/payments/accept-a-payment?integration=elements#ios-create-payment-intent
I'm going to close this for now as this isn't about a bug in the SDK. For integration related questions, I'd recommend writing in to Support at https://support.stripe.com/contact and they can help you out!
Hi, Thanks for the response. I am using the confirmPayment method with client_secret parameter and once payment successful then only i came into that didFinish delegate where i am getting stripeId. The link you have suggested that exactly i followed (even followed Basic Integration example also).
Here is the flow :
Hello Any update on above question
@tapannathvani in the completion block of confirmPayment()
, you get back an STPPaymentIntent object as part of the completion block's parameters: https://stripe.dev/stripe-ios/docs/Classes/STPAPIClient.html#/c:objc(cs)STPAPIClient(im)confirmPaymentIntentWithParams:completion:
That STPPaymentIntent object has a stripeId
which will be the PaymentIntent ID, e.g. pi_123. This PaymentIntent ID represents a payment.
Okies. Thanks
Summary
Once Payment successful, i want to get the StripeId (normally i think we can say transaction id.. please correct here if i am wrong and that i need to sendback to server to store for further reference) but paymentContext.selectedPaymentOption not providing this. We are using your Basic Integration example directly.
Code to reproduce
iOS version
12.4
Installation method
Through POD
SDK version
github "AliSoftware/OHHTTPStubs" "8.0.0" github "capitalone/SWHttpTrafficRecorder" "1.0.2" github "erikdoe/ocmock" "v3.7.1" github "uber/ios-snapshot-test-case" "6.1.0"
Other information
Attached the screenshot.