3D Secure Process Gateway
If the merchant gateway supports 3D Secure (also known as Verified by Visa or MasterCard Secure Code), then it can be utilized within WHASOLS.
- Add a function to the module named yourgatewayname_3dsecure
- Return the HTML for the
- post method to take the user to the 3D Secure process. An example of this is below:
- The
_3dsecure
function is passed all the same variables as_capture and _link
functions. The return url should be acallback function
to handle the response.
Implementation Guide
- Delete the
yourmodulename_capture
function from the module template since this is only required forMerchant Gateway modules
. - Delete the
yourmodulename_link
function from the module template since this is only required forThird Party Gateway modules
. - Define and return the HTML code that will forward the user to the payment gateway to complete the payment process inside the
yourmodulename_3dsecure
function. This is typically done by way of an HTML form utilizing the POST method. - Optionally, if your payment gateway supports sending notifications upon successful receipt of payments, create a
yourmodule_callback
function to receive and handle those. - If your payment gateway supports refunds, implement support for Refunds.
Variables
The following parameters are passed to the
yourmodule_3dsecure
function along with all defined configuration parameters and their values.Response Format
The _3dsecure
function should return an HTML code block that can be rendered to the user. This should typically take the format of an HTML form.
Simple Example
Below is a very simple demonstration of a 3dsecure function that forwards the end user to https://gateway_domain.com/3dsecure
using a form post containing the invoice data.
function yourmodule_3dsecure($arg=[])
{
$form = '<form method="post" action="https://www.gateway-domain-name.com/3dsecure/">
<input type="hidden" name="gwlogin" value="'.$arg['gateway']["loginid"].'" />
<input type="hidden" name="invoiceid" value="'.$arg['invoice']["invoiceid"].'" />
<input type="hidden" name="amount" value="'.$arg['invoice']["amount"].'" />
<input type="hidden" name="firstname" value="'.$arg["client"]["firstname"].'" />
<input type="hidden" name="lastname" value="'.$arg["client"]["lastname"].'" />
<input type="hidden" name="address" value="'.$arg["client"]["address1"].'" />
<input type="hidden" name="city" value="'.$arg["client"]["city"].'" />
<input type="hidden" name="state" value="'.$arg["client"]["state"].'" />
<input type="hidden" name="postcode" value="'.$arg["client"]["postcode"].'" />
<input type="hidden" name="country" value="'.$arg["client"]["country"].'" />
<input type="hidden" name="phonenumber" value="'.$arg["client"]["phonenumber"].'" />
<input type="hidden" name="email" value="'.$arg["client"]["email"].'" />
<input type="hidden" name="ccnumber" value="'.$arg['card']["cardnum"].'" />
<input type="hidden" name="expirymonth" value="'.substr($arg['card']['cardexp'], 0, 2).'" />
<input type="hidden" name="expiryyear" value="'.substr($arg['card']['cardexp'], 2, 2).'" />
<input type="hidden" name="cvv2" value="'.$arg['card']["cccvv"].'" />
<input type="hidden" name="return_url" value="'.$arg['system']['returnurl'].'" />
<noscript>
<div class="alert alert-danger"><b>JavaScript is currently disabled or is not supported by your
browser.</b><br />Please click the continue button to proceed with the processing of your
transaction.</div>
<div align="center">
<input type="submit" value="Continue" />
</div>
</noscript>
</form>';
return $form;
}