#zxcvbnm123-Apple Pay and shipping

1 messages · Page 1 of 1 (latest)

turbid ridge
#

👋 happy to help

kind night
#

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

turbid ridge
#

Oh so basically the shipping is part of your application?

#

sorry am I missing something?

kind night
#

Yes all our sales through stripe require shipping.

turbid ridge
#

how are you collecting the shipping info?

kind night
#

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

versed flare
#

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.)