#vincent_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/1337089532494876735
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello again!
so the checkout page is passing what i believe are the correct props. typescript also seems to think so. no errors that i can see in the console.
Hello there
the payment element props look correct:
Can you share your full code snippet here?
sure
on my ipad which has apple pay its not appearing though:
layout: {
type: "accordion",
defaultCollapsed: false,
radios: true,
spacedAccordionItems: false,
},
...(recurringBillingDetails && {
applePay: getApplePayOption(recurringBillingDetails, activeCart),
}),
};```
export const getApplePayOption = (
recurringBillingDetails: RecurringBillingDetails,
activeCart: Cart,
): ApplePayOption | undefined => {
const cadences = Object.keys(recurringBillingDetails);
if (cadences.length !== 1) {
return;
}
const cadence = cadences[0]!;
const details = recurringBillingDetails[cadence]!;
return {
recurringPaymentRequest: {
paymentDescription: "My Ritual Subscription",
managementURL: "https://account.ritual.com/",
regularBilling: {
amount: details.amount,
label: `Recurring subscription (${
activeCart.taxInclusive ? "VAT Included" : "plus tax"
})`,
recurringPaymentIntervalUnit: "day",
recurringPaymentIntervalCount: Number(cadence),
recurringPaymentStartDate: new Date(
new Date().setDate(Number(new Date().getDate() + cadence)),
),
},
billingAgreement: `Some of the items you are purchasing will automatically renew as a subscription and will be billed every ${cadence} days until you cancel. You can cancel anytime by visiting your account page on our website. By clicking Pay, you confirm that you have read, understand, and agree to the Terms of Service and Privacy Policy.`,
},
};
};```
Thanks, looking
Hmm yeah it is working for me ๐ค
Does it work for you if you just use something more simple like:
recurringPaymentRequest: {
paymentDescription: 'My subscription',
managementURL: 'https://example.com/billing',
regularBilling: {
amount: 2500,
label: 'Monthly subscription fee',
recurringPaymentIntervalUnit: 'month',
recurringPaymentIntervalCount: 1,
},
billingAgreement: "THIS IS A BILLING AGREEEMENT",
},
i would have to deploy that to prod to see ๐
You can't test locally using ngrok or something like that?
Like my guess is something is cached in prod or something else. Your code seems fine to me.
yeah i would need keys to the apple config to allow a new referrer unfortuantely, i could do taht after the rest of my team wakes up
ok good to know then...
hmmm
are there perhaps character limits or some other constraint that might be breaking it?
No I tried your exact code (other than putting placeholders in the variables)
I suppose it is possible that you do have an issue with one of your variables but then I would expect an issue when Payment Element renders...
yeah, typescript would hve complained if i was feeding it the wrong data types too
This is what I see when I use your code (with placeholders for the variables):
yeah so weird. we have an express checkout elsewhere that takes in teh same blob and it works