stripe / stripe-node

Node.js library for the Stripe API.
https://stripe.com
MIT License
3.88k stars 749 forks source link

Cannot create Invoice and PaymentIntent with 'paypal' as payment_method_types. #1755

Closed kotoshii closed 1 year ago

kotoshii commented 1 year ago

Describe the bug

As I know, support for PayPal payments was added some time ago. I'm trying to create an Invoice using the following body:

let createBody: Stripe.InvoiceCreateParams = {
  customer: customer.id,
  auto_advance: false,
  collection_method: 'charge_automatically',
  automatic_tax: {
    enabled: true
  },
  payment_settings: {
    payment_method_types: ['card', 'paypal']
  }
}

But when I try to run it, I receive this error:

StripeInvalidRequestError: Invalid payment_settings[payment_method_types][1]: must be one of ach_credit_transfer, ach_debit, acss_debit, au_becs_debit, bacs_debit, bancontact, boleto, card, cashapp, customer_balance, eps, fpx, giropay, grabpay, ideal, konbini, link, p24, paynow, promptpay, sepa_debit, sofort, us_bank_account, or wechat_pay

The same thing happens while trying to create a PaymentIntent for my Invoice manually, like this:

paymentIntent = await stripe.paymentIntents.create({
  customer: finalInvoice.customer as string,
  payment_method_types: ['card', 'paypal'],
  amount: finalInvoice.amount_due,
  currency: finalInvoice.currency,
});

But if I enable automatic payment method detection (automatic_payment_methods), when creating the PaymentIntent manually (it's not possible to do this in payments_settings option of Stripe.InvoiceCreateParams), then I get all the enabled payment methods from my dashboard, including PayPal.

I assume that PayPal option is not available in the current SDK version because it's still in Private Beta (according to what's said in Dashboard). In this case, could you please provide any information on whether you are going to add the support in the near future?

To Reproduce

  1. Try creating an Invoice with payment_settings.payment_method_types equal to ['paypal'] OR
  2. Try creating a PaymentIntent with payment_method_types equal to ['paypal']

Expected behavior

Invoice or PaymentIntent is created with the provided payment_method_types.

Code snippets

No response

OS

Linux Ubuntu

Node version

18.15.0

Library version

11.18.0

API version

2022-11-15

Additional context

No response

remi-stripe commented 1 year ago

@kotoshii Paypal is not supported by Stripe publicly. We do have a private beta but you need to have access first and not all parts of our products support this. This is an integration support question and not something we can help with on this repo. Please work directly with our support team for help: https://support.stripe.com/contact

kotoshii commented 1 year ago

@kotoshii Paypal is not supported by Stripe publicly. We do have a private beta but you need to have access first and not all parts of our products support this. This is an integration support question and not something we can help with on this repo. Please work directly with our support team for help: https://support.stripe.com/contact

Thanks for the reply. I also noticed that in version 12.1.0-beta1 you actually have the types updated so that there's a support for 'paypal' payment method. Are there any estimations or plans on this part of work?

remi-stripe commented 1 year ago

@kotoshii please work directly with our support team to ask for access or discuss this beta instead!