#PERF
1 messages · Page 1 of 1 (latest)
Is your integration working now?
the web integration "works" but just doesn't add the new card to the customer
after confirming the payment method
Have you tried adding the customer when the Payment Intent is created?
yes, it work when confirming from the react-native integration we have
i am using the same server code to produce what we would confirm in our web application as well
the following is used to create the payment_intents via the stripe api
params := &stripev72.PaymentIntentParams{
Params: stripev72.Params{
Context: ctx,
IdempotencyKey: stripev72.String(orderID),
},
CaptureMethod: stripev72.String(string(stripev72.PaymentIntentCaptureMethodManual)),
Amount: stripev72.Int64(amount),
Currency: stripev72.String(string(stripev72.CurrencyUSD)),
Customer: stripev72.String(stripeCustomerID),
Description: stripev72.String(description),
PaymentMethodTypes: []*string{
stripev72.String(string(stripev72.PaymentMethodTypeCard)),
},
StatementDescriptor: stripev72.String(descriptionShort),
TransferGroup: stripev72.String(orderID),
}
i attach the customer this way
Okay, so what are you trying to do by passing the Customer ID into the Payment Sheet initialization?
sorry I think I just added more confusion to my question.
Let me re-word it
I am using the stripe elements library
const stripe = useStripe();
const elements = useElements();
...
return (
<PaymentElement />
)
I want to know why initializing a payment_intent with the above golang code wouldn't allow me to save the payment method that is created via the <PaymentElement /> element on web.
What do you mean by "save"?
when using this flow associated with a payment intent, saving the entered card information
Again, what do you mean by "save"? Cache in the browser? Attach to a customer? Store in a database? What does "save" mean in this context?
I think (based on your previous thread) you have to make a separate call to attach the Payment Method to the Customer: https://stripe.com/docs/api/payment_methods/attach
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
does that happen automatically when using the react-native payment sheets?
I assumed it wasn't happening for you based on your question. Did you test it to see if the Payment Method gets attached or not?
it does get attached with react-native
So which workflow is not saving the Payment Method to the Customer?
react flow using @stripe/react-stripe-js
I'm sorry, I still don't understand what's actually happening with your integration. You're using React with Go to present a Payment Element, correct?
yes
As far as I know, once the Payment Intent succeeds it will get attached to the customer. You just have to include SetupFutureUsage when you create the Payment Intent. Here's an example of what that looks like: https://stripe.com/docs/payments/quickstart#save-add