How can I request a multi-pay token from the iFrame?
I understand there is a separate flow for using the /customers API, but we maintain a database of customers for the merchant and the database is centralised for multiple locations (aka UUIDs aka merchants). So what I'd prefer to do is just store the customer's token after a single tokenization action for use in the future by the same customer (merchant initiated, subsequent charges).
I've spotted the documentation as mentioned here: https://docs.clover.com/clover-platform/docs/ecommerce-saving-card but what I'd like to do is send up a parameter in the iFrame and have the token returned as a multi-pay token - is this possible?
EDIT:
I've figured out how to initiate the multi-pay token from the iframe, for reference, it just requires sending the following from the frontend:
However, that brings me to my next question. When sending subsequent payment requests via the API and setting the `stored credentials` along with the rest of the body for the /v1/charges API like this:
body:
{ "amount": 300, "currency": "eur", "source": "clv_1TSTSTB3Rd4SNUUUgDDjP2rp", "description": "Merchant Name", "ecomind": "moto", "stored_credentials": { "sequence": "SUBSEQUENT", "initiator": "MERCHANT", "is_scheduled": false } }
The charge is successful, but I get the following warning message:
"warning_message": "Subsequent credential on file pay request sent for without Initial credential on file pay request.",
I presume I need to store and send the initial payment ID with subsequent requests. However I'm not sure which value to store ("ref_num" or "auth_code") and what to label it as when I send up subsequent requests? (presumably another value in the "stored_credentials" object?)
EDIT 2:
OK so I've figured out how to get the subsequent payments working after getting a multipay token from the iFrame as follows:
First request (customer initiated):
{ "amount": 100, "currency": "eur", "source": "clv_1TSTSTB3Rd4SNUUUgDDjP2rp", "description": "Merchant Name", "ecomind": "ecom", "stored_credentials": { "sequence": "FIRST", "initiator": "CARDHOLDER", "is_scheduled": false, } }
This returns a ref_num value in the response that needs to be stored and sent as part of a "recurring" payment in subsequent requests as follows:
{ "amount": 200, "currency": "eur", "source": "clv_1TSTSTB3Rd4SNUUUgDDjP2rp", "description": "Merchant Name", "ecomind": "moto", "stored_credentials": { "sequence": "SUBSEQUENT", "initiator": "MERCHANT", "is_scheduled": true, "installment_info": { "bill_pay_indicator": "Recurring", "invoice_number": {ref_num from initial transaction response} } } }
So now that I have everything working as expected, most of this is undocumented, so my question is, are you going to remove this or can I use it with confidence in production?
Thanks and sorry for the runaround.