How to Use CraftGate?

How to Use CraftGate?

Before Starting

In order to receive payment through CraftGate, the integration setup in this 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 :
For partners on gcp servers https://app.mindbehind.com
For partners on tr servers https://trapp.mindbehind.com



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.

In order for the above-mentioned request to be fulfilled correctly:
The parameters required in the assistant parameter are as follows.
  1. PAYMENT_PRODUCT_CURRENCY → "TRY" or "AED" or "USD" or "EUR"
  2. PAYMENT_INTEGRATION_TYPE → "CRAFTGATE”
  3. COMPANY_NAME → Title on the payment screen. (Ex: MyCompany WhatsAppOrder)
  4. PAYMENT_INTEGRATION_ID → The id of the craftgate integration installed
The parameters that should be included in the bot parameter are as follows.
  1. PAYMENT_AMOUNT -> The totalPriceWithoutPoint parameter should be saved as this parameter.
  2. 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.
  3. 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
  1. The first one is if LASTMESSAGEVALUE is equal to {"fallback": true} connect to Delete Link integration
  2. 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.
  3. Finally, if LASTMESSAGEVALUE is equal to CANCEL connect to Delete Link Integration


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.


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 :
For partners on gcp servers https://app.mindbehind.com
For partners on tr servers https://trapp.mindbehind.com










    • 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 ...
    • Parameters to use Shopify

      First of all, you need to add Shopify integration to your company. ‘Integration Name’ can be anything you want. And you can get ‘Store Url’ and ‘Access Token’ from Shopify. Now you can use Shopify integration on your own bot with e-commerce module. ...
    • 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 ...