31,034
edits
Tag: 2017 source edit |
Tag: 2017 source edit |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 128: | Line 128: | ||
For all of this, you must implement the hook '''doPayment''' in the context 'newpayment'. | For all of this, you must implement the hook '''doPayment''' in the context 'newpayment'. | ||
If you need to embed you own form, the content must returned by the hook, for example: | If you need to embed you own HTML form, the content must be returned by the hook into ->resPrint, for example: | ||
<syntaxhighlight lang="PHP"> | <syntaxhighlight lang="PHP"> | ||
this->resPrint = '<script>my javascript</script><form><input type="text" name="credit card num"></form>'; | this->resPrint = '<script>my javascript</script><form><input type="text" name="credit card num"></form>'; | ||
| Line 152: | Line 152: | ||
=Step 4 - Fallback on result page= | =Step 4 - Fallback on result page= | ||
When payment is complete, the | When payment is complete, the user finally reach the page '''/public/payment/paymentok.php''' or '''/public/payment/paymentko.php'''. | ||
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 | The page paymentko.php will just return a message to explain the payment has failed. The page paymentok.php, will use the parameter '''fulltag''' and variables saved into session to make complementary actions (like validating remotely the payment, registering the payment in the Dolibarr application, closing the invoice, sending emails...). 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... | *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... | ||
| Line 162: | Line 162: | ||
*$_SESSION['ipaddress'] | *$_SESSION['ipaddress'] | ||
*$_SESSION['errormessage'] An error message to show | *$_SESSION['errormessage'] An error message to show | ||
=Other features= | =Other features= | ||
To complete... | To complete... | ||