#Sinduri
1 messages · Page 1 of 1 (latest)
Hi there. you need to request production access for Google Pay. The details is here https://stripe.com/docs/google-pay?platform=android#going-live
I'm a developer and I need to debug an issue thats why I am using sandbox mode
Did you set the GooglePayEnvironment to Test or Production ?
Sorry?I followed this article
https://stripe.com/docs/stripe-js/elements/payment-request-button
Are you testing Google Pay from a mobile browser or within your mobile app?
no testing it using MacBook laptop
So you are testing it in a Chrome browser running in a Macbook? Is there a public URL that I can use to produce the problem?
Ys, I'll share
https://wm.benefitmankind.co.uk/
It's our customer's site. Just click Donate now and go to the cart or checkout
I can see the Google Pay sheet is showing up after clicking on the Google Pay button. Did you add an active credit card (not test card) to your Google Pay account?
Ys I've tried with live card
Did you get the error after clicking on PAY button in the Google Pay sheet?
ys
Can you share with me the PaymentIntent ID?
There is no paymentintent ID
btw. This is a public channel so you might want to remove the video, your email is there
But you need a payment_intent_secret in order to call stripe.confirmCardPayment() in the handler of paymentRequest.on('paymentmethod',
Can you share with me your code?
Let me check
var paymentRequest = stripe.paymentRequest(paymentdetails);
var elements = stripe.elements();
var prButton = elements.create('paymentRequestButton', {
paymentRequest: paymentRequest,
style: {
paymentRequestButton: {
type: eh_payment_request_params.button_type,
theme: eh_payment_request_params.button_theme,
height: eh_payment_request_params.button_height + 'px'
},
}
});
paymentRequest.canMakePayment().then(function(result) {
if (result) {
if (result['applePay'] == true) {
// document.getElementById('eh-stripe-payment-request-button').style.display = 'none';
//show applepay button
$('.apple-pay-button-div').show();
$('.woocommerce-checkout .apple-pay-button').css('visibility', 'visible');
$('#eh-payment-request-button-seperator').hide();
}else{
$('.apple-pay-button-div').hide();
if(eh_payment_request_params.product){
prButton.on( 'click', function( evt )
{
var applepay = '';
eh_payment_request_gen.add_to_cart(evt,paymentRequest,applepay);
});
}
prButton.mount('#eh-stripe-payment-request-button');
}
} else {
document.getElementById('eh-stripe-payment-request-button').style.display = 'none';
$('#eh-payment-request-button-seperator').hide();
$('.apple-pay-button-div').hide();
}
});
I don't think you need to call prButton.on( 'click', function( evt ) here.
You should just register a paymentMethod event and call stripe.confirmCardPayment in its handler. Example code is available here https://stripe.com/docs/stripe-js/elements/payment-request-button?client=html#html-js-complete-payment
This is integrated in our Stripe WooCommerce plugin and er provide google pay button in product page also so we need to add the item to cart through our plugin when a user click on the G pay button in product page
let me check
In our integration confirming the payment intent is after creating Woocommerce order all these include in the function ProcessPaymentMethod()
paymentRequest.on('paymentmethod', function(evt) {
$.when( eh_payment_request_gen.ProcessPaymentMethod( evt) ).then( function( response ) {
if ( 'success' === response.result ) {
eh_payment_request_gen.completePayment( evt, response.redirect );
} else {
eh_payment_request_gen.paymentFailure( evt, response.messages );
}
});
});
},
the payment via G Pay was working fine before!!Now it give the error An unexpected error has occurred. Please try again later. [OR-IBIDL-01]
The Google Pay button should be responsible for payment only, and I'd recommend you to use another button to handle the item addition.
Okay. Can you help to sort out the issue An unexpected error has occurred. Please try again later. [OR-IBIDL-01]
Okay. We just doing some necessary actions on the callback function of payment method event. We havent had any issue like this before
Sure, but I need the paymentIntent ID
there is no payment intent is created. payment flow is not reached there...its just stopped by getting the error I've mentioned.
payment flow not even reached on the event beacuse if it's reached there will be a call to our server from the function eh_payment_request_gen.ProcessPaymentMethod()
paymentRequest.on('paymentmethod', function(evt) {
$.when( eh_payment_request_gen.ProcessPaymentMethod( evt) ).then( function( response ) {
if ( 'success' === response.result ) {
eh_payment_request_gen.completePayment( evt, response.redirect );
} else {
eh_payment_request_gen.paymentFailure( evt, response.messages );
}
});
});
},
I'd like to do a test in this webpage https://wm.benefitmankind.co.uk/basket , is this configured with test key or live key?
Can you share with me your merchant ID? you can find it from the Stripe Dashboard -> Settings ->Account Details
acct_1K1nGNDdkJaUNPZE
https://dashboard.stripe.com/test/logs/req_JnkqzUr0VQIxzt I just tested it, and based on the log the google pay payment method was created successfully.
Therefore the error is very likely related to the paymentIntent secret that you pass in to stripe.confirmCardPayment(), can you put some logs around your code and see if there's anything prevent the PaymentIntent from being created?
Ys I am seeing your logs. But in my case there is no logs
even the first token creation is not in the logs
So the payment get stopped at the inital stage itself
https://dashboard-admin.stripe.com/test/logs/req_CQ8PMXLBaSWzXf this is the log for token creation.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
But this function is inside the paymentmethod event right?
The payment flow is not reached there
The logs showed you how Stripe created a Google Pay payment_method successfully. So the next step is to pass a payment_intent_secret and call stripe.confirmCardPayment
Ys I checked the logs generated for your payment. But in my case there is no logs even for token creation.
So you now should check why the code below line paymentRequest.on('paymentmethod', function(evt) is not executed.
paymentRequest.on('paymentmethod', function(evt) {
$.when( eh_payment_request_gen.ProcessPaymentMethod( evt) ).then( function( response ) {
paymentRequest.on( 'shippingaddresschange', function( evt ) {}
these events are called but the flow is not reached to paymentmethod event before I got the error "An unexpected error has occurred. Please try again later. [OR-IBIDL-01]
"
shippingaddresschange, shippingoptionchange events are working..
You there?
If you put some logs here, what do you see?
eh_payment_request_gen.ProcessPaymentMethod()
paymentRequest.on('paymentmethod', function(evt) {
console.log("on paymentRequest paymentMethod")
$.when( eh_payment_request_gen.ProcessPaymentMethod( evt) ).then( function( response ) {
console.log("eh_payment_request_gen.ProcessPaymentMethod")
if ( 'success' === response.result ) {
eh_payment_request_gen.completePayment( evt, response.redirect );
} else {
eh_payment_request_gen.paymentFailure( evt, response.messages );
}
});
});
},
Not see any logs on console
This issue is not only with our plugin. Now I've checked with 2 competitors plugin and I got the same issue with their plugin also
What plugin are you using now and what other plugins have you tested?
So basically you don't receive the paymentmethod events, am I right?
Ys
This is indeed very strange, and I will need more time for investigation. Can I suggest you to write in to Stripe support (https://support.stripe.com/contact ), provide them the details and tell them you've talked to the Stripe engineers in discord. They will forward the ticket to us and we'll continue from there.
Okay