有什么方法可以存储 credit/debit 卡片详细信息以备将来使用 使用 Braintree Android SDK

Is there any way to store credit/debit card detail for future use Using Braintree Android SDK

我在我的 android 应用程序中使用 Braintree SDK payments 并且它工作正常,但这是每次 credit/debit 卡片详细信息时都会询问的一个问题。所以我的问题是,有没有什么方法可以存储 credit/debit 信用卡详细信息以供下次付款,而无需再次询问同一用户的信用卡详细信息。

完全披露:我在 Braintree 工作。如果您有任何其他问题,请随时联系 support.

您可以在 Braintree Payment Method Vault associated with your Braintree account. Payment methods are associated directly to customer records 中存储信用卡和其他付款方式,并且客户可能有不止一种与之关联的付款方式。

要在结账时向客户展示他们的付款方式,您有两种选择。如果您使用的是自定义集成,则可以 check the customer object for associated payment methods then look up the details for each payment method in turn。如果您使用的是 Drop-in,您有一个更简单的选择。

Drop-in 表格 automatically fetches a customer's payment methods when it is presented with a customer ID. To present it with a customer ID, first generate a client token using a customer ID, then use that client token to initialize the Drop-in

ClientTokenRequest clientTokenRequest = new ClientTokenRequest()
    .customerId(aCustomerId);
String clientToken = gateway.clientToken().generate(clientTokenRequest);