Skip to content

Dujiaoka Integration

Dujiaoka is supported through the Epusdt payment plugin. This page covers the actual fields used by the plugin and the current Epusdt endpoint.

Prerequisites

RequirementDetails
Dujiaoka versionThe official plugin folder in the Epusdt repo is explicitly for Dujiaoka below 2.0.4. For 2.0.4+ the plugin may already be built in.
Plugin files for old versionsIf you use an older Dujiaoka release, copy the plugin's app and routes directories into the Dujiaoka site root as described in plugins/dujiaoka/README.md.
EpusdtPublicly reachable from the Dujiaoka server, or reachable by LAN/local address if both run on the same host/network.
API tokenapi_auth_token from Epusdt .env.
Callback reachabilityEpusdt must be able to POST back to the Dujiaoka notify URL generated by the plugin.

What the Dujiaoka plugin actually sends

The official plugin sends these fields to Epusdt when an order is created:

  • amount
  • order_id
  • notify_url
  • redirect_url
  • signature

You do not manually configure notify_url or redirect_url inside Epusdt. Dujiaoka generates them for each order.

Dujiaoka configuration

In Dujiaoka, add or edit the Epusdt payment method. The official plugin README uses these admin field labels, and the plugin code shows how they are consumed:

Dujiaoka fieldValueUsed by plugin code as
Payment optionEpusdtPayment handler name
Merchant IDYour Epusdt api_auth_tokenSigning key (merchant_id)
Merchant KeyLeave emptyNot used by this plugin
Merchant SecretFull Epusdt create-order URL. For current Epusdt source, use https://your-epusdt-domain/payments/epusdt/v1/order/create-transactionRequest target URL (merchant_pem)

Notes:

  • Use the full request URL, not only the domain.
  • If Dujiaoka and Epusdt are on the same server, a local address such as http://127.0.0.1:8000/payments/epusdt/v1/order/create-transaction can avoid proxy issues.
  • The plugin README inside the Epusdt repo still shows the older /api/v1/order/create-transaction example. That example is stale relative to the current Epusdt source. Use /payments/epusdt/v1/order/create-transaction instead.
  • Source confirms the plugin signs requests with merchant_id and sends the HTTP POST to merchant_pem, so the admin labels above are not just guesswork.

Callback / return behavior

The route file shipped in plugins/dujiaoka/routes/common/pay.php registers these Dujiaoka-side endpoints:

  • Notify URL: POST /pay/epusdt/notify_url
  • Return URL: GET /pay/epusdt/return_url
  • Payment entry: GET /pay/epusdt/{payway}/{orderSN}

The plugin controller generates the Epusdt request with:

  • redirect_url = route('epusdt-return', ['order_id' => $order_sn])
  • notify_url = url($this->payGateway->pay_handleroute . '/notify_url')

So a real integration normally looks like:

text
redirect_url = https://your-dujiaoka-domain/pay/epusdt/return_url?order_id=DJK20260001
notify_url   = https://your-dujiaoka-domain/pay/epusdt/notify_url

After payment, Epusdt POSTs callback data back to Dujiaoka. The plugin verify handler expects the signature to match merchant_id and processes at least these fields:

  • trade_id
  • order_id
  • amount
  • signature

Dujiaoka must return plain text ok after successful processing; otherwise Epusdt will treat the callback as failed.

Test checklist

Place a small test order and confirm:

  • Dujiaoka can open the Epusdt payment_url
  • Payment status updates after the on-chain transfer is confirmed
  • Dujiaoka receives the notify callback and marks the order paid
  • The buyer is redirected back to the Dujiaoka order page

Troubleshooting

Signature verification failed

Use the exact Epusdt api_auth_token as Dujiaoka's Merchant ID. Extra spaces or the wrong token will break signing.

Callback not delivered

Check that your Dujiaoka notify route is publicly reachable by the Epusdt server and not blocked by firewall or reverse proxy rules.

Wrong endpoint

If the plugin is still configured with /api/v1/order/create-transaction, update it to:

text
/payments/epusdt/v1/order/create-transaction

Order expires too quickly

Adjust order_expiration_time in Epusdt if your customers need more time to complete the transfer.

最近更新