0
votes

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 i.e node js

1

1 Answers

0
votes

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.