Skip to content

Commit

Permalink
2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gre-dev committed Feb 28, 2023
1 parent f7bfd27 commit 3b523fa
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 152 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "greip.js",
"version": "2.1.4",
"version": "2.2.0",
"description": "The official JS library of Greip.",
"author": {
"name": "GRE Development Ltd.",
Expand Down
130 changes: 70 additions & 60 deletions src/__tests__/greip.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import { GeoIP, Lookup, BulkLookup, BadWord, Country, ASN, EmailValidation, PhoneValidation, PaymentFraud } from '../index';
import {
GeoIP,
Lookup,
BulkLookup,
BadWord,
Country,
ASN,
EmailValidation,
PhoneValidation,
PaymentFraud,
} from '../index';

test('GeoIP Method Test', async () => {
await GeoIP({
Expand Down Expand Up @@ -76,68 +86,68 @@ test('Payment Fraud Method Test', async () => {
await PaymentFraud({
key: '0540759999851b6b25e98cbfae03c94e',
data: {
'action': 'purchase',
'website_domain': '',
'website_name': '',
'merchant_id': 21,
'shipment_id': 1,
'transaction_id': 100,
'transaction_amount': 1000000,
'transaction_currency': 'GBP',
'cart_items': {
'item_id': 1,
'item_name': 'Product name',
'item_quantity': 1,
'item_price': '1100.55',
'item_category_id': 1,
action: 'purchase',
website_domain: '',
website_name: '',
merchant_id: 21,
shipment_id: 1,
transaction_id: 100,
transaction_amount: 1000000,
transaction_currency: 'GBP',
cart_items: {
item_id: 1,
item_name: 'Product name',
item_quantity: 1,
item_price: '1100.55',
item_category_id: 1,
},
'isDigitalProducts': true,
'coupon': 'ASDF',
'customer_id': 1,
'customer_firstname': 'First',
'customer_lastname': 'Last',
'customer_pob': 'London',
'customer_ip': '1.1.1.1',
'customer_country': 'GB',
'customer_region': 'London',
'customer_city': 'London',
'customer_zip': 'NW10 7PQ',
'customer_street': '7 Coronation Road',
'customer_street2': '',
'customer_latitude': 0.123,
'customer_longitude': 0.123,
'customer_device_id': 'UNIQUE_DEVICE_ID',
'customer_phone': '000000000',
'customer_registration_date': 1677554670,
'customer_balance': '1000.00',
'customer_dob': '1997-19-05',
'customer_email': 'name@domain.com',
'customer_2fa': true,
'customer_useragent': 'Mozill almaden sdfwer',
'shipping_country': 'GB',
'shipping_region': 'London',
'shipping_city': 'London',
'shipping_zip': 'NW10 7PQ',
'shipping_street': '7 Coronation Road',
'shipping_street2': '',
'shipping_latitude': 0.123,
'shipping_longitude': 0.123,
'billing_country': 'GB',
'billing_region': 'London',
'billing_city': 'London',
'billing_zip': 'NW10 7PQ',
'billing_street': '7 Coronation Road',
'billing_street2': '',
'billing_latitude': 0.123,
'billing_longitude': 0.123,
'payment_type': 'applepay',
'card_name': 'First Last',
'card_number': '1234XXXXXXXX1234',
'card_expiry': '29/05',
'cvv_result': true,
isDigitalProducts: true,
coupon: 'ASDF',
customer_id: 1,
customer_firstname: 'First',
customer_lastname: 'Last',
customer_pob: 'London',
customer_ip: '1.1.1.1',
customer_country: 'GB',
customer_region: 'London',
customer_city: 'London',
customer_zip: 'NW10 7PQ',
customer_street: '7 Coronation Road',
customer_street2: '',
customer_latitude: 0.123,
customer_longitude: 0.123,
customer_device_id: 'UNIQUE_DEVICE_ID',
customer_phone: '000000000',
customer_registration_date: 1677554670,
customer_balance: '1000.00',
customer_dob: '1997-19-05',
customer_email: 'name@domain.com',
customer_2fa: true,
customer_useragent: 'Mozill almaden sdfwer',
shipping_country: 'GB',
shipping_region: 'London',
shipping_city: 'London',
shipping_zip: 'NW10 7PQ',
shipping_street: '7 Coronation Road',
shipping_street2: '',
shipping_latitude: 0.123,
shipping_longitude: 0.123,
billing_country: 'GB',
billing_region: 'London',
billing_city: 'London',
billing_zip: 'NW10 7PQ',
billing_street: '7 Coronation Road',
billing_street2: '',
billing_latitude: 0.123,
billing_longitude: 0.123,
payment_type: 'applepay',
card_name: 'First Last',
card_number: '1234XXXXXXXX1234',
card_expiry: '29/05',
cvv_result: true,
},
countryCode: 'US',
}).then((res: any) => {
expect(res.status).toEqual('success');
});
});
});
Loading

0 comments on commit 3b523fa

Please sign in to comment.