Skip to content

Commit

Permalink
feat: Add skip_gateway_rules and eci (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: ProcessOut Fountain <[email protected]>
  • Loading branch information
roshan-gorasia-cko and processout-machine authored Jan 25, 2024
1 parent 25fc3b9 commit 1e1ba51
Show file tree
Hide file tree
Showing 13 changed files with 168 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ jspm_packages
.node_repl_history

deploy.sh
publish.sh
18 changes: 18 additions & 0 deletions lib/invoicerisk.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ declare class InvoiceRisk {
* @type {boolean}
*/
private isLegit;
/**
* Skip payment gateway fraud engine rules (on compatible gateways only.)
* @type {boolean}
*/
private skipGatewayRules;
/**
* InvoiceRisk constructor
* @param {ProcessOut} client
Expand Down Expand Up @@ -44,6 +49,19 @@ declare class InvoiceRisk {
* @return {InvoiceRisk}
*/
setIsLegit(val: boolean): InvoiceRisk;
/**
* Get SkipGatewayRules
* Skip payment gateway fraud engine rules (on compatible gateways only.)
* @return {boolean}
*/
getSkipGatewayRules(): boolean;
/**
* Set SkipGatewayRules
* Skip payment gateway fraud engine rules (on compatible gateways only.)
* @param {boolean} val
* @return {InvoiceRisk}
*/
setSkipGatewayRules(val: boolean): InvoiceRisk;
/**
* Fills the current object with the new values pulled from the data
* @param {array} data
Expand Down
2 changes: 1 addition & 1 deletion lib/invoicerisk.d.ts.map

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

26 changes: 26 additions & 0 deletions lib/invoicerisk.js

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

2 changes: 1 addition & 1 deletion lib/invoicerisk.js.map

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

18 changes: 18 additions & 0 deletions lib/transaction.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ declare class Transaction {
* @type {string}
*/
private paymentType;
/**
* The Electronic Commerce Indicator
* @type {string}
*/
private eci;
/**
* Native APM response data
* @type {p.NativeAPMResponse}
Expand Down Expand Up @@ -1117,6 +1122,19 @@ declare class Transaction {
* @return {Transaction}
*/
setPaymentType(val: string): Transaction;
/**
* Get Eci
* The Electronic Commerce Indicator
* @return {string}
*/
getEci(): string;
/**
* Set Eci
* The Electronic Commerce Indicator
* @param {string} val
* @return {Transaction}
*/
setEci(val: string): Transaction;
/**
* Get NativeApm
* Native APM response data
Expand Down
2 changes: 1 addition & 1 deletion lib/transaction.d.ts.map

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions lib/transaction.js

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

2 changes: 1 addition & 1 deletion lib/transaction.js.map

Large diffs are not rendered by default.

31 changes: 16 additions & 15 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": "processout",
"version": "8.14.0",
"version": "8.15.0",
"description": "ProcessOut API bindings.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
29 changes: 29 additions & 0 deletions src/invoicerisk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ class InvoiceRisk {
*/
private isLegit: boolean = null;

/**
* Skip payment gateway fraud engine rules (on compatible gateways only.)
* @type {boolean}
*/
private skipGatewayRules: boolean = null;

/**
* InvoiceRisk constructor
* @param {ProcessOut} client
Expand Down Expand Up @@ -83,6 +89,26 @@ class InvoiceRisk {
return this;
}

/**
* Get SkipGatewayRules
* Skip payment gateway fraud engine rules (on compatible gateways only.)
* @return {boolean}
*/
public getSkipGatewayRules(): boolean {
return this.skipGatewayRules;
}

/**
* Set SkipGatewayRules
* Skip payment gateway fraud engine rules (on compatible gateways only.)
* @param {boolean} val
* @return {InvoiceRisk}
*/
public setSkipGatewayRules(val: boolean): InvoiceRisk {
this.skipGatewayRules = val;
return this;
}

/**
* Fills the current object with the new values pulled from the data
* @param {array} data
Expand All @@ -93,6 +119,8 @@ class InvoiceRisk {
this.setScore(data["score"]);
if (data["is_legit"])
this.setIsLegit(data["is_legit"]);
if (data["skip_gateway_rules"])
this.setSkipGatewayRules(data["skip_gateway_rules"]);
return this;
}

Expand All @@ -104,6 +132,7 @@ class InvoiceRisk {
return {
"score": this.getScore(),
"is_legit": this.getIsLegit(),
"skip_gateway_rules": this.getSkipGatewayRules(),
};
}

Expand Down
29 changes: 29 additions & 0 deletions src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,12 @@ class Transaction {
*/
private paymentType: string = null;

/**
* The Electronic Commerce Indicator
* @type {string}
*/
private eci: string = null;

/**
* Native APM response data
* @type {p.NativeAPMResponse}
Expand Down Expand Up @@ -1712,6 +1718,26 @@ class Transaction {
return this;
}

/**
* Get Eci
* The Electronic Commerce Indicator
* @return {string}
*/
public getEci(): string {
return this.eci;
}

/**
* Set Eci
* The Electronic Commerce Indicator
* @param {string} val
* @return {Transaction}
*/
public setEci(val: string): Transaction {
this.eci = val;
return this;
}

/**
* Get NativeApm
* Native APM response data
Expand Down Expand Up @@ -1887,6 +1913,8 @@ class Transaction {
this.setSchemeId(data["scheme_id"]);
if (data["payment_type"])
this.setPaymentType(data["payment_type"]);
if (data["eci"])
this.setEci(data["eci"]);
if (data["native_apm"])
this.setNativeApm(data["native_apm"]);
if (data["external_details"])
Expand Down Expand Up @@ -1961,6 +1989,7 @@ class Transaction {
"initial_scheme_transaction_id": this.getInitialSchemeTransactionId(),
"scheme_id": this.getSchemeId(),
"payment_type": this.getPaymentType(),
"eci": this.getEci(),
"native_apm": this.getNativeApm(),
"external_details": this.getExternalDetails(),
};
Expand Down

0 comments on commit 1e1ba51

Please sign in to comment.