#iainb_code

1 messages · Page 1 of 1 (latest)

toxic tuskBOT
#

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

nimble sundial
#

Hi, let me help you with this.

#

What documentation are you following?

peak kindle
#

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

nimble sundial
#

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?

peak kindle
#

`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()

nimble sundial
#

Are you providing a client_secret to your Elements instance?

peak kindle
#

yes

nimble sundial
#

Where? And where does it come from exactly?

peak kindle
#

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>

nimble sundial
#

The currency in the Apple Pay prompt depends on the currency of the Prices used when creating the Subscription.

peak kindle
#

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

nimble sundial
#

But it always shows in USD?

peak kindle
#

The post to /v1/subscriptions also include GBP/gbp in the response

nimble sundial
#

Could you please share a screenshot of how it looks.
And the Subscription ID sub_xxx

peak kindle
#

what looks, the payment sheet?

nimble sundial
peak kindle
#

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

nimble sundial
#

Hmm, looks like a bug on Apple Pay.

peak kindle
#

nooooooooo

nimble sundial
peak kindle
#

thanks so much for your time

#

much appreciated

nimble sundial
#

Happy to help.