#Sinduri

1 messages · Page 1 of 1 (latest)

fervent oliveBOT
steel sage
opal jewel
#

I'm a developer and I need to debug an issue thats why I am using sandbox mode

steel sage
#

Did you set the GooglePayEnvironment to Test or Production ?

opal jewel
steel sage
#

Are you testing Google Pay from a mobile browser or within your mobile app?

opal jewel
#

no testing it using MacBook laptop

steel sage
#

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?

opal jewel
#

Ys, I'll share

steel sage
#

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?

opal jewel
#

Ys I've tried with live card

steel sage
#

Did you get the error after clicking on PAY button in the Google Pay sheet?

opal jewel
#

ys

steel sage
#

Can you share with me the PaymentIntent ID?

opal jewel
#

There is no paymentintent ID

steel sage
#

btw. This is a public channel so you might want to remove the video, your email is there

opal jewel
#

Payment flow is stopped at the initial stage itself

#

Ok, I've deleted

steel sage
#

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?

opal jewel
#

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();
    }
  });
steel sage
#

I don't think you need to call prButton.on( 'click', function( evt ) here.

opal jewel
steel sage
opal jewel
opal jewel
#

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]

steel sage
#

The Google Pay button should be responsible for payment only, and I'd recommend you to use another button to handle the item addition.

opal jewel
#

Okay. Can you help to sort out the issue An unexpected error has occurred. Please try again later. [OR-IBIDL-01]

opal jewel
steel sage
#

Sure, but I need the paymentIntent ID

opal jewel
#

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 );
      }
    });
  });
},
steel sage
opal jewel
#

test key

#

this is on sandbox mode

#

You can try

steel sage
#

Can you share with me your merchant ID? you can find it from the Stripe Dashboard -> Settings ->Account Details

opal jewel
#

acct_1K1nGNDdkJaUNPZE

steel sage
#

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?

opal jewel
#

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

steel sage
opal jewel
steel sage
#

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

opal jewel
#

Ys I checked the logs generated for your payment. But in my case there is no logs even for token creation.

steel sage
#

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 ) {
opal jewel
#

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?

steel sage
#

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 );
          }
        });
      });
    }, 
opal jewel
#

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

steel sage
#

What plugin are you using now and what other plugins have you tested?

opal jewel
steel sage
#

So basically you don't receive the paymentmethod events, am I right?

opal jewel
#

Ys

steel sage
#

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.

opal jewel
#

Okay