简体   繁体   中英

Creating a subscription using bank account number using stripe js in node js

I have created subscription by accespting credit/debit card number, exp month, exp year and cvc from front end angular app and creating

  • Customer
  • Product
  • Product Price
  • Payment Method
  • Subscription

In payment method i provide following details:

    async function createPaymentMethod(data) {
  let body = {
    type: 'card',
    card: {
      number: data.card?.number,
      exp_month: data.card?.exp_month,
      exp_year: data.card?.exp_year,
      cvc: data.card?.cvc
    }
  };
  return await stripe.paymentMethods.create(body);
}

Now i want to create payment method but want to use customer's bank account number but i am unable to find a way to do it. I want to add "type: bank_account"

Note: I am using Strip JS and Node JS. All of this I want to do on server side ie node js

Collecting Credit Card server-side is a bad idea, since you will expose yourself to the burden on PCI-Compliance. You would want to review Stripe's Integration Security Guide . Generally you would want to use client-side SDK to collect credit card information instead.

To the question of a bank account, it depends on which specific PaymentMethod you're gonna use (which country's bank transfer?) Ie. If you are talking about ACH in the US, you should follow the ACH Guide . Similarly it will collect bank account information client-side in exchange of a token, then passing it up to your back end.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM