Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@ const SFPaymentsExpressButtons = ({
// Find SF Payments payment instrument in created order
const orderPaymentInstrument = getSFPaymentsInstrument(order)

// Build the return URL (needed for updatePaymentInstrumentForOrder )
const baseReturnUrl = `${window.location.protocol}//${window.location.host}/checkout/payment-processing`
paymentData.returnUrl = baseReturnUrl +
'?orderNo=' + encodeURIComponent(createdOrderNo) +
'&zoneId=' + encodeURIComponent(zoneId) +
'&type=' + encodeURIComponent(paymentType)

try {
const paymentInstrumentBody = createPaymentInstrumentBody({
amount: order.orderTotal,
Expand Down Expand Up @@ -944,15 +951,7 @@ const SFPaymentsExpressButtons = ({

const paymentMethodSet = {
paymentMethods: paymentConfig.paymentMethods,
// inject country code into payment method set accounts (Adyen seems to need it but Stripe works with/without it)
paymentMethodSetAccounts:
paymentConfig.paymentMethodSetAccounts?.map((account) => ({
...account,
config: {
...account.config,
country: paymentCountryCode || fallbackCountryCode || 'US' // Inject country here
}
})) || []
paymentMethodSetAccounts: paymentConfig.paymentMethodSetAccounts || []
}
const config = {
theme: buildTheme({
Expand Down
Loading