#iainb_code
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/1276499465829744701
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
At the moment it's been suggestions from this discord related to this issue.
These have led to the creation of the line items in the payment sheet for Apple Pay
And to the suggestion the Intent defines the currency used in the payment sheet
creation of the line items in the payment sheet for Apple Pay
What do you mean by this exactly? Could you please share the code that you're using?
`const applePay = {
recurringPaymentRequest: {
paymentDescription: “[redacted] app subscription",
managementURL: managementUrl,
trialBilling: {
label: "7 Days Free",
amount: 0,
},
regularBilling: {
recurringPaymentStartDate: moment().add(7, "day").toDate(),
label: '[redacted] 1-${selectedPrice?.recurring?.interval} Program',
amount: selectedPrice?.unit_amount ?? 0,
recurringPaymentIntervalUnit:
(selectedPrice?.recurring
?.interval as ApplePayRecurringPaymentRequestIntervalUnit) ||
("month" as ApplePayRecurringPaymentRequestIntervalUnit),
recurringPaymentIntervalCount: selectedPrice?.recurring?.interval_count,
},
},
};
<StyledPaymentElement
id="payment-element"
onChange={handleStripeChange}
onReady={() => setStripeReady(true)}
options={{
fields: {
billingDetails: {
address: { country: "never", postalCode: "never" },
},
},
applePay,
}}
/>`
Well, that formatting makes my head hurt - apols
And these are parts of the code - the StyledPaymentElement is included in a return()
Are you providing a client_secret to your Elements instance?
yes
Where? And where does it come from exactly?
This comes from the created Subscription
`type PropsWithClientSecret = StripeElementFormProps & {
stripeClientSecret: string;
};
function StripeElementForm(props: PropsWithClientSecret) {
const theme = useTheme();
const stripe = useLoadStripe(project.stripePublishableKey);
return (
<Elements
stripe={stripe}
options={{
clientSecret: props.stripeClientSecret,
fonts: [`
<PaymentElement> is part of the <PaymentForm> (styling etc) that is the child of the Elements component, so <Elements><PaymentForm/></Elements>
The currency in the Apple Pay prompt depends on the currency of the Prices used when creating the Subscription.
Thanks
The currency attached to the price we're using is GBP
Price Per Unit for the price is eg. £37.99
And Currency for the price is GBP
But it always shows in USD?
The post to /v1/subscriptions also include GBP/gbp in the response
Could you please share a screenshot of how it looks.
And the Subscription ID sub_xxx
what looks, the payment sheet?
Yes
moment, blurring some stuff on the screenshot
you can see in the background the price is £37.99
getting the sub id, standby
Subscription ID: sub_1PqvDcFZuRU6lsMiCfKE4EEp
Hmm, looks like a bug on Apple Pay.
nooooooooo
I'd suggest to reach out to Stripe Support to document it: https://support.stripe.com/?contact=true
Happy to help.