#PERF

1 messages · Page 1 of 1 (latest)

green forumBOT
spiral ledge
#

Is your integration working now?

vagrant summit
#

the web integration "works" but just doesn't add the new card to the customer

#

after confirming the payment method

spiral ledge
#

Have you tried adding the customer when the Payment Intent is created?

vagrant summit
#

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

spiral ledge
#

I'm not sure I understand what you mean

#

PERF

vagrant summit
#

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

spiral ledge
#

Okay, so what are you trying to do by passing the Customer ID into the Payment Sheet initialization?

vagrant summit
#

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.

spiral ledge
#

What do you mean by "save"?

vagrant summit
#

when using this flow associated with a payment intent, saving the entered card information

spiral ledge
#

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?

vagrant summit
#

attach to customer

#

within stripe

spiral ledge
vagrant summit
#

does that happen automatically when using the react-native payment sheets?

spiral ledge
#

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?

vagrant summit
#

it does get attached with react-native

spiral ledge
#

So which workflow is not saving the Payment Method to the Customer?

vagrant summit
#

react flow using @stripe/react-stripe-js

spiral ledge
#

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?

vagrant summit
#

yes

spiral ledge
#

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