#mardo-applepay-error

1 messages · Page 1 of 1 (latest)

narrow rose
#

@wild niche do you have an example pi_123 or pm_123 I can look at?

wild niche
#

pi_3LGWmJHCP53xGZa803kN59Mq failed

#

It was working fine

#

and then just started raising this error

#

var service = new PaymentIntentService();
var intentResponse = service.Create(new PaymentIntentCreateOptions() { Amount = (int)placePricingModelItem.Price * 100, Currency = "USD" });

#

Thats on the server side

narrow rose
#

yeah the problem is client-side

wild niche
#

var paymentRequest = stripe.paymentRequest({
country: 'US',
currency: 'usd',
total: {
label: 'Parking ',
amount: @Model.Value.TotalPriceCents
},
requestPayerName: true,
requestPayerPhone : true,
requestPayerEmail: true
});

narrow rose
#

you don't seem to pass a PaymentMethod object id there

wild niche
#

I am

#

but also with an error

#

I have this..

#

paymentRequest.on('paymentmethod', function(ev) {

          stripe.confirmCardPayment(
            '@Model.Value.Stripe_ClientSecret',
            {payment_method: ev.id},
            {handleActions: false}
          ).then(function(confirmResult) {

              console.log(confirmResult)

            if (confirmResult.error) {
              // Report to the browser that the payment failed, prompting it to
              // re-show the payment interface, or show an error message and close
              // the payment interface.
              ev.complete('fail');
            } else {
              // Report to the browser that the confirmation was successful, prompting
              // it to close the browser payment method collection interface.
              ev.complete('success');
              // Check if the PaymentIntent requires any actions and if so let Stripe.js
              // handle the flow. If using an API version older than "2019-02-11"
              // instead check for: `paymentIntent.status === "requires_source_action"`.
              if (confirmResult.paymentIntent.status === "requires_action") {
                // Let Stripe.js handle the rest of the payment flow.
                stripe.confirmCardPayment(clientSecret).then(function(result) {
                  if (result.error) {
                      ShowError(result.error)
                  } else {
                      ProcessWalletPayment(confirmResult.paymentintent.id)
                  }
                });
              } else {
                    // The payment has succeeded.  
                  ProcessWalletPayment(confirmResult.id)

                  
                
              }
            }
          });
        });
narrow rose
#

you just dropped the whole code

#

what's the error exactly? I just need more details from you really add clear logs to that part of your code to see if it's called

wild niche
#

"message": "A payment method of type card was expected to be present, but this PaymentIntent does not have a payment method and none was provided. Try again providing either the payment_method or payment_method_data parameters."
"type": "invalid_request_error"

#

I tried it both on my mac and my iphone get the same result

narrow rose
#

can you log ev.id

wild niche
#

sure..

#

pm_

narrow rose
#

that's the bug

#

you see how it passes ev.paymentMethod.id but for some reason you pass ev.id

wild niche
#

oh shit

#

duh

#

Thank you!

narrow rose
#

I had to share my screen with a colleague and say it out loud to notice it too

#

so definitely not just you 😂

wild niche
#

not sure how what disappeared but it did

#

have a good evening

#

thanks again