From 0835dfa9b57c4cb9554abe816cbd071f3e3c2dd6 Mon Sep 17 00:00:00 2001 From: Mason Date: Fri, 26 Oct 2018 16:28:20 +0700 Subject: [PATCH 1/2] Add README --- README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 From 459b160d0bd757604fed6fb16fa52f4d2ef2c06e Mon Sep 17 00:00:00 2001 From: Elden Date: Mon, 29 Nov 2021 17:43:17 +0700 Subject: [PATCH 2/2] Compatibilities with Node 16.x --- .DS_Store | Bin 8196 -> 0 bytes features/.DS_Store | Bin 6148 -> 0 bytes features/widget.feature | 46 +++++++++++++++++++--------------------- lib/.DS_Store | Bin 6148 -> 0 bytes lib/ApiObject.js | 6 +++--- lib/Base.js | 10 ++++----- lib/Charge.js | 6 +++--- lib/Onetimetoken.js | 8 +++---- lib/Pingback.js | 6 +++--- lib/Subscription.js | 10 ++++----- lib/Widget.js | 6 +++--- package.json | 15 +++++++------ 12 files changed, 57 insertions(+), 56 deletions(-) delete mode 100644 .DS_Store delete mode 100644 features/.DS_Store delete mode 100644 lib/.DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index fb684f7e8026407a153dcd591f7821368da6a123..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHL&2Jk;6n`%XWF4n;+oX_EsJ7(N(g+38;$9Gr6Ss|^#KcjWv?*rSo;XX_GuG}p zAB_w?B5vHcaN(Q3feR8J;=msO2gIEVTq{*d-^`93$8K*(d~}{P^Lsn<-ptN#=FRFY z0AQ|Bc@ba&04ypJ?KD*n5ZNzFpA6`hBZNr)09POnufrnY3w_q6!7yMLFbo(53M za<<|}zUK#iylbVbR4P@nC-(L(WinIF%*&UWQ_fx{Gd<;8n8`Go_P3UG>fFWIYisr9 z2cLZU+2>z;`PFwnsHFqydke;r=T7}2X?;X)6+<2fUZp_Q)37QVSyrs`1{?R^@zuR`#sT@7> z#8La$@v-p}Pd+tq^6690JbU`IQ?kcAw|u)A%JVcQ0uknd2D@1e{YtU!mVI7bjoD6I z^zX2eeZ0qXiB;Y@Xj*Gl%$s2qwQD2T|9eZkk( zBZ`@YnAH~ehM*bcabB#;u4sjY5n-Rt>Y5vdF0ZoO?ybP}Sg^=*B928(TFTMNg6qIo z^+}g&nSAvxI#DE(+1J{NJYyuCF8e^8OuDGEqhy~?RLjOr<1!bVrBajGf;O|@Jl#*% zUPuysZfDhf|}AA6pDQ}qYA~t zes#J>%d|Qds${Q%ocwvueDX%^_DjJMz1b|x6E}JC>btX%k;lERH>5`+h5^OEV8X+M z%>VNb|Nn2;G7K07{>Kd9(0p+|M+S5dOAStO%t?k2!i0e1lM`;8h<$P10(xm|#-8<}rLIAHcWKZ+4c@Bo%KW zWhTsgo5{@nd>b-Z0B*j?E`S+;2~}`(OtVAex#&Pf!E;D-zK=&NagG)3!ywum|B(UN zyD3sUamQY0K|`f?QPx9X1XZhHAgs5sA(SHaoVz39(g^b~LGH}mVPf0?PQ^nGikyfrZf zi~(a{PZ(g$7MYwVnl%QD0b`(LK)w$VRWJ_NDEdzajXweq$8>vPTYeKICkhw`Y!vx~ z;xv`0sV*EboTk$sg}69iqp0a{;qc+Y$S#~voFAS2M?M@bRy1o27z14f4)k^=_5bqc z^M5zV?u-FrV6PZ(=FuS&pL(CN+ zv@6+@Iy+gm8>fjOET}Za*8b~WA+M8$t$REKzD{@CRn1>wIij= zWQoQR=3#YCDy(tZ=yO&xDim+{E!TeyqN|qQ!I?T=a9$J;rA6cb_iTywibw0s0dv3{_;Ntjhm1`y4_JBB zrGuRw0f;RQYw%kBDhMYFm~`PlpSK4;L!Ca6)lf zozKrS9WM81y*XeG)E!v#A2((HKlu6lUnkiobHE(MSC diff --git a/lib/ApiObject.js b/lib/ApiObject.js index 4e55cd7..869d065 100644 --- a/lib/ApiObject.js +++ b/lib/ApiObject.js @@ -1,15 +1,15 @@ 'use strict'; var Base = require('./Base'), - util = require('util'), + inherits = require('inherits'), querystring = require('querystring'); function ApiObject() { } -util.inherits(ApiObject, Base); +inherits(ApiObject, Base); -util._extend(ApiObject.prototype, { +Object.assign(ApiObject.prototype, { checkProjectEnv: function(){ var reg = /_+/; diff --git a/lib/Base.js b/lib/Base.js index 9460900..a992ef0 100644 --- a/lib/Base.js +++ b/lib/Base.js @@ -1,6 +1,6 @@ 'use strict'; -var util = require('util'); +var inherits = require('inherits'); var Config = require('./Config'); Base.API_VC = 1; @@ -10,9 +10,9 @@ Base.API_CART = 3; function Base() { } -util.inherits(Base, Config); +inherits(Base, Config); -util._extend(Base.prototype, { +Object.assign(Base.prototype, { getApiType: function() { return this.apiType; @@ -30,7 +30,7 @@ util._extend(Base.prototype, { for (var x in b) a[x] = b[x]; return a; }, - + appendToErrors: function(err) { return this.errors.push(err); }, @@ -43,4 +43,4 @@ util._extend(Base.prototype, { return this.getErrors().join("\n"); } }); -module.exports = Base; \ No newline at end of file +module.exports = Base; diff --git a/lib/Charge.js b/lib/Charge.js index 1a3501e..b5acacf 100644 --- a/lib/Charge.js +++ b/lib/Charge.js @@ -2,7 +2,7 @@ var HttpAction = require('./HttpAction'), ApiObject = require('./ApiObject'), - util = require('util'), + inherits = require('inherits'), querystring = require('querystring'); function Charge(amount,currency,description,email,fingerprint,token,extra){ @@ -15,9 +15,9 @@ function Charge(amount,currency,description,email,fingerprint,token,extra){ this.extra = extra||null; } -util.inherits(Charge, ApiObject); +inherits(Charge, ApiObject); -util._extend(Charge.prototype, { +Object.assign(Charge.prototype, { createCharge: function(callback){ //set the post data diff --git a/lib/Onetimetoken.js b/lib/Onetimetoken.js index 9822f63..5f2a8fd 100644 --- a/lib/Onetimetoken.js +++ b/lib/Onetimetoken.js @@ -3,17 +3,17 @@ var ApiObject = require('./ApiObject'), Card = require('./Card'), HttpAction = require('./HttpAction'), - util = require('util'), + inherits = require('inherits'), querystring = require('querystring'); function Onetimetoken(number,exp_month,exp_year,cvv){ this.card = new Card(number,exp_month,exp_year,cvv); } -util.inherits(Onetimetoken, ApiObject); +inherits(Onetimetoken, ApiObject); + +Object.assign(Onetimetoken.prototype, { -util._extend(Onetimetoken.prototype, { - createOnetimetoken: function(callback){ //set the post data var post_data = { diff --git a/lib/Pingback.js b/lib/Pingback.js index 86b6708..a815443 100644 --- a/lib/Pingback.js +++ b/lib/Pingback.js @@ -2,7 +2,7 @@ var Base = require('./Base'), Product = require('./Product'), - util = require('util'), + inherits = require('inherits'), Signature = require('./Signature/Pingback'), querystring = require('querystring'); @@ -25,9 +25,9 @@ function Pingback(parameters, ipAddress, pingbackForBrick) { this.pingbackForBrick = pingbackForBrick||false; } -util.inherits(Pingback, Base); +inherits(Pingback, Base); -util._extend(Pingback.prototype, { +Object.assign(Pingback.prototype, { validate: function(skipIpWhitelistCheck) { var pingbackForBrick = this.pingbackForBrick; diff --git a/lib/Subscription.js b/lib/Subscription.js index f40fbdb..718c237 100644 --- a/lib/Subscription.js +++ b/lib/Subscription.js @@ -2,7 +2,7 @@ var HttpAction = require('./HttpAction'), ApiObject = require('./ApiObject'), - util = require('util'), + inherits = require('inherits'), querystring = require('querystring'); function Subscription(amount,currency,description,email,fingerprint,token,period,period_duration,trial_data,extra){ @@ -18,9 +18,9 @@ function Subscription(amount,currency,description,email,fingerprint,token,period this.extra = extra||null; } -util.inherits(Subscription, ApiObject); +inherits(Subscription, ApiObject); -util._extend(Subscription.prototype, { +Object.assign(Subscription.prototype, { createSubscription: function(callback){ //set the post data @@ -58,7 +58,7 @@ util._extend(Subscription.prototype, { default: console.log('Parameter error in subscription.otherOperation'); break; } - + var post_options = this.createRequest('subscription', additional_path); HttpAction.runAction(post_options, post_data, true, function(data){ callback(data); @@ -67,4 +67,4 @@ util._extend(Subscription.prototype, { } }); -module.exports = Subscription; \ No newline at end of file +module.exports = Subscription; diff --git a/lib/Widget.js b/lib/Widget.js index 368f916..753fa70 100644 --- a/lib/Widget.js +++ b/lib/Widget.js @@ -2,7 +2,7 @@ var Base = require('./Base'), Product = require('./Product'), - util = require('util'), + inherits = require('inherits'), querystring = require('querystring'), Signature = require('./Signature/Widget'); @@ -14,8 +14,8 @@ function Widget(userId, widgetCode, products, extraParams) { this.extraParams = extraParams || null; } -util.inherits(Widget, Base); -util._extend(Widget.prototype, { +inherits(Widget, Base); +Object.assign(Widget.prototype, { getDefaultWidgetSignature: function() { return this.getApiType() !== this.API_CART ? this.DEFAULT_SIGNATURE_VERSION : this.SIGNATURE_VERSION_2; diff --git a/package.json b/package.json index d0cdf92..1b61557 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "paymentwall", - "version": "1.2.4", + "version": "2.0.0", "author": "Paymentwall Team ", "description": "Paymentwall Node.js Library", "main": "./index", @@ -13,7 +13,7 @@ }, "bugs": { "url": "https://github.com/paymentwall/paymentwall-node/issues" - }, + }, "keywords": [ "payments", "paymentwall", @@ -27,11 +27,14 @@ "cucumber" ], "devDependencies": { - "cucumber": "1.*", "chai": "*", - "request": "*", - "cheerio": "*" + "cheerio": "*", + "cucumber": "1.*", + "request": "*" }, "license": "MIT", - "homepage": "http://www.paymentwall.com" + "homepage": "http://www.paymentwall.com", + "dependencies": { + "inherits": "^2.0.4" + } }