Save a card during payment

Save customer's card details on Checkout page, can help customers to pay more quickly in their next payments.

1. Create a Customer

Create a corresponding Customer object for your customer in MoneyCollect.

// Use your private key
MoneyCollect.apiKey = "test_pr_NWZsa******";

CustomerCreateParams customerCreateParams =
Customer customer = Customer.create(customerCreateParams);

2. Create Checkout Session

When creating the Checkout Session, you can specify the customerparameter to automatically attach the created payment method to an existing customer.

// Use your private key
MoneyCollect.apiKey = "test_pr_NWZsa******";

SessionCreateParams params =
Session session = Session.create(params); 

3. Customer selects "save this card" during payment

  1. Select "Save this card for future purchase" on the Checkout page.

  2. Click "Pay".

  3. After pay will save the card details to customer.

4. Customer selects the saved card to make payment

Last updated