@@ -36,9 +36,46 @@ The following gateways are provided by this package:
36
36
* AuthorizeNet_SIM
37
37
* AuthorizeNet_DPM
38
38
39
+ In addition, ` Accept.JS ` is supported by the AIM driver. More details are provided below.
40
+
39
41
For general usage instructions, please see the main [ Omnipay] ( https://github.com/thephpleague/omnipay )
40
42
repository.
41
43
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
+
42
79
## Support
43
80
44
81
If you are having general issues with Omnipay, we suggest posting on
0 commit comments