Android stripe 收款了吗?

Android stripe receive payment?

我必须集成 stripe 才能接收付款。所以,我的基本概念是会有一些服务提供者和消费者。所以消费者将能够预订服务然后支付 same.I 已经实施了消费者端支付,现在我必须收到消费者的付款。所以在服务提供商方面我需要配置接收付款的银行账户。

让我解释一下我要遵循的步骤

Pl。如果我的理解有任何缺陷,请帮助我任何有经验的人并帮助我克服障碍

让我解释一下添加帐户以使用 stripe 接收付款的步骤。 有两种方法可以验证您的帐户

这里我说明第二种方案

Step 1

我们要做的第一件事是收集用户帐户详细信息以创建需要发送到我们服务器的条带令牌。

设置令牌元数据

Map<String, Object> tokenParams = new HashMap<String, Object>();
Map<String, Object> bank_accountParams = new HashMap<String, Object>();
bank_accountParams.put("country", "US");
bank_accountParams.put("currency", "usd");
bank_accountParams.put("account_holder_name", "name");
bank_accountParams.put("account_holder_type", "individual");
bank_accountParams.put("routing_number", "number");
bank_accountParams.put("account_number", "a/c no");
tokenParams.put("bank_account", bank_accountParams);

创建代币

Token token = null;
 try {
 token = Token.create(params[0]);
  } catch (AuthenticationException e) {
   error = e.getMessage();
   e.printStackTrace();
 }

将令牌 ID 发送到服务器以供以后验证

token.getId()

Step 2

在 return 中收到代表令牌。一旦你有了它,将它附加到你帐户中的 Stripe 客户

// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";

// Get the bank token submitted by the form
String tokenID = request.getParameter("stripeToken");

// Create a Customer
Map<String, Object> customerParams = new HashMap<String, Object>();
customerParams.put("source", tokenID);
customerParams.put("description", "Example customer");

Customer customer = Customer.create(customerParams);

将银行账户添加到客户后,需要进行验证。在不使用 Plaid 的情况下使用 Stripe 时,通过将两笔小额存款存入 Stripe 自动发送的银行账户来完成验证。这些存款需要 1-2 个工作日才能显示在客户的在线对账单上。这些存款的声明描述将是 VERIFICATION。您的客户需要将这两笔存款的价值传递给您。

接受这些值时,请务必注意验证失败的次数上限为 10 次。一旦超过此限制,银行账户将无法验证。仔细告知这些微存款是什么以及它们的使用方式可以帮助您的最终客户避免这个问题。获得这些值后,您可以验证银行帐户:

// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";

// get the existing bank account
Customer customer = Customer.retrieve("cus_7iLOlPKxhQJ75a");
ExternalAccount source = customer.getSources().retrieve("ba_17SHwa2eZvKYlo2CUx7nphbZ");

// verify the account
Map params = new HashMap<String, Object>();
ArrayList amounts = new ArrayList();
amounts.add(32);
amounts.add(45);
params.put("amounts", amounts);
source.verify(params);

验证银行帐户后,您可以对其进行收费。

Reference