Salebot.ai
Search…
⌃K

Coinpayments

How to connect

To connect the payment system Coinpayments will need 4 values: seller ID, IPN secret (for webhooks), private api key and public api key, as well as to set the webhook url.
Go to Coinpayments account -> Settings
On the first tab, copy the seller ID (seller ID)
Then go to the Settings tab of the seller and come up with and enter the secret key IPN - IPN secret (This is used to confirm that the webhook comes from us, use a reliable complex string that will be difficult to guess.)
Link IPN - url address for webhooks, add the following: https://chatter.salebot.pro/coinpayments_callback/result
Then go to the API Keys section and generate a key pair to access the api.
Save all the settings, copy the data and go to the settings in Salebot. Open the section on payment systems, select Coinpayments.
We need to input the data.
To generate a link to payment, you need to set the value of the required variables: original_currency - Original currency of the transaction. sending_currency - Currency sent by the buyer. For example, if your products are priced in USD but you get BTC, you should use original_currency = USD and sending_currency = BTC. original_currency and sending_currency may have the same value if currency conversion is not required.
buyer_email is the buyer’s email address. To send notifications if the payment is less and you need to pay extra or for returns. If this variable is not specified, mail will be taken automatically from the email variable, if the user has one in salebot.
After that, you should set the value of the payment_sum variable (for example, 10 or 0.0055 (via a dot!)), immediately after that the paycoinments_pay_url variable will appear. This variable can be displayed with a link or placed on the button with the text "Pay". The link is: https://www.coinpayments.net/index.php?cmd=checkout&id=CPFK5QZ3FKSNWHI75CO8M4BRVkey&e7782d2ce24f7d03815606a5c4a882eb
Also, before setting the payment_sum value, you can specify the following optional variables to configure the payment.
payment_description - the name of the product, will be on the payment information page and in the IPN for the transaction.
buyer_name - the name of the buyer
Create a link to the payment of 0.44444
Please note:
  • First specify the email
  • Next optional parameters first_name, payment_description, etc.
  • And last, assign the value of the payment_sum variable
Note, first we set the variables for the settings, then payment_sum. You can define variables earlier in a chain, not in a single block, this is an example.
Next, at the right place, print the variable coinpayments_pay_url that contains the link
To make a repeat payment, you must reset payment_sum, the previously generated link, and after you reset the payment_sum variable to get a new link

How to process the result

After successful payment in the bot will come kolbeks, on which you can understand that there was a successful payment. These colbecks in the system you see as messages from the user, so that they can not be sent by the user, they consist of the first 10 characters of the secret key and a notation _success, for example: 16831CF4b5_success
These colbecks DO NOT SEE the user, they are displayed only to the operator.
The type of comparison should be "Full match"
Also after successful payment, the variable coinpayments_payment_completed is set to true
For example, you can make a successful payment processing block with a condition and print the corresponding message to the user:
Upon completion of payment, a coinpayments_payment_callback variable will be added to the client, containing the payment system response data for the completed transaction. You can extract the necessary data from the dictionary using the get method.

How to check the payment status

To check the payment status, you need to call coinpayments_get_payment_status() in the Calculator field
Example:
Examples od the statuses:
Waiting for buyer funds...
Funds received and confirmed sending to you shortly…
Complete
Last modified 6mo ago