#mardo-applepay-error
1 messages · Page 1 of 1 (latest)
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
yeah the problem is client-side
var paymentRequest = stripe.paymentRequest({
country: 'US',
currency: 'usd',
total: {
label: 'Parking ',
amount: @Model.Value.TotalPriceCents
},
requestPayerName: true,
requestPayerPhone : true,
requestPayerEmail: true
});
you don't seem to pass a PaymentMethod object id there
https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#html-js-complete-payment are you getting the pm_123 in that callback?
I am
but also with an error
I have this..
{payment_method: ev.id},
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)
}
}
});
});
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
"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
can you log ev.id
that's the bug
https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#html-js-complete-payment does paymentRequest.on('paymentmethod', function(ev) { // Confirm the PaymentIntent without handling potential next actions (yet). stripe.confirmCardPayment( clientSecret, {payment_method: ev.paymentMethod.id}, {handleActions: false} ).then(function(confirmResult) { if (confirmResult.error) {
you see how it passes ev.paymentMethod.id but for some reason you pass ev.id