我在我的Android应用程序中使用Braintree SDK
为payments
及其工作正常,但这是一个问题,它每次询问信用卡/借记卡详细信息。所以我的问题是,有没有办法存储下次付款的信用卡/借记卡详细信息,而无需再次询问同一用户的信用卡详细信息。
完全披露:我在Braintree工作。如果您有任何其他问题,请随时联系support。
您可以在与Braintree帐户关联的Braintree Payment Method Vault中存储信用卡和其他付款方式。付款方式是associated directly to customer records,客户可能有多种付款方式。
要在结账时向客户提供付款方式,您有两种选择。如果你正在使用自定义集成,你可以check the customer object for associated payment methods然后look up the details for each payment method in turn。如果您使用的是Drop-in,则可以选择更简单的选项。
当它出现一个客户ID时,下载表单automatically fetches a customer's payment methods。要提供客户ID,首先是generate a client token using a customer ID,然后是use that client token to initialize the Drop-in。
ClientTokenRequest clientTokenRequest = new ClientTokenRequest()
.customerId(aCustomerId);
String clientToken = gateway.clientToken().generate(clientTokenRequest);