Stripe payment request button for Google pay does not appear.
I need to implement payment request button for google pay in angular app. I was implementing this regarding docs : https://stripe.com/docs/stripe-js/elements/payment-request-button#verifying-your-domain-with-apple-pay
I'v added trusted SSL Sertificate for my app on localhost. But still receive this issue:
IntegrationError: The paymentRequestButton Element is not available in the current environment.
at new t (https://js.stripe.com/v3/:1:10518)
at t.<anonymous> (https://js.stripe.com/v3/:1:94978)
at t.mount (https://js.stripe.com/v3/:1:24449)
My code :
this.stripe = Stripe('pk_test_key');
this.elements = this.stripe.elements();
const paymentRequest = this.stripe.paymentRequest({
country: 'US',
currency: 'usd',
total: {
label: 'Demo total',
amount: 1000,
},
requestPayerName: true,
requestPayerEmail: true,
});
this.payServices = this.elements.create('paymentRequestButton', {
paymentRequest: paymentRequest,
});
await paymentRequest.canMakePayment()
.then(r => {
this.payServices.mount(this.services.nativeElement);
})
.catch(e => console.log(e));
Expect workable button even on localhost
Fixed. The issue was in :
country: 'US',
currency: 'usd',
I'v changed to:
country: 'GB',
currency: 'eur',
And everything works fine. Thank you! I think there is dependency of you Stripe account country.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With