2.3 KiB
Paytaro payment integration
Paytaro is disabled by default and starts in test mode. The user-facing entry is labelled only as Alipay. Test mode exposes it only to administrators; when test mode is disabled, the enabled switch controls whether users can see it.
Database
Existing installations with these tables use the payment currency migration. The original migration for the channel is:
mysql -u USER -p DATABASE < sql/paytaro_payment.sql
The same tables are included in sql/ss.sql for fresh installations and in
the scheduled full-data backup list.
Credential encryption
Generate a dedicated 32-byte key:
openssl rand -base64 32
Expose it to PHP-FPM in the pool configuration:
env[PAYTARO_CREDENTIAL_KEY] = "generated-base64-value"
Restart PHP-FPM after changing the environment. Keep this value unchanged while the encrypted Paytaro merchant key remains stored in the database.
Enable
The integration uses Paytaro's documented EPay MAPI endpoint at
https://v3.paytaro.com/mapi.php. The endpoint is pinned in server
code and is not editable from the browser.
Open /admin/paytaro and configure a public HTTPS callback base URL, the App
ID, merchant key, and the UUID of the Alipay payment method enabled for the
Paytaro application. The UUID is copied from the application's payment-method
list; the literal value alipay is not valid for MAPI. Save the settings and
test connectivity before enabling the payment method.
MAPI requests use the EPay MD5 signing rules and send the frozen CNY quote. After verification, the panel applies the USD credit. Desktop browsers show the Alipay QR code. Mobile browsers show the quote and an Alipay app link.
Paytaro must be able to reach these public callback routes:
- Balance recharge:
/paytaro/callback
These routes must bypass authentication and CDN caching. Browser return routes only bring the user back to the current panel page. They never credit a balance or activate an account. Only a correctly signed EPay callback matching the PID, local order, platform trade number, and amount can complete payment. Duplicate callbacks are idempotent. Signed legacy MGate callbacks are retained for reconciliation. Late receipts without a trusted payment timestamp also go to reconciliation.