@@ -36,9 +36,46 @@ The following gateways are provided by this package:
3636* AuthorizeNet_SIM
3737* AuthorizeNet_DPM
3838
39+ In addition, ` Accept.JS ` is supported by the AIM driver. More details are provided below.
40+
3941For general usage instructions, please see the main [ Omnipay] ( https://github.com/thephpleague/omnipay )
4042repository.
4143
44+ ## Accept.JS
45+
46+ This gateway uses a JacaScript script to tokenize credit card details at the front end,
47+ i.e. in the payment form.
48+ Just the tokenized version of the credit card is then sent back to the merchant site,
49+ where it is used as a proxy for the credit card.
50+
51+ The card is tokenized into two values returned in ` opaqueData ` object from Accept.JS:
52+
53+ * dataDescriptor - the type of opaque data, e.g. "COMMON.ACCEPT.INAPP.PAYMENT"
54+ * dataValue - the value for the opaque data, e.g. "eyJjb2RlIjoiNT... {256 characters} ...idiI6IjEuMSJ9"
55+
56+ These two values must be POSTed back to the merchant application, usually as a part of the payment form.
57+ Make sure the raw credit card details are NOT posted back to your site.
58+ How this is handled is beyond this short note, but examples are always welcome in the documentation.
59+
60+ On the server, the tokenized detailt are passed into the ` payment ` or ` authorize ` request object.
61+ You will still need to pass in the ` CreditCard ` object, as that contains details of the payee and
62+ recipient, but just leave the credit card details of that object blank. For example:
63+
64+ ``` php
65+ // $gateway is an instantiation of the AIM driver.
66+ // $dataDescriptor and $dataValue come from the paymentr form at the front end.
67+
68+ $request = $gateway->purchase(
69+ [
70+ 'notifyUrl' => '...',
71+ 'amount' => $amount,
72+ 'opaqueDataDescriptor' => $dataDescriptor,
73+ 'opaqueDataValue' => $dataValue,
74+ ...
75+ ]
76+ );
77+ ```
78+
4279## Support
4380
4481If you are having general issues with Omnipay, we suggest posting on
0 commit comments