To show the customer his payment details use
/customers/:customerId/payment_details endpoint. It will return the list of customer payment details.
The Fetch customer's payment details endpoint will return bound property and active property for each payment method.
bound: true-> such payment details CANNOT be changed.
active: true-> such payment details are used for recurring payments triggered by Cleeng.
To enable the customer to add OR edit his/her payment details, you should implement appropriate flows:
1. Display current payment details. Both
bound payment details should be displayed.
Payment details have important properties:
active: truemeans that Cleeng triggers recurring payments for this payment method.
bound: truemeans that recurring payments are processed outside of Cleeng and such payment details cannot be changed.
2. Add an "edit" option (e.g. a button).
The Fetch customer's payment details endpoint will return bound property for each payment method.
bound: true-> payment details CANNOT be changed.
bound: false-> payment details can be changed.
"Update payment details" feature actually involves adding new payment details and deleting the old ones.
It is recommended that you remove the old details in the background once new payment details are successfully added.
You can enable adding payment details using the methods below:
- Adyen (sample cases: a customer updates a card / a customer wants to switch payment method to Google Pay or any other payment method supported by Adyen payment gateway that does not require any additional actions)
- Adyen finalize adding payment details (finalize adding payment details that requires additional customer action, e.g. 3D Secure)
- PayPal (sample cases: a customer changes payment method from a card to PayPal, a customer wants to use a different account in PayPal)
Please note that no other payment methods are supported. If you want to use a different payment gateway and MediaStore SDK solution, please contact our Broadcaster Success Specialists Team.
You can enable deleting payment details using the
Delete payment detailsendpoint.
Good to know
It depends on a broadcaster's payment settings whether a customer can change payment details (e.g. if a broadcaster has only PayPal payment method configured, a customer can only update PayPal payment method, he/she cannot change to e.g. Adyen).
It is recommended to use hardcoded
paymentMethodIdto decrease the number of requests and to have full control of possible new payment details.
To implement the add/update payment details feature for the Adyen payment gateway follow the tutorial for initial payment. The flow is very similar, the only difference is:
orderIdin Create Adyen payment session,
- call Add Adyen payment details in Adyen Drop-in
- call Finalize add Adyen payment details in Adyen Drop-in
To have online bank payment methods (iDEAL, Sofort) visible in MyAccount, you need to implement support for transactions for authentication purposes (zero-amount). For details see the Adyen Authentication Transactions tutorial.
If there is no payment method with the property
active: true, the "Add a payment method" option should be displayed like in the MediaStore SDK example below.
If a customer selects it, he/she should be redirected to "Update Payment Details" screen. The screenshot below presents the case when the publisher has PayPal, Card and Google Pay enabled.
Example user flows are presented in sample screens from MediaStore SDK.
1. Add/update a card
2. Add/update Apple Pay payment details
3. Remove Payment Method
Payment methods with the
bound: true property can be viewed (they are displayed in the list of customer payment details) but they cannot be edited. Examples of such payment methods include In-App payment methods (e.g. Apple, Android, Amazon, Roku).
If a customer selects the "Edit" button for a payment method with
bound: true property, the application should display a pop-up informing that these payment details cannot be updated. See below the example of a pop-up in MediaStore SDK.
If a payment method with the property
bound: true is the only one in the list, an option to add payment details should be displayed next to it.
All customer transactions will be returned from
/customers/:customerId/transactions. Transactions mean all captured payments.
Customers can access their receipts online, directly in their customer accounts.
To fetch an online receipt for a customer's transaction, i.e. successfully executed (captured) payment, use the following endpoint:
Online receipts are available to customers from My Account -> Your Payments -> Payment History section.
A customer can access a receipt by clicking on a transaction price. This will open a receipt in a separate browser window or tab where it can be printed with the browser built-in printing mechanism.
Updated 6 months ago