Difference between revisions of "Online payment system"
(Add Chinese) Tag: 2017 source edit |
m Tag: 2017 source edit |
||
(5 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
Dolibarr provide native modules to make online payments of your invoices, orders, membership, registration to events... | Dolibarr provide native modules to make online payments of your invoices, orders, membership, registration to events... | ||
− | The native payment modules are Paypal and Stripe | + | The native payment modules are Paypal and Stripe. |
− | For this, you must create a module ([[Module_development]]) that implement the following hooks for the context "newpayment" : | + | From v20+, you can develop your own modules to support other payment services. |
+ | |||
+ | |||
+ | = Main process = | ||
+ | For this, you must create a module ([[Module_development]]) that implement the following hooks for the context "newpayment" that will manage the following hook methods: | ||
*doValidatePayment | *doValidatePayment | ||
Line 15: | Line 19: | ||
*doPayment | *doPayment | ||
*isPaymentOK | *isPaymentOK | ||
− | |||
== Hook doValidatePayment == | == Hook doValidatePayment == |
Latest revision as of 15:47, 11 November 2024
Dolibarr provide native modules to make online payments of your invoices, orders, membership, registration to events...
The native payment modules are Paypal and Stripe.
From v20+, you can develop your own modules to support other payment services.
Main process
For this, you must create a module (Module_development) that implement the following hooks for the context "newpayment" that will manage the following hook methods:
- 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.