问题
I'm wanting to set up ACH payments in my django app. I see that stripe does it, however, I'm not sure how to implement it. According to the documentation you can use stripe.js to collect the customer's bank account. I need help with the flow. Do I first use html page to collect the bank info, use stripe.js to add that to Stripe and acquire a token which I then attach it to a Customer?
Does anyone know of any django stripe ach guides? I've been looking around and it seems so new that there isn't really anything out there.
回答1:
So the flow would work like this:
- Collect the user's bank details. You can accomplish this in one of two ways(note that in no case should you collect it using your own HTML, to avoid PCI compliance issues):
- Use Plaid[0]. In this case, Plaid Link creates frontend elements on your site which collects the details. You get back Plaid tokens in the
onSuccess
callback. - Or, collect them yourself using Stripe Elements. You can see an example of this here[1]. You get a Stripe bank account token after calling
createToken
. [2]
- Use Plaid[0]. In this case, Plaid Link creates frontend elements on your site which collects the details. You get back Plaid tokens in the
- You need to verify the details that you collected:
- If you used Plaid, you need to pass the tokens to your backend code and call the Plaid API, which will give you a verified Stripe bank account token.[3] Calling that API is described in [0].
- Or, if you collected the details yourself, you need to do the manual verification process. [4] You call the Stripe API to attach the bank account token to your customer. Stripe will make two small deposits to the bank account. Your customer needs to tell you the amounts of those deposits, which you then submit back to the Stripe API, which verifies the bank account.
- You now have a Stripe Customer object with a bank account attached as a source, and you can make charges against it[5] or subscribe it to a plan, as normal.[6]
[0] - https://stripe.com/docs/ach#using-plaid
[1] - https://jsfiddle.net/ywain/8nobq41n/
[2] - https://stripe.com/docs/stripe-js/reference#collecting-bank-account-details
[3] - https://stripe.com/docs/api#token_object-type
[4] - https://stripe.com/docs/ach#manually-collecting-and-verifying-bank-accounts
[5] - https://stripe.com/docs/api#create_charge
[6] - https://stripe.com/docs/api#create_subscription
来源:https://stackoverflow.com/questions/50469058/basic-questions-for-django-ach-with-stripe