ChatHub/docs

Search documentation

SUGGESTED FOR YOU135 results

Search published articles · By section

Configure bank payments with Pay2S

Connect a bank account, create a Pay2S webhook, store its secret and configure recipient details in ChatHub for automatic wallet crediting.

How Pay2S works with ChatHub#

When a customer reaches a Top up via Pay2S workflow step, ChatHub creates a reference code beginning with NAP and sends transfer instructions. Pay2S watches the connected bank account and posts incoming transfers to ChatHub; a positive transfer carrying the correct code is recorded and credited to the customer's wallet.

  1. 1

    Connect the recipient bank account to Pay2S.

  2. 2

    Create an Incoming webhook in Pay2S using the address supplied by ChatHub.

  3. 3

    Copy the webhook secret key and save it with recipient bank details in ChatHub.

  4. 4

    Use a workflow with a Top up via Pay2S step, then verify a test transfer containing the exact reference code.

1. Prepare the accounts and public URL#

  1. 1

    A ChatHub account allowed to open Administration → Settings → Payments.

  2. 2

    An active Pay2S account and a bank account supported by Pay2S. Have the bank login, account-holder information and OTP method available if required.

  3. 3

    A production ChatHub domain with HTTPS that Pay2S can reach from the Internet. Do not use localhost or a DDEV hostname that works only on your computer for a real webhook.

  4. 4

    Choose the recipient account. The bank, account number and holder entered in ChatHub must match it so customers receive accurate instructions.

The webhook secret key is sensitive. Copy it only from Pay2S to the Webhook secret key field in ChatHub; never place it in documentation, screenshots, source code or support messages.

Open the Pay2S dashboard

3. Copy the webhook address from ChatHub#

  1. 1

    In ChatHub, open Administration → Settings and select Payments.

  2. 2

    Expand Pay2S under Bank transfer.

  3. 3

    Under Webhook address, click Copy. It has the form https://your-chathub-domain/api/payments/pay2s/webhook.

  4. 4

    Confirm that it uses your public production HTTPS domain before pasting it into Pay2S.

Vietnamese ChatHub interface. Select Thanh toán (Payments) on the left. The Payment methods box shows how many methods are ready; expand Pay2S below it to configure bank transfer.
Vietnamese ChatHub interface. Copy sits beside the webhook address; the secret, bank, account number and holder fields are below. chathub.ddev.site, 0000000000 and NGUYEN VAN A are unsaved samples; use your public domain and real recipient details.

4. Create an Incoming webhook in Pay2S#

  1. 1

    Return to Pay2S, open Webhooks → Danh sách webhook (Webhook list), then click Thêm webhook (Add webhook).

  2. 2

    Give it a recognizable name, such as ChatHub - incoming.

  3. 3

    Choose Tiền vào (Incoming) for the event and select the bank account connected in step 2.

  4. 4

    Paste the ChatHub address into Gọi đến URL (Webhook URL).

  5. 5

    Keep the optional payment-code structure set to Không giới hạn theo mã thanh toán (No payment-code restriction) so ChatHub can match NAP codes in transfer descriptions. Invoice information is not required for this wallet top-up flow.

  6. 6

    Review the account, event and URL, then click Thêm webhook.

Vietnamese Pay2S interface. Tiền vào (Incoming) is selected; you must also select a bank account. chathub.example.com is a sample URL, and this form was not submitted.

5. Copy the secret key and save ChatHub settings#

  1. 1

    Immediately after creating the webhook, copy the token/secret shown by Pay2S. Pay2S documentation says it appears only once during webhook creation.

  2. 2

    Return to Pay2S settings in ChatHub and paste it into Webhook secret key.

  3. 3

    Enter the bank, account number and holder exactly as used by the recipient account in Pay2S. The workflow includes these three values in customer transfer instructions.

  4. 4

    Click Save and wait for the payment-settings saved message. The Pay2S card should show Configured.

After saving, ChatHub does not send the stored secret back to the browser. When editing only bank details, leave the secret field blank to preserve the current key. Paste a new key only after replacing the Pay2S webhook token.

6. Use Pay2S in a wallet top-up workflow#

  1. 1

    Open Automation → Workflow and choose the sales or top-up workflow that should offer bank transfer.

  2. 2

    Add or inspect the Top up via Pay2S step. If it says Pay2S configuration required, return to step 5 and confirm that the secret was saved.

  3. 3

    Make sure the workflow sends the correct bank, account number, holder, amount and reference generated by the Pay2S step.

  4. 4

    Enable the workflow after reviewing success, failure and cancellation paths. Avoid having several workflows greet or process the same customer unless intended.

Read the Workflow guide

7. Verify transfer detection and wallet credit#

  1. 1

    Run a test contact through the Top up via Pay2S step and record the amount and NAP code supplied by ChatHub.

  2. 2

    Transfer the exact amount to the correct account and place the full NAP code in the transfer description. Use one transaction for one test.

  3. 3

    In Pay2S, confirm the incoming transfer under Bank transactions, then inspect Webhooks → Transaction history for delivery to ChatHub.

  4. 4

    In ChatHub, confirm that the workflow continues, the customer's wallet increases by the correct amount and balance history identifies the payment gateway.

This step moves real money. Use a small amount under your internal procedure and retain the transaction reference for reconciliation.

8. Troubleshoot common failures#

  1. 1

    Pay2S does not see the transfer: confirm the bank connection is active, its session/OTP remains valid and the transfer appears under Bank transactions.

  2. 2

    Webhook does not run: confirm it is enabled, uses Incoming, selects the intended account and calls a public HTTPS URL. Inspect its response under Webhook transaction history.

  3. 3

    ChatHub returns 401: the stored secret does not match the webhook token. Recreate or copy the Pay2S token and store the new value in ChatHub.

  4. 4

    Webhook arrives but the wallet is unchanged: check for a positive amount, the complete NAP code for a pending top-up and whether that code was already used.

  5. 5

    Customer instructions are wrong: update Bank, Account number or Account holder in ChatHub and save. The secret does not need changing if the webhook is unchanged.

  6. 6

    Pay2S retries delivery when the endpoint does not return HTTP 200. Do not create duplicate webhooks as a routine fix because they complicate reconciliation.

9. Keep the integration secure#

  1. 1

    Limit access to payment settings and the Pay2S account.

  2. 2

    Never share the secret through email, group chat or public documents. If exposure is suspected, replace the webhook token and update ChatHub immediately.

  3. 3

    Monitor webhook transaction history for failures or timeouts and reconcile bank transfers with wallet movements before making manual adjustments.

  4. 4

    When changing recipient accounts, update the Pay2S connection, webhook selection and all three bank fields in ChatHub before re-enabling the workflow.

Configure bank payments with Pay2SBack to top
© 2026 ChatHub DocsPowered by CMSNT LTDA guide to using ChatHub.