Changes

m
Line 57: Line 57:  
= Step 2 - User choose the payment mode  =
 
= Step 2 - User choose the payment mode  =
   −
When the user choose a payment mode, the same page is called but with a parameter '''action=dopayment'''.  
+
When the user has clicked on a payment mode, the same page is called but with a parameter '''action=dopayment'''.  
    
If the payment mode needs to, some information about the payment are stored into session so it will be possible to retrieve them later when falling back on the result of payment page. Among information, the variable FULLTAG contains information on the source of payment (the mode but also the object of Dolibarr the payment may be related to). It must provided to the payment system because it is required to have it in the fallback URL used once a payment has been done (see STEP 4)
 
If the payment mode needs to, some information about the payment are stored into session so it will be possible to retrieve them later when falling back on the result of payment page. Among information, the variable FULLTAG contains information on the source of payment (the mode but also the object of Dolibarr the payment may be related to). It must provided to the payment system because it is required to have it in the fallback URL used once a payment has been done (see STEP 4)
Line 66: Line 66:     
To save data of your choice in session and/or to make a redirect to the remote payment page, you must implement the hook '''doPayment''' in the context 'newpayment'.
 
To save data of your choice in session and/or to make a redirect to the remote payment page, you must implement the hook '''doPayment''' in the context 'newpayment'.
If you
     −
=>
+
If you need to make a redirect to an external page, do it into this hook with
 +
<syntaxhighligh lang="php">
 +
header("Location: myexternalpaymenturl?myparameters");
 +
exit;
 +
</syntaxhighlight>
 +
Do not return value, just do an exit after the redirect.
 +
 
 +
=> You can now test that after the click on your payment mode, the redirect to you home page is ok.
    
= Step 3 - Entering payment information =
 
= Step 3 - Entering payment information =