- push digiflazz supplier add md5 lib
This commit is contained in:
		
							
								
								
									
										11
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										11
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -20,6 +20,7 @@ | |||||||
|         "@nestjs/typeorm": "^8.0.2", |         "@nestjs/typeorm": "^8.0.2", | ||||||
|         "axios": "^0.24.0", |         "axios": "^0.24.0", | ||||||
|         "bluebird": "^3.7.2", |         "bluebird": "^3.7.2", | ||||||
|  |         "blueimp-md5": "^2.19.0", | ||||||
|         "class-transformer": "^0.4.0", |         "class-transformer": "^0.4.0", | ||||||
|         "class-validator": "^0.13.1", |         "class-validator": "^0.13.1", | ||||||
|         "crypto": "^1.0.1", |         "crypto": "^1.0.1", | ||||||
| @@ -3105,6 +3106,11 @@ | |||||||
|       "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", |       "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", | ||||||
|       "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" |       "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/blueimp-md5": { | ||||||
|  |       "version": "2.19.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", | ||||||
|  |       "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==" | ||||||
|  |     }, | ||||||
|     "node_modules/body-parser": { |     "node_modules/body-parser": { | ||||||
|       "version": "1.19.0", |       "version": "1.19.0", | ||||||
|       "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", |       "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", | ||||||
| @@ -13028,6 +13034,11 @@ | |||||||
|       "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", |       "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", | ||||||
|       "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" |       "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" | ||||||
|     }, |     }, | ||||||
|  |     "blueimp-md5": { | ||||||
|  |       "version": "2.19.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", | ||||||
|  |       "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==" | ||||||
|  |     }, | ||||||
|     "body-parser": { |     "body-parser": { | ||||||
|       "version": "1.19.0", |       "version": "1.19.0", | ||||||
|       "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", |       "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", | ||||||
|   | |||||||
| @@ -33,6 +33,7 @@ | |||||||
|     "@nestjs/typeorm": "^8.0.2", |     "@nestjs/typeorm": "^8.0.2", | ||||||
|     "axios": "^0.24.0", |     "axios": "^0.24.0", | ||||||
|     "bluebird": "^3.7.2", |     "bluebird": "^3.7.2", | ||||||
|  |     "blueimp-md5": "^2.19.0", | ||||||
|     "class-transformer": "^0.4.0", |     "class-transformer": "^0.4.0", | ||||||
|     "class-validator": "^0.13.1", |     "class-validator": "^0.13.1", | ||||||
|     "crypto": "^1.0.1", |     "crypto": "^1.0.1", | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| import axios from 'axios'; | import axios from 'axios'; | ||||||
| import cryptoMd5 from "crypto"; |  | ||||||
|  |  | ||||||
| const irs_url = 'http://h2h.elangpixiu.com/api/h2h'; | const irs_url = 'http://h2h.elangpixiu.com/api/h2h'; | ||||||
| const irs_id = 'PT0005'; | const irs_id = 'PT0005'; | ||||||
| @@ -32,7 +31,7 @@ export const doTransaction = async ( | |||||||
|     } else if (supplier.code == 'Digiflazz') { |     } else if (supplier.code == 'Digiflazz') { | ||||||
|       if (typePaid == 'INQUIRY') { |       if (typePaid == 'INQUIRY') { | ||||||
|         const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`; |         const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`; | ||||||
|         var md5Hash = require("md5-hash"); |         const md5Hash = require("blueimp-md5"); | ||||||
|  |  | ||||||
|         const options = { |         const options = { | ||||||
|           headers: { 'Content-Type': 'application/json' }, |           headers: { 'Content-Type': 'application/json' }, | ||||||
| @@ -43,7 +42,7 @@ export const doTransaction = async ( | |||||||
|           customer_no: `${destination}`, |           customer_no: `${destination}`, | ||||||
|           buyer_sku_code: `${productCode}`, |           buyer_sku_code: `${productCode}`, | ||||||
|           ref_id: `${idtrx}`, |           ref_id: `${idtrx}`, | ||||||
|           sign: md5Hash.default(`${supplier.irs_user}${supplier.irs_pass}${idtrx}`), |           sign: md5Hash(md5HashDigiflazz), | ||||||
|           testing: true, |           testing: true, | ||||||
|         }; |         }; | ||||||
|         const res = await axios.post( |         const res = await axios.post( | ||||||
| @@ -55,7 +54,7 @@ export const doTransaction = async ( | |||||||
|         return res.data; |         return res.data; | ||||||
|       } else if (typePaid == 'PAYMENT') { |       } else if (typePaid == 'PAYMENT') { | ||||||
|         const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`; |         const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`; | ||||||
|         var md5Hash = require("md5-hash"); |         const md5Hash = require("blueimp-md5"); | ||||||
|  |  | ||||||
|         const options = { |         const options = { | ||||||
|           headers: { 'Content-Type': 'application/json' }, |           headers: { 'Content-Type': 'application/json' }, | ||||||
| @@ -66,7 +65,7 @@ export const doTransaction = async ( | |||||||
|           customer_no: `${destination}`, |           customer_no: `${destination}`, | ||||||
|           buyer_sku_code: `${productCode}`, |           buyer_sku_code: `${productCode}`, | ||||||
|           ref_id: `${billTrxId}`, |           ref_id: `${billTrxId}`, | ||||||
|           sign: md5Hash.default(`${supplier.irs_user}${supplier.irs_pass}${idtrx}`), |           sign: md5Hash(md5HashDigiflazz), | ||||||
|           testing: true, |           testing: true, | ||||||
|         }; |         }; | ||||||
|         const res = await axios.post( |         const res = await axios.post( | ||||||
| @@ -78,7 +77,7 @@ export const doTransaction = async ( | |||||||
|         return res.data; |         return res.data; | ||||||
|       } else { |       } else { | ||||||
|         const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`; |         const md5HashDigiflazz = `${supplier.irs_user}${supplier.irs_pass}${idtrx}`; | ||||||
|         var md5Hash = require("md5-hash"); |         const md5Hash = require("blueimp-md5"); | ||||||
|         console.log('testmd5', md5HashDigiflazz); |         console.log('testmd5', md5HashDigiflazz); | ||||||
|         const options = { |         const options = { | ||||||
|           headers: {'Content-Type': 'application/json'}, |           headers: {'Content-Type': 'application/json'}, | ||||||
| @@ -88,7 +87,7 @@ export const doTransaction = async ( | |||||||
|           customer_no: `${destination}`, |           customer_no: `${destination}`, | ||||||
|           buyer_sku_code: `${productCode}`, |           buyer_sku_code: `${productCode}`, | ||||||
|           ref_id: `${idtrx}`, |           ref_id: `${idtrx}`, | ||||||
|           sign: md5Hash.default(md5HashDigiflazz), |           sign: md5Hash(md5HashDigiflazz), | ||||||
|           testing: true, |           testing: true, | ||||||
|         }; |         }; | ||||||
|         const res = await axios.post( |         const res = await axios.post( | ||||||
|   | |||||||
| @@ -1765,6 +1765,11 @@ | |||||||
|   "resolved" "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz" |   "resolved" "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz" | ||||||
|   "version" "3.4.7" |   "version" "3.4.7" | ||||||
|  |  | ||||||
|  | "blueimp-md5@^2.19.0": | ||||||
|  |   "integrity" "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==" | ||||||
|  |   "resolved" "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz" | ||||||
|  |   "version" "2.19.0" | ||||||
|  |  | ||||||
| "body-parser@1.19.0": | "body-parser@1.19.0": | ||||||
|   "integrity" "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==" |   "integrity" "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==" | ||||||
|   "resolved" "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz" |   "resolved" "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user