@@ -26,7 +26,7 @@ The following gateways are provided by this package:
26
26
* AuthorizeNet_SIM
27
27
* AuthorizeNet_DPM
28
28
29
- In addition, ` Accept.JS ` is supported by the AIM driver. More details are provided below.
29
+ In addition, ` Accept.JS ` is supported by the AIM driver and CIM (create card) . More details are provided below.
30
30
31
31
For general usage instructions, please see the main [ Omnipay] ( https://github.com/thephpleague/omnipay )
32
32
repository.
@@ -45,15 +45,15 @@ The card is tokenized into two values returned in `opaqueData` object from Accep
45
45
46
46
These two values must be POSTed back to the merchant application, usually as a part of the payment form.
47
47
Make sure the raw credit card details are NOT posted back to your site.
48
- How this is handled is beyond this short note, but examples are always welcome in the documentation.
48
+ How this is handled is beyond this short note, but examples are always welcomed in the documentation.
49
49
50
- On the server, the tokenized detailt are passed into the ` payment ` or ` authorize ` request object.
50
+ On the server, the tokenized details are passed into the ` payment ` or ` authorize ` request object.
51
51
You will still need to pass in the ` CreditCard ` object, as that contains details of the payee and
52
52
recipient, but just leave the credit card details of that object blank. For example:
53
53
54
54
``` php
55
55
// $gateway is an instantiation of the AIM driver.
56
- // $dataDescriptor and $dataValue come from the paymentr form at the front end.
56
+ // $dataDescriptor and $dataValue come from the payment form at the front end.
57
57
58
58
$request = $gateway->purchase(
59
59
[
@@ -66,6 +66,56 @@ $request = $gateway->purchase(
66
66
);
67
67
```
68
68
69
+ CIM Create Card feature usage:
70
+ Accept.js must be implemented on your frontend payment form, once Accept.js 'tokenizes' the customer's
71
+ card, just send the two opaque fields and remove the Card's (Number, Expiration and CVV) from your post request.
72
+
73
+ Accept.js goal is to remove the need of Card information from ever going into your server so be sure to remove that data
74
+ before posting to your server.
75
+
76
+ The create card feature on CIM will automatically create a Customer Profile and a Payment Profile with the
77
+ 'tokenized' card for each customer you request it for on your authorize.net account, you can use these Payment Profiles
78
+ later to request payments from your customers.
79
+
80
+ In order to create a Customer & Payment Profile pass the opaque fields and the card array with the billing information
81
+ to the createCard method on the CIM driver:
82
+
83
+ ``` php
84
+ // $gateway is an instantiation of the CIM driver. //Omnipay::create( 'AuthorizeNet_CIM' )
85
+ // $dataDescriptor and $dataValue come from the payment form at the front end.
86
+
87
+ $request = $gateway->createCard(
88
+ [
89
+ 'opaqueDataDescriptor' => $dataDescriptor,
90
+ 'opaqueDataValue' => $dataValue,
91
+ 'name' => $name,
92
+ 'email' => $email, //Authorize.net will use the email to identify the CustomerProfile
93
+ 'customerType' => 'individual',
94
+ 'customerId' => $user_customer_id,//a customer ID generated by your system or send null
95
+ 'description' => 'MEMBER',//whichever description you wish to send
96
+ 'forceCardUpdate' => true
97
+ 'card' => [
98
+ 'billingFirstName' => $name,
99
+ 'billingLastName' => $last_name,
100
+ 'billingAddress1' => $address,
101
+ 'billingCity' => $city,
102
+ 'billingState' => $state,
103
+ 'billingPostcode' => $zipcode,
104
+ 'billingPhone' => '',
105
+ //... may include shipping info but do not include card (number, cvv or expiration)
106
+ ],
107
+ ]
108
+ );
109
+ $response = $request->send();
110
+ $data = $response->getData();
111
+
112
+ $data['paymentProfile']['customerProfileId'];
113
+ $data['paymentProfile']['customerPaymentProfileId'];
114
+ //Now you can use these 2 fields to reference this customer and this payment profile for later use with
115
+ //the rest of the CIM driver features as usual.
116
+ ```
117
+
118
+
69
119
## Support
70
120
71
121
If you are having general issues with Omnipay, we suggest posting on
0 commit comments