Difference between revisions of "在线支付系统"
(initialization) Tag: 2017 source edit |
PolyglotBot (talk | contribs) m (Adding interlang links (links to translated versions of this page in other languages) triggered by origin English page "Online_payment_system" update.) |
||
Line 1: | Line 1: | ||
+ | <!-- BEGIN interlang links --> | ||
+ | <!-- Do NOT edit this section | ||
+ | Links below are automatically managed by PolyglotBot | ||
+ | You can edit links on the English source page : Online_payment_system --> | ||
+ | [[en:Online_payment_system]] | ||
+ | <!-- END interlang links --> | ||
+ | |||
{{Template开发文档}} | {{Template开发文档}} | ||
Revision as of 08:04, 12 October 2023
Dolibarr provide native modules to make online payments of your invoices, orders, membership, registration to events... The native payment modules are Paypal and Stripe. But you can add you own modules to support other payment services.
For this, you must create a module (Module_development) that implement the following hooks for the context "newpayment" :
- doValidatePayment
- doCheckStatus
- doAddButton
- doPayment
- isPaymentOK
Hook doValidatePayment
To return a code for your payment mode (used at different place of Application)
Hook doCheckStatus
Not usefull
Hook doAddButton
To define the button to add on the payment page /public/payments/newpayment.php
Hook doPayment
To show a form to show to make the payment. The form will be show after selecting your payment service on the page /public/payments/newpayment.php. This page must set the session variable $_SESSION['TRANSACTIONID'] (For example "YYYYMMDDHHMMSS-abc") and $_SESSION["FinalPaymentAmt"] (For example "123") and $_SESSION['currencyCodeType'] (for example "USD"). They will be used by the page called after payment /public/payment/paymentok.php
Hook isPaymentOK
to say if a payment is ok or not when entering the fallbackpage /public/payment/paymentok.php. If ok, the rest of common actions are done (payment registered, status of object modified), if not nothing is done except showing an error message.