【问题标题】:Android stripe receive payment?Android条带收款?
【发布时间】:2016-10-18 09:25:43
【问题描述】:

我必须集成条带才能接收付款。所以,我的基本概念是会有一些服务提供者和消费者。所以消费者将能够预订服务然后支付相同的费用。我已经实施了消费者侧支付现在我必须从消费者那里接收付款。所以在服务提供商方面我需要配置接收付款的银行账户。

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

  • 按条带列出支持的银行

    拦截器

    1.1) 我找不到在他们的文档中列出支持条带的银行的任何文档

  • 选择任何银行,然后为所选银行添加凭证

  • 保存特定的令牌

  • 验证帐户

  • 从消费者那里获得报酬

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

【问题讨论】:

标签: android stripe-payments


【解决方案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()

第 2 步

收到代表令牌作为回报。完成后,将其附加到您帐户中的 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);

将银行账户添加到客户后,需要进行验证。当使用 Stripe without Plaid 时,验证是通过将两笔小额存款存入 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);

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

参考

【讨论】:

  • 感谢指导:)
猜你喜欢
  • 2023-02-03
  • 2022-01-06
  • 2017-03-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-04-29
  • 2020-01-16
  • 2010-12-01
相关资源
最近更新 更多