How Do You Use Craftgate?
Before Starting
In order to receive payment through CraftGate, the integration setup in
this link.
How to Create Payment Link
In order to create a payment link via an assistant, a "POST" request must be sent to the following endpoint using the "Integration Module".
endpoint : {baseUrl}/cpayments/craftgate/v1/incoming/createLink
Here baseUrl should be like :

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. Divide this time into periods of 30 seconds, create as many Wait for Action modules as you specify, and set the timeout duration of each to 30.
3. Point the Connection of each Wait for Action to a “Logic Action” as shown below and connect the fallbacks sequentially.
4. Connect both the Connection and fallback of the last module to the same “Logic Action”.
Control of payment
Payments are checked at the beginning of every minute. Via the Wait for Action module,
the PAYMENT_IS_SUCCESS parameter comes to the bot. For this reason, after “Wait for
Actions”, a logic action is used to check whether the PAYMENT_IS_SUCCESS parameter is
“ 1 ”. If response is “ 1 ”, “Payment Successful” response should be conveyed to the end
user. In other cases, a “Payment Failed” response will be sent.
PRODUCT TIP
In order for the bot to receive the expected response with the “Wait for Action”, the installation must be completed by using the “Get Management Token” button after the installation for the channel used.
How to Delete Payment Link

If the payment from the Links created on CraftGate is not made within the specified time, the customer should be prevented from making the payment after the end of the conversation!
Select an "Integration Module" on the fallback link of the "Logic Action" created above and connect it with this module. a "DELETE" request must be sent to the following endpoint using this "Integration Module".
endpoint : {baseUrl}/cpayments/craftgate/v1/incoming/deleteLink
Here baseUrl should be like :
Related Articles
How to Integrate CraftGate
CraftGate is an app that acts as a bridge between companies and banks. It has a structure where these transactions can be managed through a common panel for different POS or methods in payment transactions. For more information check their website We ...
Use of WhatsApp sandbox API
We provide a developer-friendly test environment, for anyone who wants to check out the usage of our WhatsApp API. The WhatsApp API allows for direct-like access to the WhatsApp Business API. Sandbox Base Path: https://waba-sandbox.mindbehind.com ...
How to Use OTP Service
What is OTP Service? OTP service is a password validation service which sends a password as sms to defined number and validate this password with its validator service. In MindBehind products, it can be used before user starts chatting with chatbot ...
How to Use Generic Channel
Creating generic channel: Generic channel can be used to integrate any messaging platform or channel to MindBehind. It supports three actions: Receive endpoint: The MindBehind endpoint that will receive your messages, and its ...
How to use ig.me links
What is IG.ME Links? It provides a way to create a link where users can directly access the instagram dm box. How to create IG.ME Links? Go to Your MindBehind Company Click on Channels and scroll to your INSTAGRAM Channel Click on the IG.ME Link icon ...