Skip to main content

Payment Method Replaced

Scenario

Consider the following the scenario when a payment method is replaced

  1. User Adds a card A ending with 1234.
  2. Card A is expired and user got a new card B ending with 5678.
  3. User Adds the new card B ending with 5678.
  4. CCG got the event from Vendor saying card A is updated with card B

In the above case, the card A is considered as duplicate.

NOTE: The above is just a example scenario for a CARD, it can happen to any of the payment method types.

What happens to the Duplicate card A?

CCG deletes the card A from the wallet and sends PAYMENT_METHOD_DELETED event to merchants.

How merchants knows card A is replaced with card B?

CCG sends a PAYMENT_METHOD_REPLACED event to the merchants.

Sample event structure is given below.

{
"name": "PAYMENT_METHOD_REPLACED",
"payload": {
"paymentMethod": { // Payment Method information of CARD B
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"card": {
"last4": "string",
"type" : "CARD",
"status": "ACTIVE",
"cardBrand": "VISA",
"expiryYear": 0,
"nameOnCard": "string",
"expiryMonth": 0,
"zipCode": "string",
"manufacturerCard": false
},
"paymentMethodDetails": {
"last4": "string",
"type" : "CARD",
"status": "ACTIVE",
"cardBrand": "VISA",
"expiryYear": 0,
"nameOnCard": "string",
"expiryMonth": 0,
"zipCode": "string",
"manufacturerCard": false
},
"default": true,
"paymentMethodType": "CARD",
"nickname": "string"
},
"customer": {
"enterpriseId": "enterprise id",
"hsid": "hsid",
"dateOfBirth": "dob",
"metadata": {
"patientId": "rx-patient-id"
}
},
"agent": {
"firstName": "First Name",
"lastName": "Last Name",
"userId": "msId",
"isAccessVerified": true
},
"deletedPaymentMethodId": "597f6eca-6276-4993-bfeb-53cbbbba6f12" // CCG Payment Method ID of CARD A
}
}