Skip to content

Commit

Permalink
chore: bump version to 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
liyibass committed Jul 21, 2021
1 parent e82c213 commit 2a19851
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
dist
test.js
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class NewebPay {
return decryptedTradeInfo
}

static _encryptAES(tradeInfo) {
_encryptAES(tradeInfo) {
const tradeInfoQueryString = querystring.stringify(tradeInfo)

const cipher = crypto.createCipheriv('aes-256-cbc', this.key, this.iv)
Expand All @@ -65,7 +65,7 @@ class NewebPay {
return encrypted
}

static _encryptSHA256(aes) {
_encryptSHA256(aes) {
const queryString = `HashKey=${this.key}&${aes}&HashIV=${this.iv}`
const hash = crypto
.createHash('sha256')
Expand All @@ -76,7 +76,7 @@ class NewebPay {
return result
}

static _decryptAES(TradeInfoAES) {
_decryptAES(TradeInfoAES) {
const decrypt = crypto.createDecipheriv('aes256', this.key, this.iv)
decrypt.setAutoPadding(false)
const text = decrypt.update(TradeInfoAES, 'hex', 'binary')
Expand All @@ -86,7 +86,7 @@ class NewebPay {
return result
}

static _addPadding(string, blockSize = 32) {
_addPadding(string, blockSize = 32) {
const len = string.length
const pad = blockSize - (len % blockSize)
const chr = String.fromCharCode(pad)
Expand All @@ -95,7 +95,7 @@ class NewebPay {
return string
}

static _getMerchantOrderNo() {
_getMerchantOrderNo() {
return 'i_am_merchant_order_number'
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@liyibass/newebpay-node",
"version": "1.0.9",
"name": "@mirror-media/newebpay-node",
"version": "1.0.1",
"description": "handle newebpay payment",
"author": "mirror-media",
"main": "index.js",
Expand Down

0 comments on commit 2a19851

Please sign in to comment.