#jack_71068
1 messages · Page 1 of 1 (latest)
Hi 👋
Can you share the request ID for the request that shows this error?
It will start with req_
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Okay, so just so I'm clear, you are using the ECE to create Payment Methods? And then you attempt to charge them separately?
We use the front end Stripe SDK to initiate the payment, but that then passes the payment method id to our server so we can put the payment through in server side code.
What flow are you using here? Is it the deferred intents flow?
It's express checkout elements. Is that what you mean?
Can you share the JavaScript code you are using to create the Express Checkout Element and payment Method?
var generateExpressCheckoutElement = function () {
var appearance = {
theme: 'stripe',
variables: {
borderRadius: '36px',
}
};
var expressCheckoutOptions = {
buttonHeight: 40,
buttonTheme: {
// applePay: 'white-outline'
},
buttonType: {
applePay: 'buy',
googlePay: 'buy',
paypal: 'buynow'
}
}
elements = stripe.elements({
locale: 'en',
mode: 'payment',
amount: StripeExpressCheckoutElementsService.getTotalToPay(),
currency: StripeExpressCheckoutElementsService.getSelectedCurrency().code.toLowerCase(),
appearance: appearance,
paymentMethodCreation: 'manual'
});
expressCheckoutElement = elements.create(
'expressCheckout',
expressCheckoutOptions
);
expressCheckoutElement.mount('.payment-method-stripe-express-checkout-elements');
}
Pink Panda is my colleague by the way.
And what payment method data are you using for this test?
One of the Stripe test cards. I think it's 4242424242424242. It's saved in my account so I'm not entering it every time.
Is there a specific card I should be using for Link tests?
No that should be fine
Okay that took some digging from my colleagues. Basically this isn't covered too well in our docs but we do mention you need to pass in mandate_data. We have an example of that here: https://stripe.com/docs/payments/finalize-payments-on-the-server?platform=web&type=setup#create-intent
Thanks. So I need to send a mandate object in the payment intent creation I'm doing on the server. I'm unclear as to whether I need to change anything on the front end. It says the setting on the front end for if terms are shown is auto. Should I force that to Always for Link? Link isn't listed in the examples, but I assume it's the same format as the others that are shown.
You need to send the mandate data back from the front-end because that is where you can collect the IP address and user-agent from the user's browser session