Skip to content

Commit 3c04494

Browse files
committed
Supported parameters in Screen Order API
1 parent dee7301 commit 3c04494

File tree

6 files changed

+29
-18
lines changed

6 files changed

+29
-18
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "library",
44
"description": "FraudLabs Pro PHP SDK to help merchants to detect fraud order and therefore reduce chargebacks.",
55
"license": "MIT",
6-
"version": "4.0.0",
6+
"version": "4.0.1",
77
"authors": [
88
{
99
"name": "FraudLabs Pro",

docs/source/code.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ Retrieve geolocation information for an IP address.
113113
| billing->state | string | (optional) State of billing address. It supports state codes, e.g. NY (New York), for state or province of United States or Canada.|
114114
| billing->country | string | (optional) Country of billing address. It requires the input of ISO-3166 alpha-2 country code, e.g. US for United States.|
115115
| billing->postcode | string | (optional) Postal or ZIP code of billing address. |
116+
| shipping->lastName | string | (optional) Receiver's last name. |
117+
| shipping->firstName | string | (optional) Receiver's first name. |
116118
| shipping->address | string | (optional) Street address of shipping address. |
117119
| shipping->city | string | (optional) City of shipping address. |
118120
| shipping->state | string | (optional) State of shipping address. It supports state codes, e.g. NY - New York, for state or province of United States or Canada. |
@@ -127,7 +129,8 @@ Retrieve geolocation information for an IP address.
127129
| order->quantity | integer | (optional) Total quantity of the transaction. |
128130
| order->currency | string | (optional) Currency code used in the transaction. It requires the input of<br/> ISO-4217 (3 characters) currency code, e.g. USD for US Dollar. |
129131
| order->department | string | (optional) Merchant identifier to uniquely identify a product or service department. |
130-
| order->paymentMethod | string | (optional) Payment mode of transaction. Valid values: creditcard \| affirm \| paypal \| googlecheckout \| bitcoin \| cod \| moneyorder \| wired \|<br/> bankdeposit \| elviauthorized \| paymitco \| cybersource \| sezzle \| viabill \| amazonpay \| pmnts_gateway \| giftcard \| ewayrapid \| others. |
132+
| order->paymentGateway | string | (optional) The name of payment gateway used to capture the payment. |
133+
| order->paymentMethod | string | (optional) Payment mode of transaction. Valid values: creditcard \| paypal \| cod \| bankdeposit \| giftcard \| crypto \| wired \| others |
131134
132135
:return: Returns the geolocation information in array. Refer below table for the fields avaliable in the array
133136
:rtype: array

docs/source/quickstart.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ $orderDetails = [
3939
'quantity' => 1,
4040

4141
// Please refer reference section for full list of payment methods
42+
'paymentGateway' => FraudLabsPro\FraudValidation::CREDIT_CARD,
4243
'paymentMethod' => FraudLabsPro\FraudValidation::CREDIT_CARD,
4344
],
4445

@@ -60,6 +61,8 @@ $orderDetails = [
6061
],
6162

6263
'shipping' => [
64+
'firstName' => 'Hector',
65+
'lastName' => 'Henderson',
6366
'address' => '4469 Chestnut Street',
6467
'city' => 'Tampa',
6568
'state' => 'FL',

example.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
'ip' => '146.112.62.105',
1515

1616
'order' => [
17-
'orderId' => '67398',
18-
'note' => 'Online shop',
19-
'currency' => 'USD',
20-
'amount' => '79.89',
21-
'quantity' => 1,
22-
'paymentMethod' => FraudLabsPro\FraudValidation::CREDIT_CARD,
17+
'orderId' => '67398',
18+
'note' => 'Online shop',
19+
'currency' => 'USD',
20+
'amount' => '79.89',
21+
'quantity' => 1,
22+
'paymentGateway' => FraudLabsPro\FraudValidation::CREDIT_CARD,
23+
'paymentMethod' => FraudLabsPro\FraudValidation::CREDIT_CARD,
2324
],
2425

2526
'card' => [
@@ -40,6 +41,8 @@
4041
],
4142

4243
'shipping' => [
44+
'firstName' => 'Hector',
45+
'lastName' => 'Henderson',
4346
'address' => '4469 Chestnut Street',
4447
'city' => 'Tampa',
4548
'state' => 'FL',

src/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
class Configuration
1111
{
12-
const VERSION = '4.0.0';
12+
const VERSION = '4.0.1';
1313

1414
public $apiKey = '';
1515

src/FraudValidation.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ class FraudValidation
2424
*/
2525
const CREDIT_CARD = 'CREDITCARD';
2626
const PAYPAL = 'PAYPAL';
27-
const GOOGLE_CHECKOUT = 'GOOGLECHECKOUT';
2827
const CASH_ON_DELIVERY = 'COD';
29-
const MONEY_ORDER = 'MONEYORDER';
30-
const WIRE_TRANSFER = 'WIRED';
3128
const BANK_DEPOSIT = 'BANKDEPOSIT';
32-
const BITCOIN = 'BITCOIN';
29+
const GIFT_CARD = 'GIFTCARD';
30+
const CRYPTO = 'CRYPTO';
31+
const WIRED = 'WIRED';
3332
const OTHERS = 'OTHERS';
3433

3534
/**
@@ -87,6 +86,7 @@ public function validate($params = [])
8786
'currency' => (isset($params['order']['currency'])) ? $params['order']['currency'] : 'USD',
8887
'department' => (isset($params['order']['department'])) ? $params['order']['department'] : '',
8988
'payment_mode' => (isset($params['order']['paymentMethod'])) ? $params['order']['paymentMethod'] : '',
89+
'payment_gateway' => (isset($params['order']['paymentGateway'])) ? $params['order']['paymentGateway'] : '',
9090

9191
// Credit card information
9292
'bin_no' => (isset($params['card']['number'])) ? substr($params['card']['number'], 0, 9) : '',
@@ -95,11 +95,13 @@ public function validate($params = [])
9595
'cvv_result' => (isset($params['card']['cvv'])) ? $params['card']['cvv'] : '',
9696

9797
// Shipping information
98-
'ship_addr' => (isset($params['shipping']['address'])) ? $params['shipping']['address'] : '',
99-
'ship_city' => (isset($params['shipping']['city'])) ? $params['shipping']['city'] : '',
100-
'ship_state' => (isset($params['shipping']['state'])) ? $params['shipping']['state'] : '',
101-
'ship_zip_code' => (isset($params['shipping']['postcode'])) ? $params['shipping']['postcode'] : '',
102-
'ship_country' => (isset($params['shipping']['country'])) ? $params['shipping']['country'] : '',
98+
'ship_first_name' => (isset($params['shipping']['firstName'])) ? $params['shipping']['firstName'] : '',
99+
'ship_last_name' => (isset($params['shipping']['lastName'])) ? $params['shipping']['lastName'] : '',
100+
'ship_addr' => (isset($params['shipping']['address'])) ? $params['shipping']['address'] : '',
101+
'ship_city' => (isset($params['shipping']['city'])) ? $params['shipping']['city'] : '',
102+
'ship_state' => (isset($params['shipping']['state'])) ? $params['shipping']['state'] : '',
103+
'ship_zip_code' => (isset($params['shipping']['postcode'])) ? $params['shipping']['postcode'] : '',
104+
'ship_country' => (isset($params['shipping']['country'])) ? $params['shipping']['country'] : '',
103105
];
104106

105107
$http = new Http();

0 commit comments

Comments
 (0)