Line 11:
Line 11:
This page describe how the modules for online payments works.
This page describe how the modules for online payments works.
−
This is how the [[Module Stripe]], the [[Module PayPal]] but also external modules like the [[Module HelloAsso]] are working.
+
This is how the [[Module Stripe]], the [[Module PayPal]] but also external modules like the [[Module HelloAsso]] are working. For core module, the code is hard coded, for external modules code is executed at the same place than core modules, but it is triggered by hooks instead of being hard coded.
= Step 1 - The choice of the payment mode =
= Step 1 - The choice of the payment mode =
Line 23:
Line 23:
* URL to offer an online payment page of any amount with no existing object:
* URL to offer an online payment page of any amount with no existing object:
−
http://mydolibarrdomain/public/payment/newpayment.php?amount=9.99&tag=your_tag
+
https://demo.dolibarr.org/public/payment/newpayment.php?amount=9.99&tag=your_tag
* URL to offer an online payment page for a sales order:
* URL to offer an online payment page for a sales order:
−
http://mydolibarrdomain/public/payment/newpayment.php?source=order&ref=order_ref
+
https://demo.dolibarr.org/public/payment/newpayment.php?source=order&ref=order_ref
* URL to offer an online payment page for a customer invoice:
* URL to offer an online payment page for a customer invoice:
−
http://mydolibarrdomain/public/payment/newpayment.php?source=invoice&ref=invoice_ref
+
https://demo.dolibarr.org/public/payment/newpayment.php?source=invoice&ref=invoice_ref
* URL to offer a Stripe online payment page for a contract line:
* URL to offer a Stripe online payment page for a contract line:
−
http://mydolibarrdomain/public/payment/newpayment.php?source=contractline&ref=contractline_ref
+
https://demo.dolibarr.org/public/payment/newpayment.php?source=contractline&ref=contractline_ref
* URL to offer a Stripe online payment page for a member subscription:
* URL to offer a Stripe online payment page for a member subscription:
−
http://mydolibarrdomain/public/payment/newpayment.php?source=membersubscription&ref=member_ref
+
https://demo.dolibarr.org/public/payment/newpayment.php?source=membersubscription&ref=member_ref
* URL to offer a Stripe online payment page for payment of a donation:
* URL to offer a Stripe online payment page for payment of a donation:
−
http://mydolibarrdomain/public/payment/newpayment.php?source=donation&ref=donation_ref
+
https://demo.dolibarr.org/public/payment/newpayment.php?source=donation&ref=donation_ref
Line 104:
Line 104:
= Step 4 - Fallback on result page =
= Step 4 - Fallback on result page =
−
When calling the page when payment is OK, the following parameters must also be provided:
+
When payment is complete, the use finally reach the page paymentok.php or paymentko.php.
−
* FULLTAG (this parameter was defined into the public/payment/newpayment.php page). With this parameter, the page paymentok.php will be able to make all complementary action like closing invoice or order or recording a subscription for a membership subscription, and more...
+
The page paymentko will just return a message to explain the payment has failed. The page paymentok, will use the parameter fulltag and variables saved into session to make complementary actions like (registering the payment in the application, closing the invoice, sending an email...). The paymentok/ko page can retrieve information from:
+
* Parameter "fulltag" AG (this parameter was defined into the public/payment/newpayment.php page). With this parameter, the page paymentok.php will be able to make all complementary action like closing invoice or order or recording a subscription for a membership subscription, and more...
* Some payment mode include also more parameters like PAYERID for Paypal. Only FULLTAG should be mandatory.
* Some payment mode include also more parameters like PAYERID for Paypal. Only FULLTAG should be mandatory.
−
Some other parameters may be retreived in the session like:
+
Some other parameters may be retrieved in the session like:
* $_SESSION['ipaddress']
* $_SESSION['ipaddress']
* $_SESSION['errormessage'] An error message to show
* $_SESSION['errormessage'] An error message to show
+
+
+
= Other features =
+
To complete...