#m0uka_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1355193893708238909
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, when you create the Elements, are you making the shipping as 'required': https://docs.stripe.com/js/elements_object/create_express_checkout_element#express_checkout_element_create-options-shippingAddressRequired ?
Are you able to look at your code and review what your Elements creation look like?
hi, no, but i set billingAddressRequired to true
<ExpressCheckoutElement
className={'w-full'}
options={stripeCheckoutElementOptions}
onClick={(e) => {
let recurringIntervalUnit =
checkout?.lines[0].subscription_interval_scale!
let recurringIntervalCount =
checkout?.lines[0].subscription_interval_value
if (recurringIntervalUnit === 'week') {
recurringIntervalUnit = 'day'
recurringIntervalCount = recurringIntervalCount! * 7
}
e.resolve({
emailRequired: true,
billingAddressRequired: true,
applePay: checkout?.subscription
? {
recurringPaymentRequest: {
paymentDescription: `${checkout.store.name} ${checkout.lines[0].product_name} subscription`,
managementURL: 'https://checkout.paynow.gg/subscriptions',
regularBilling: {
amount: checkout.recurring_total_amount,
label: `${checkout.lines[0].product_name}`,
recurringPaymentIntervalUnit:
recurringIntervalUnit as ApplePayRecurringPaymentRequestIntervalUnit,
recurringPaymentIntervalCount: recurringIntervalCount!,
},
},
}
: undefined,
})
}}
onReady={(e) => {
setExpressCheckoutReady(true)
// 1 for Link
let avail = 1
if (e.availablePaymentMethods?.applePay) {
avail++
}
if (e.availablePaymentMethods?.googlePay) {
avail++
}
setAvailableCheckoutMethods(avail)
}}
onConfirm={(e) => changePaymentMethodMutation.mutate()}
/>```
Can you share what elements.create()looks like?
<StripeElementsWrapper
methodId={'card'}
customElementsOptions={{
mode: checkout?.subscription
? isSetupIntent
? 'setup'
: 'subscription'
: 'payment',
amount: isSetupIntent ? undefined : checkout?.total_amount,
currency: isSetupIntent ? undefined : checkout?.currency,
captureMethod: 'automatic',
payment_method_types: availableGatewaysQuery.data
?.filter(
(x) =>
x.gateway === 'stripe' &&
x.gateway_entity_identifier ===
cardMethodGatewayEntityIdentifier &&
checkout?.currency &&
x.supported_currencies?.includes(checkout.currency)
)
?.filter((x) =>
checkout?.subscription ? x.subscriptions_supported : true
)
.map((x) => x.gateway_method_type_id),
}}
>
<ExpressCheckoutStripeButton />
</StripeElementsWrapper>```
customElementsOptions is the `options` field passed to ```jsx
<Elements options={options} stripe={stripePromise}>
{children}
</Elements>```
(which should be calling `elements.create()` internally afaik)
I just tested my integration with the following and it works as expected.
const options = {
mode: 'payment',
amount: 1099,
currency: 'eur',
};
I do not fully follow your code. From your code, customElementsOptions looks similar to what I'm passing.
What does your confirm call look like?
const billingDetails = {
name: details.name,
email: details.email,
address: {
country: details.address!.country!,
postal_code: details.address!.postal_code!,
state: details.address!.state!,
line1: details.address!.line_1!,
line2: details.address!.line_2!,
city: details.address!.city!,
},
}
if (clientSecret.startsWith('pi_')) {
const paymentIntentResult = await stripe!.confirmPayment({
elements: elements!,
clientSecret,
confirmParams: {
return_url: getCompleteURL(),
payment_method_data: {
billing_details: billingDetails,
},
},
})
if (paymentIntentResult?.error) {
handleStripeError(paymentIntentResult.error)
}
} else {
const setupIntentResult = await stripe!.confirmSetup({
elements: elements!,
clientSecret,
confirmParams: {
return_url: getCompleteURL(),
payment_method_data: {
billing_details: billingDetails,
},
},
})```
Can you share the entire front end code instread of chunck so I can further look? The reason being, I can't reproduce this issue and on your confirm call, https://dashboard.stripe.com/logs/req_CCe6n98JlVVUE2 I see an empty shipping data.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
the problem is that we cannot reproduce this too, looks like it only occurred for some customers
i can send you the whole code but i've shared everything regarding the stripe integration already
i've noticed this only happens for Apple Pay
Hmm, that is weird that it only happened to some customers. I tried many ways and I can't repro this.
Can you share another requets where it works as expected?
couldn't it be due to me passing the special fields for applePay during the confirmation?
e.resolve({
emailRequired: true,
billingAddressRequired: true,
applePay: checkout?.subscription
? {
recurringPaymentRequest: {
paymentDescription: `${checkout.store.name} ${checkout.lines[0].product_name} subscription`,
managementURL: 'https://checkout.paynow.gg/subscriptions',
regularBilling: {
amount: checkout.recurring_total_amount,
label: `${checkout.lines[0].product_name}`,
recurringPaymentIntervalUnit:
recurringIntervalUnit as ApplePayRecurringPaymentRequestIntervalUnit,
recurringPaymentIntervalCount: recurringIntervalCount!,
},
},
}
: undefined,
})```
That seems a bit suspicious
here's a working google pay req_D0hTcFU591PmhT
using express checkout
let me see if i can find an apple pay one
here's an apple pay req_Br23GF5rj9pcE5
Let me test this with ApplePay, hang tight.
I could not reproduce this with Apple Pay either
Hi hi! I’m going to be taking over for my colleague here. Give me a minute to read back and understand things.
Just to make sure I don't go chasing geese, can you one-sentence your issue for me so I can confirm my understanding?
shipping.name -> Required
shipping.address.country -> Required for calculating taxes
shipping.address.postal_code -> Required for calculating taxes
https://docs.stripe.com/api/payment_intents/confirm#confirm_payment_intent-shipping-name
the shipping fields get set by the SDK for some reason in some cases, but that is undesirable - i do not want to pass in shipping at all
I don't think this has anything to do with your integation; my tummy tells me the user's Apple Pay Wallet didn't include their shipping details.
This is a very infrequent thing, ya?
I also wonder if this is because you're creating Tokens here rather than one of the newer ways to deal with capturing card details.
Can you tell me more about the whole flow you're using here? You seem to be using createToken on your own, and then somehow making use of the Express Checkout Element to finalize things?
i am not using createToken anywhere explicitly as far as i know
and yes, it’s rare
You're not creating a Token, it's internal.
My tummy tells me this is missing information on an Apple Wallet that we're not handling correctly.
Can I move you over to our Developer Support case system so I can pull in the folks that work on this?
sure
Hello @native meadow, we have sent you a direct message, please check it at https://discord.com/channels/@me/1355193634508509348
- 🔗The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.