#donut_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/1423653075788239002
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- donut_code, 56 minutes ago, 45 messages
- donut_code, 21 hours ago, 8 messages
- donut_code, 23 hours ago, 55 messages
- donut_docs, 1 day ago, 26 messages
hi there!
hi
do you follow all requirements listed here? https://docs.stripe.com/testing/wallets?ui=express-checkout-element
yes. on mode payment it displayed but not in subscription mode
Hi there, taking over for @thin wagon as they had to step away
Just to verify, when you visit https://docs.stripe.com/testing/wallets?ui=express-checkout-element, do you see the demo Google Pay button? And underneath, does it say googlePay: true or googlePay: false?
Got it, it looks like Google Pay is set up properly for your account and browser. Can you share the full code to create your checkout elements? If there is any backend code that was used, please share that as well
const expressCheckoutOptions = {
buttonHeight: 50,
buttonTheme: { applePay: 'white-outline' },
paymentMethods: {
googlePay: 'always'
},
applePay: {
recurringPaymentRequest: {
paymentDescription: planDescription || '',
regularBilling: {
amount,
label: planName || 'Subscription',
recurringPaymentStartDate: new Date(),
recurringPaymentIntervalUnit: this.mapDurationIdToIntervalUnit(durationId),
recurringPaymentIntervalCount: durationValue
},
billingAgreement: 'billing agreement',
managementURL: 'https://stripe.com'
}
},
googlePay: {
paymentRequest: {
total: {
label: planName || 'Subscription',
amount: (amount / 100).toFixed(2),
currency: currency.toUpperCase()
}
}
}
};
this.expressCheckoutElements = stripe.elements({
mode: 'subscription',
amount: amount || 0,
currency,
appearance
});
this.paymentElement = this.expressCheckoutElements.create(
'expressCheckout',
expressCheckoutOptions
);
this.paymentElement.mount('#express-checkout-button');
this is it
no backend code
or wait i'll send you the subscription creation properties
var paymentSettings = new SubscriptionPaymentSettingsOptions
{
SaveDefaultPaymentMethod = "on_subscription",
};
var createSubscription = new SubscriptionCreateOptions
{
Customer = customer.Id,
Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Price = price.Id } },
Metadata = createStripeSubscriptionPaymentRequest.Metadata,
Discounts = new List<SubscriptionDiscountOptions> { promotionCode == null ? new SubscriptionDiscountOptions { Coupon = coupon?.Id } : new SubscriptionDiscountOptions { PromotionCode = promotionCode?.Id } },
Currency = price.Currency
};
if (createStripeSubscriptionPaymentRequest.PaymentOptionId == PaymentOptionConstants.PayPal)
{
createSubscription.Expand = new List<string> { "latest_invoice.confirmation_secret" };
createSubscription.OffSession = true;
}
else if (createStripeSubscriptionPaymentRequest.PaymentOptionId == PaymentOptionConstants.ApplePay || createStripeSubscriptionPaymentRequest.PaymentOptionId == PaymentOptionConstants.GooglePay)
{
createSubscription.PaymentBehavior = "default_incomplete";
createSubscription.Expand = new List<string> { "latest_invoice.confirmation_secret" };
createSubscription.PaymentSettings = paymentSettings;
}
but all of this happens after the buttons show
so you dont really need to look into this
Got it, thanks for sending both. Looking into this now
Also when apple pay button wasnt showing we had to add this
applePay: {
recurringPaymentRequest: {
paymentDescription: planDescription '',
regularBilling: {
amount,
label: planName 'Subscription',
recurringPaymentStartDate: new Date(),
recurringPaymentIntervalUnit: this.mapDurationIdToIntervalUnit(durationId),
recurringPaymentIntervalCount: durationValue
},
billingAgreement: 'billing agreement',
managementURL: 'https://stripe.com/'
}
},
but couldnt find something similar in the doc for google pay
Understood. The Apple Pay configuration you're using is for MPANs, which is not a concept that exists for Google Pay
Looking over your code, towards the end there is
this.expressCheckoutElements = stripe.elements({
mode: 'subscription',
amount: amount 0,
currency,
appearance
});
I don't understand the amount: amount 0,. Is that part of your code or was there some weird copy and paste issue?
Is the amount > 0 when loading the page that doesn't show Google Pay?
yes
Got it. Can you share a published test page so we can try and reproduce on our end?
Thanks! Can you DM me a test email and password to log into the site?
(got the email and password, deleted the message, thanks!)
ahhahahha thank you
Hello
Taking over here ๐
hi, okay
first off, googlePay is not a valid option for Express Checkout Element - https://docs.stripe.com/js/elements_object/create_express_checkout_element#express_checkout_element_create-options
So you probably want to remove that from your code
we added that thinking it would fix it but even before addinf that the button wasnt displaying
that's fine, let's go back to the previous code
do you want me to send you the code again?
or do you want us to make the changes on the testing site right away
If you can make the changes right away, that'd be great so I can debug at the same time
Right now, I do see an error/warning about the parameter in the console
okay i'll let u know when it releases
have you registered the domain on Stripe?
It doesn't look like the domain has been registered. Can you register https://portali2.gjirafa.dev/ on your account using the link I shared above?
Ah and I think this is the issue - Google Pay is disabled under your billing Payment Method Configuration - https://dashboard.stripe.com/acct_1NkVdERvd0kOjiXV/test/settings/payment_methods/pmc_1Q0nv9Rvd0kOjiXVIIAVS5ut
I'd recommend enabling that as Express Checkout Element pulls valid payment method types from there
wait a moment
oh okay it appeard thanks a lot, we mixed the payment configuration , we enabled it somewhere else
thank you for your help
NP! ๐ Happy to help