PluginProbe ʕ •ᴥ•ʔ
FraudLabs Pro for WooCommerce / 2.24.2
FraudLabs Pro for WooCommerce v2.24.2
2.24.2 2.24.1 2.24.0 trunk 2.10.0 2.10.1 2.10.10 2.10.11 2.10.12 2.10.13 2.10.14 2.10.2 2.10.3 2.10.4 2.10.5 2.10.6 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.10 2.11.11 2.11.2 2.11.3 2.11.4 2.11.5 2.11.6 2.11.7 2.11.8 2.11.9 2.12.0 2.12.1 2.12.2 2.12.3 2.12.4 2.12.5 2.12.6 2.13.0 2.13.1 2.13.10 2.13.2 2.13.3 2.13.4 2.13.5 2.13.6 2.13.7 2.13.8 2.13.9 2.14.0 2.14.1 2.14.10 2.14.11 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 2.14.7 2.14.8 2.14.9 2.15.0 2.16.0 2.16.1 2.16.10 2.16.11 2.16.12 2.16.13 2.16.14 2.16.15 2.16.16 2.16.17 2.16.18 2.16.19 2.16.2 2.16.3 2.16.4 2.16.5 2.16.6 2.16.7 2.16.8 2.16.9 2.17.0 2.17.1 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.7 2.17.8 2.18.0 2.18.1 2.18.2 2.18.3 2.18.4 2.18.5 2.19.0 2.19.1 2.19.2 2.19.3 2.20.0 2.20.1 2.20.2 2.20.3 2.21.0 2.21.1 2.22.0 2.22.1 2.22.10 2.22.11 2.22.12 2.22.13 2.22.14 2.22.15 2.22.2 2.22.3 2.22.4 2.22.5 2.22.6 2.22.7 2.22.8 2.22.9 2.23.0 2.23.1 2.23.2 2.23.3 2.23.4 2.23.5 2.23.6 2.23.7 2.8.17 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5
fraudlabs-pro-for-woocommerce / vendor / fraudlabspro / fraudlabspro-php / README.md
fraudlabs-pro-for-woocommerce / vendor / fraudlabspro / fraudlabspro-php Last commit date
src 5 years ago tests 5 years ago LICENSE 5 years ago README.md 5 years ago composer.json 5 years ago example.php 5 years ago phpunit.xml 5 years ago
README.md
257 lines
1 FraudLabs Pro PHP SDK
2 ========================
3 This PHP module enables user to easily implement fraud detection feature into their solution using the API from https://www.fraudlabspro.com.
4
5 Below are the features of this PHP module:
6 - Fraud analysis and scoring
7 - IP address geolocation & proxy validation
8 - Email address validation
9 - Credit card issuing bank validation
10 - Transaction velocity validation
11 - Device transaction validation
12 - Blacklist validation
13 - Custom rules trigger
14 - Email notification of fraud orders
15 - Mobile app notification of fraud orders
16
17 This module requires API key to function. You may subscribe a free API key at https://www.fraudlabspro.com
18
19
20
21
22 Usage Example
23 ============
24 ### Validate Order
25
26 #### Object Properties
27
28 | Property Name | Property Type | Description |
29 | --------------------------------- | ------------- | ------------------------------------------------------------ |
30 | ip | string | IP address of online transaction. It supports both IPv4 and IPv6 address format. |
31 | billing->firstName | string | User's first name. |
32 | billing->lastName | string | User's last name. |
33 | billing->username | string | User's username. |
34 | billing->password | string | User's password. |
35 | billing->email | string | User's email address. |
36 | billing->phone | string | User's phone number. |
37 | billing->address | string | Street address of billing address. |
38 | billing->city | string | City of billing address. |
39 | billing->state | string | State of billing address. It supports state codes, e.g. NY (New York), for state or province of United States or Canada. Please refer to [](https://www.fraudlabspro.com/developer/reference/state-and-province-codesState & Province Codes](https://www.fraudlabspro.com/developer/reference/state-and-province-codes](https://www.fraudlabspro.com/developer/reference/state-and-province-codes) for complete list. |
40 | billing->postcode | string | Postal or ZIP code of billing address. |
41 | billing->country | string | Country of billing address. It requires the input of ISO-3166 alpha-2 country code, e.g. US for United States. Please refer to [](https://www.fraudlabspro.com/developer/reference/country-codesCountry Codes](https://www.fraudlabspro.com/developer/reference/country-codes](https://www.fraudlabspro.com/developer/reference/country-codes) for complete list. |
42 | order->orderId | string | Merchant identifier to uniquely identify a transaction. It supports maximum of 15 characters user order id input. |
43 | order->note | string | Merchant description of an order transaction. It supports maximum of 200 characters. |
44 | order->amount | float | Amount of the transaction. |
45 | order->quantity | integer | Total quantity of the transaction. |
46 | order->currency | string | Currency code used in the transaction. It requires the input of ISO-4217 (3 characters) currency code, e.g. USD for US Dollar. Please refer to [](https://www.fraudlabspro.com/developer/reference/currency-codesCurrency Codes](https://www.fraudlabspro.com/developer/reference/currency-codes](https://www.fraudlabspro.com/developer/reference/currency-codes) for complete list. |
47 | order->department | string | Merchant identifier to uniquely identify a product or service department. |
48 | order->paymentMethod | string | Payment mode of transaction. Please see references section. |
49 | card->number | string | Billing credit card number or BIN number. |
50 | card->avs | string | The single character AVS result returned by the credit card processor. Please refer to [](https://www.fraudlabspro.com/developer/reference/avs-and-cvv2-response-codesAVS & CVV2 Response Codes](https://www.fraudlabspro.com/developer/reference/avs-and-cvv2-response-codes](https://www.fraudlabspro.com/developer/reference/avs-and-cvv2-response-codes) for details. |
51 | card->cvv | string | The single character CVV2 result returned by the credit card processor. Please refer to [](https://www.fraudlabspro.com/developer/reference/avs-and-cvv2-response-codesAVS & CVV2 Response Codes](https://www.fraudlabspro.com/developer/reference/avs-and-cvv2-response-codes](https://www.fraudlabspro.com/developer/reference/avs-and-cvv2-response-codes) for details. |
52 | shipping->address | string | Street address of shipping address. |
53 | shipping->city | string | City of shipping address. |
54 | shipping->state | string | State of shipping address. It supports state codes, e.g. NY - New York, for state or province of United States or Canada. Please refer to [](https://www.fraudlabspro.com/developer/reference/state-and-province-codesState & Province Codes](https://www.fraudlabspro.com/developer/reference/state-and-province-codes](https://www.fraudlabspro.com/developer/reference/state-and-province-codes) for complete list. |
55 | shipping->postcode | string | Postal or ZIP code of shipping address. |
56 | shipping->country | string | Country of shipping address. It requires the input of ISO-3166 alpha-2 country code, e.g. US for United States. Please refer to [](https://www.fraudlabspro.com/developer/reference/country-codesCountry Codes](https://www.fraudlabspro.com/developer/reference/country-codes](https://www.fraudlabspro.com/developer/reference/country-codes) for complete list. |
57
58
59 ```
60 <?php
61 require_once __DIR__.'/vendor/autoload.php';
62
63 // Configures FraudLabs Pro API key
64 $config = new FraudLabsPro\Configuration('YOUR_API_KEY');
65 $fraudlabspro = new FraudLabsPro\FraudValidation($config);
66
67 // Order details
68 $orderDetails = [
69 // IP parameter is optional, this library can detects IP address automatically
70 'ip' => '146.112.62.105',
71
72 'order' => [
73 'orderId' => '67398',
74 'note' => 'Online shop',
75 'currency' => 'USD',
76 'amount' => '79.89',
77 'quantity' => 1,
78
79 // Please refer reference section for full list of payment methods
80 'paymentMethod' => FraudLabsPro\FraudValidation::CREDIT_CARD,
81 ],
82
83 'card' => [
84 'number' => '4556553172971283',
85 ],
86
87 'billing' => [
88 'firstName' => 'Hector',
89 'lastName' => 'Henderson',
90 'email' => 'hh5566@gmail.com',
91 'phone' => '561-628-8674',
92
93 'address' => '1766 Powder House Road',
94 'city' => 'West Palm Beach',
95 'state' => 'FL',
96 'postcode' => '33401',
97 'country' => 'US',
98 ],
99
100 'shipping' => [
101 'address' => '4469 Chestnut Street',
102 'city' => 'Tampa',
103 'state' => 'FL',
104 'postcode' => '33602',
105 'country' => 'US',
106 ],
107 ];
108
109 // Sends the order details to FraudLabs Pro
110 $result = $fraudlabspro->validate($orderDetails);
111 ```
112
113
114
115 ### Get Transaction
116
117 #### Parameter Properties
118
119 | Parameter Name | Parameter Type | Description |
120 | -------------- | -------------- | ------------------------------------------------------------ |
121 | $id | string | FraudLabs Pro transaction ID or Order ID. |
122 | $type | string | ID type. Either: **FraudLabsPro\FraudValidation::FLP_ID** or **FraudLabsPro\FraudValidation::ORDER_ID** |
123
124 ```
125 <?php
126 require_once __DIR__.'/vendor/autoload.php';
127
128 // Configures FraudLabs Pro API key
129 $config = new FraudLabsPro\Configuration('YOUR_API_KEY');
130 $fraudlabspro = new FraudLabsPro\FraudValidation($config);
131
132 $result = $fraudlabspro->getTransaction('20170906MXFHSTRF', FraudLabsPro\FraudValidation::FLP_ID);
133 ```
134
135
136
137 ### Feedback
138
139 #### Object Properties
140
141 | Property Name | Property Type | Description |
142 | ------------- | ------------- | ------------------------------------------------------------ |
143 | id | string | Unique transaction ID generated from **Validate** function. |
144 | status | string | Perform APPROVE, REJECT, or REJECT_BLACKLIST action to transaction. Refer to [](#feedback-statusreference section](#feedback-status](#feedback-status) for status code. |
145 | note | string | Notes for the feedback request. |
146
147 ```
148 <?php
149 require_once __DIR__.'/vendor/autoload.php';
150
151 // Configures FraudLabs Pro API key
152 $config = new FraudLabsPro\Configuration('YOUR_API_KEY');
153 $fraudlabspro = new FraudLabsPro\FraudValidation($config);
154
155 $fraudlabspro->feedback([
156 'id' => '20170906MXFHSTRF',
157 // Please refer to reference section for full list of feedback statuses
158 'status' => FraudLabsPro\FraudValidation::APPROVE,
159 'note' => 'This customer made a valid purchase before.',
160 ]);
161
162 ```
163
164
165
166
167 ## SMS Verification
168
169 ### Send SMS Verification
170
171 #### Object Properties
172
173 | Property Name | Property Type | Description |
174 | ------------- | :-----------: | ------------------------------------------------------------ |
175 | tel | string | The recipient mobile phone number in E164 format which is a plus followed by just numbers with no spaces or parentheses. |
176 | mesg | string | The message template for the SMS. Add <otp> as placeholder for the actual OTP to be generated. Max length is 140 characters. |
177 | otp_timeout | integer | Timeout feature for OTP value in seconds. Default is 3600 seconds(1 hour). Max timeout is 86400 seconds(24 hours). |
178 | country_code | string | ISO 3166 country code for the recipient mobile phone number. If parameter is supplied, then some basic telephone number validation is done. |
179
180 ```
181 <?php
182 require_once __DIR__.'/vendor/autoload.php';
183
184 // Configures FraudLabs Pro API key
185 $config = new FraudLabsPro\Configuration('YOUR_API_KEY');
186 $fraudlabsproSms = new \FraudLabsPro\SmsVerification($config);
187
188 // Send SMS Verification
189 $fraudlabsproSms->sendSms([
190 'tel' => '+123456789',
191 'mesg' => 'Hi, your OTP is <otp>.',
192 'otp_timeout' => 3600,
193 'country_code' => 'US',
194 ]);
195 ```
196
197
198
199 ### Get SMS Verification Result
200
201 #### Object Properties
202
203 | Property Name | Property Type | Description |
204 | ------------- | :-----------: | ------------------------------------------------------------ |
205 | tran_id | string | The unique ID that was returned by the Send SMS Verification that triggered the OTP sms. |
206 | otp | string | The OTP that was sent to the recipient’s phone. |
207
208 ```
209 <?php
210 require_once __DIR__.'/vendor/autoload.php';
211
212 // Configures FraudLabs Pro API key
213 $config = new FraudLabsPro\Configuration('YOUR_API_KEY');
214 $fraudlabsproSms = new \FraudLabsPro\SmsVerification($config);
215
216 // Get SMS Verification result
217 $fraudlabsproSms->verifyOtp([
218 'tran_id' => 'UNIQUE_TRANS_ID',
219 'otp' => 'OTP_RECEIVED',
220 ]);
221 ```
222
223
224
225 # Reference
226
227 #### Payment Method
228
229 | Payment Method |
230 | ------------------------------------ |
231 | FraudLabsPro\FraudValidation::CREDIT_CARD |
232 | FraudLabsPro\FraudValidation::PAYPAL |
233 | FraudLabsPro\FraudValidation::GOOGLE_CHECKOUT |
234 | FraudLabsPro\FraudValidation::CASH_ON_DELIVERY |
235 | FraudLabsPro\FraudValidation::MONEY_ORDER |
236 | FraudLabsPro\FraudValidation::WIRE_TRANSFER |
237 | FraudLabsPro\FraudValidation::BANK_DEPOSIT |
238 | FraudLabsPro\FraudValidation::BITCOIN |
239 | FraudLabsPro\FraudValidation::OTHERS |
240
241
242
243 #### Feedback Status
244
245 | Feedback Status | Description |
246 | ------------------------------------ | ------------------------------------------- |
247 | FraudLabsPro\FraudValidation::APPROVE | Approves an order that under review status. |
248 | FraudLabsPro\FraudValidation::REJECT | Rejects an order than under review status. |
249 | FraudLabsPro\FraudValidation::REJECT_BLACKLIST | Rejects and blacklists an order. |
250
251
252
253
254 LICENCE
255 =====================
256 See the LICENSE file.
257