How to Accept Chatbot Payments

Implement payment for products in one click - add a payment button a message based on your chatbot scenario and automate the purchase process.

After clicking on the button, the user will be redirected to the payment page of the selected payment system, where they can select their account and pay for the product. The money will be immediately transferred to your payment system account.

After payment, the flow can be continued in scenarios when payment was successful.

How to Add a Checkout Button

Select a Button Type

Add a Message element. Enter a description for the item. You can also add interactive elements: a picture or gallery from product cards.

Click + Add Button.

Choose "Payment."

Add a Button Text

Write the text of the button in the field. For example, clarify the product price and payment system for the user if you are adding two different buttons.

Select a Payment Method

Select through which payment system you will accept payments. If you added several merchants for the same payment method, select a merchant from the second dropdown list.

To accept payments via different payment methods, add an additional button, and select another payment method and merchant.

Add a Payment Amount

Select a payment type — “Fixed price” or “Any amount” — and enter the amount.

To choose or change the currency you accept, go to “Account settings” > “Accept payments,” and, next to your payment method, go to merchant settings, and choose a currency.

For example, you can choose the “Any amount” type for donations, so users can transfer any amount of money. If you choose this type, set the minimum payment amount, and when a user meets or exceeds it, the successful payment flow will continue.

Add a Product Name

Enter your product name. Your product name and price will be displayed on the payment system page and in the receipt.

Set Up an Integration with CRM

You can also choose which pipeline automatically created deals go into. In your pipeline settings, you can choose at which stage of the pipeline to add a deal, depending on the payment status. By default, the deal is added to the first stage of your first pipeline.

Then click Add to save the button. And then click Apply to save the changes.

How to Continue the Flow

After payment, you can configure a successful payment scenario. To continue the flow, connect the next element with the green dot after the payment button.

You can, for example, add an action to assign a tag, change the value of a variable, and send an alert to your CRM via webhooks. You can also create a record in your CRM, or request information, filter the values and, depending on the results, send the desired message to the user.

In the message, you can also use dynamic data provided by the payment system as a JSON Path expression.

Note: JSON Path data can only be used once in your next text element.

For example, you can send a message with a customer’s order number, order description, price, and currency:

We have received your payment for the order {{$['order_number']}} in the amount of {{$['order_amount']}} {{$['order_currency']}}. You can download the book using the link below.

Where:

 Variable as a JSON Path Description
{{$['order_number']}} Payment ID
{{$['order_desc']}} Product description
{{$['order_amount']}} Product price
{{$[' order_currency']}} Product currency

Once you finish setting up the flow, click Save and run the flow, start testing by sending the flow to yourself.

You can test the payment service without money. This payment will be assigned the "Test" status.

How the Payment Process Looks from the User's Side

After clicking on the "Buy" button, the user is redirected to the payment system page.

The page will display the name of the product and the price. The user will have to choose to pay with a saved or new card.

The transaction details will display your wallet and payment method. The payment will need to be confirmed.

In case of successful payment, the user will be shown a message about the successful transfer on the payment page.

And the scenario for the successful payment flow will be launched in the chatbot.

How to Test Chatbot Payments

You can test your integration with payment systems and check payment processing for various statuses.

To do this, the bot owner needs to proceed with the flow to the payment button. After clicking on the "Buy" button, you will be redirected to the test payment page.

Click Test checkout.

Then, select the status you want to check.

Сompleted - the user has successfully paid for the product and the money has been credited to your account.
Incomplete - the user went to the payment page, but did not complete the payment.
Canceled - the user canceled the payment.
Error - an error on the side of the issuing bank; for detailed information, the user who has tried to pay can be advised to check their data and card limits or contact their bank for support.

How to View Payment History

To view your payment history, click on the "Chats" sidebar and go to the "Orders" tab. You will see payment details: username, product name, price, date of last status change and payment status.

All payment statuses are given by the selected payment system. For more information, we recommend contacting the support of the payment system.

You can also view your payment history through “Account Settings” > “Accept Payments.”

How to Send a Successful Payment Webhook

You can also send webhooks to your system notifying that the users have successfully paid for your products.

Go to "Account Settings" in the "API" tab. Under the “Successful payment webhooks” section, click Create Webhook.

Paste the URL you want to send the event to.

An example of the webhook structure you can receive:

{
  "timestamp": 1644590834,
  "version": "1.0",
  "event": "payment_order",
  "order": {
    "totalCost": 12,
    "status": 200,
    "customerName": "User",
    "service": 2,
    "paymentMethodType": 7,
    "variables": [
      {
        "valueType": 1,
        "name": "String",
        "value": "Hello World"
      },
      {
        "valueType": 2,
        "name": "Number",
        "value": "55684213"
      },
      {
        "valueType": 3,
        "name": "Date",
        "value": "2022-02-25"
      },
      {
        "valueType": 5,
        "name": "Phone",
        "value": "+38063456228"
      },
      {
        "valueType": 6,
        "name": "Email",
        "value": "user@sendpulse.com"
      },
      {
        "valueType": 7,
        "name": "Link",
        "value": "http://sendpulse.com"
      }
    ],
    "number": 1618,
    "currency": "BRL",
    "contactId": "7a505f4293dffcd7100f8f0004214892e4cf5618307908edf465042075d5c30",
    "updatedAt": "2022-02-11T14:47:14+00:00",
    "type": 2,
    "id": "a3704313-8c0b-0000-b195-c6b84242f0e2",
    "createdAt": "2022-02-11T14:47:13+00:00",
    "description": "Apple MercadoPago"
  }
}
Rate this article about "How to Accept Chatbot Payments"

User Rating: 4 / 5

    Popular in Our Blog

    Try creating a chatbot for Facebook Messenger for free