question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not possible to specify payment_method_types

See original GitHub issue

Hi there! I wanted to specify other payment methods like stated in docs; https://stripe.com/docs/payments/p24/accept-a-payment?platform=checkout

const session = await stripe.checkout.sessions.create({
  payment_method_types: ['card', 'p24'],
  line_items: [{
...

but it seems not possible. I tried to look into the source code. It seems that in stripe.js https://github.com/dayhaysoos/use-shopping-cart/blob/6fd480cdc8264a609efaf6ea879178ea8a4e2769/use-shopping-cart/core/middleware/stripe.js#L9 we would need to add extra parameter (getCheckoutData function)

const options = {
    mode: cart.mode,
    paymentMethodTypes: cart.paymentMethodTypes, // THIS IS MISSING ?
    lineItems,
    successUrl: cart.successUrl,
    cancelUrl: cart.cancelUrl,
    billingAddressCollection: cart.billingAddressCollection
      ? 'required'
      : 'auto',
    submitType: 'auto'
  }

and extend the CartState thing here; https://github.com/dayhaysoos/use-shopping-cart/blob/6fd480cdc8264a609efaf6ea879178ea8a4e2769/use-shopping-cart/core/index.d.ts#L117

Seems like a quick win, but probably I am missing something.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
dayhaysooscommented, Nov 18, 2021

Hey! Thanks for bringing my attention to this, I’m gonna take a deeper look at this later tonight, just wanted to let you know that I saw this!

0reactions
marcingoleniacommented, Jan 7, 2022

😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stripe API reference – PaymentMethods – curl
Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. Hide child attributes ...
Read more >
Fix payment and billing issues - Google Workspace Admin Help
Step 1: Make sure your payment method is valid · Click Add Payment Method. · Select the payment method and enter the details....
Read more >
Payment Types
The Configuration > Cashiering > Payment Types option lets you define the payment method codes which you can select from the Reservation screen...
Read more >
express - Stripe API "No valid payment method types for this ...
Stripe is looking for a payment method that can handle an amount lower than the minimum so that's why you get this error....
Read more >
Payment Error Codes - ISN
CODE TEXT DESCIPTION I00001 Successful. The request was processed successfu... I00002 The subscription has already been canceled. The subscription has already been ca... I00003 The record...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found