In order to create a payment link via an assistant, a "POST" request must be sent to the following endpoint using the "Integration Module".
As a result of this "Integration Module", you need to send the #CRAFTGATE_URL response as a message action to the end user. #CRAFTGATE_URL?lang=en must be used to send the link shared here in English.
Requirements for Create Payment Link
In order for the above-mentioned request to be fulfilled correctly:
The parameters required in the assistant parameter are as follows.
- PAYMENT_PRODUCT_CURRENCY → "TRY" or "AED" or "USD" or "EUR"
- PAYMENT_INTEGRATION_TYPE → "CRAFTGATE”
- COMPANY_NAME → Title on the payment screen. (Ex: MyCompany
WhatsAppOrder)
- PAYMENT_INTEGRATION_ID → The id of the craftgate integration installed
The parameters that should be included in the bot parameter are as follows.
- PAYMENT_AMOUNT -> The totalPriceWithoutPoint parameter should be saved as
this parameter.
- PAYMENT_PRODUCT_DESC -> If it is to be constant, it should be added as an
assistant parameter. If it will be dynamic (include product names) it will return from
integration.
- orderId -> Not required. If company has own orderId it must include (conversation id
is sent when not found)
Receipt of Payment Status
In CraftGate setups, the payment process starts with the sharing of the link. What needs to be done here is to use the "Wait For Action Module" after the "Message Action" with the payment link.
“Wait for Action” allows information from 3th party applications to be used in assistant (For detailed information, see Wait for Action) . However, since an input from the customer while waiting for payment is also counted as a 3th party input, a solution like the one below should be used here.
PRODUCT TIP
1. Specify a required timeout for payment.
2. Choose a Logic Action as Fallback
3. Create 3 conditions
- The first one is if LASTMESSAGEVALUE is equal to {"fallback": true} connect to Delete Link integration
- Second if LASTMESSAGEVALUE is not equal {"fallback": true} connect to a message module (example. You can refer to the link above to complete your payment. If you would like to cancel your payment transaction, type CANCEL.) and then " Go back to “Wait For Action” module.
- Finally, if LASTMESSAGEVALUE is equal to CANCEL connect to Delete Link Integration