Include saved cards
Client-Side
In order for Payment Brick to be able to display the saved cards of a given buyer, it is necessary to send the customer ID and card IDs to Brick at the time of its initialization, as in the example below.
settings = {
initialization: {
...,
payer: {
...,
customerId: '209277402-FqRqgEc3XItrxs',
cardsIds: [ '1518023392627', '1518023332143' ]
},
},
...
}
const initialization = {
...,
payer: {
...,
customerId: '209277402-FqRqgEc3XItrxs',
cardsIds: [ '1518023392627', '1518023332143' ]
},
};
Just passing these two properties, Brick will automatically give the user the option to make the payment with their saved cards.
To learn how to create, modify and get the customerId
and cardsIds
, see the Cards and customers management section of the Checkout API documentation.