I’m using Shared Card on File to make a payment in different merchant accounts,
I search for a customer or create one and I use search-customers and if the user already exist in the seller account I got this response
{"cards":[
{"billingAddress":{"postalCode":"33000"},"cardBrand":"VISA","expMonth":"08","expYear":"2032","id":"ccof:CA1SEBMN-SvNDZ_1W9ImmB4Y5SUoPR","last4":"0070"},
{"billingAddress":{"postalCode":"33000"},"cardBrand":"VISA","expMonth":"08","expYear":"2032","id":"ccof:CA1SEERe4cfvZDKAA1XGwPo1JkUoPR","last4":"0070"},
{"billingAddress":{"postalCode":"33000"},"cardBrand":"MASTERCARD","expMonth":"1","expYear":"2028","id":"ccof:CA1SEJ_j7rlPQSmcJP9k6AN_5LYoPR","last4":"4065"}],"createdAt":"2023-10-26T05:16:49.41Z","creationSource":"THIRD_PARTY","emailAddress":"[email protected]","givenName":"Test","id":"QQ8AT623CRDW1J64KM86WH941W","note":"ccof:CA1SEERe4cfvZDKAA1XGwPo1JkUoPR","preferences":{"emailUnsubscribed":false},"segmentIds":["MLTH1N02JW1SG.CARDS_ON_FILE","MLTHN02JW1SG.CHURN_RISK","MLTCHN02JW1SG.REACHABLE","gv2:864Z0ERRS93KF5N0R2NX0A3910"],"updatedAt":"2023-10-26T09:10:56Z","version":"2"}
]}
then I call create a payment
const response = await client.paymentsApi.createPayment({
sourceId: 'ccof:uIbfJXhXETSP197M3GB', //--?
idempotencyKey: '{UNIQUE_KEY}',
amountMoney: {
amount: 200,
currency: 'USD'
},
autocomplete: true,
customerId: '{CUSTOMER_ID_FROM_SELLER}',
locationId: 'XK3DBG77NJBFX',
referenceId: '123456'
});
console.log(response.result);
what source ID should I use? because I got back 3 different source IDs ‘ccof’ if I use the original one from the main account I got ‘Payment on file not found’
How shared cards works? and how can I match the correct payment source ID from when the user select a card on file in the app to the res api client swap to specific location ID and merchant ID seller access token to share the card on file and then create a payment with the correct source ID?