#zxcvbnm123-Apple Pay and shipping
1 messages · Page 1 of 1 (latest)
👋 happy to help
do you have a request id for an example of that happening? here's how you can find one https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_7Er7OCCafHGxgk
req_GEPVD2fNhiTeYs
In the first one we try to change the payment intent amount because a shipping option is selected, but it is to late, the payment as already been accepted ( as illustrated by the second request ID i sent you)
To make things clearer the second request happen before the first one i sent, and it should be the reverse
Oh so basically the shipping is part of your application?
sorry am I missing something?
Yes all our sales through stripe require shipping.
how are you collecting the shipping info?
are you using this https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#html-js-collecting-shipping-info ?
Yes adapted to our project
paymentRequest.on('shippingaddresschange', function(ev) {
// Perform server-side request to fetch shipping options
fetch('/checkout/stripe_payment_request_button/shipping_options/' + drupalSettings.stripe_payment_request.order_id + '', {
method: "POST",
body: JSON.stringify({
shippingAddress: ev.shippingAddress,
}),
}).then(function(response) {
return response.json();
}).then(function(result) {
if (result.supportedShippingOptions && result.supportedShippingOptions.length) {
ev.updateWith({
status: 'success',
shippingOptions: result.supportedShippingOptions,
total: {
amount: drupalSettings.stripe_payment_request.paymentRequest.total.amount + result.supportedShippingOptions[0].amount,
label: drupalSettings.stripe_payment_request.paymentRequest.total.label
}
});
} else {
ev.updateWith({
status: 'invalid_shipping_address'
});
}
});
});
paymentRequest.on('shippingoptionchange', function(event) {
var updateWith = event.updateWith;
var shippingOption = event.shippingOption;
// handle shippingoptionchange event
var updateDetails = {
status: 'success',
total: {
amount: drupalSettings.stripe_payment_request.paymentRequest.total.amount + shippingOption.amount,
label: drupalSettings.stripe_payment_request.paymentRequest.total.label
}
};
updateWith(updateDetails);
});
hes is our shipping handling code
Hi! I would recommend to ask that to Stripe support directly, they will have more time to investigate the issue. https://support.stripe.com/?contact=true
Make sure to include all relevant details (code snippets, object IDs, etc.)