New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@luchalupa/csobcz_payment_gateway

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luchalupa/csobcz_payment_gateway - npm Package Compare versions

Comparing version 0.6.15 to 0.6.17

3

build/index.d.ts

@@ -17,2 +17,5 @@ import { ApplePayInitPayload, Currency, GooglePayInitPayload, InitPayload, InputPayload, Language, OneClickInitPayload, PaymentMethod, PaymentOperation, PaymentResult, PaymentStatus, PaymentStatusResult, ResultCode, ReturnMethod } from './types/Payment';

getRedirectUrl(id: string): string;
processAppPayment(type: 'googlepay' | 'applepay', payId: string, fingerprint: {
[key: string]: string;
}): Promise<any>;
status(id: string): Promise<PaymentStatusResult>;

@@ -19,0 +22,0 @@ reverse(id: string): Promise<PaymentResult>;

@@ -77,11 +77,14 @@ "use strict";

var _a, _b, _c;
console.log('--------------------------------------');
console.log(new Date());
console.log('--------------------------------------');
console.log(payload);
console.log('--------------------------------------');
console.log(`${this.config.gateUrl}${initUrlPath}`);
console.log('--------------------------------------');
// console.log('--------------------------------------')
// console.log(new Date())
// console.log('--------------------------------------')
// console.log(payload)
// console.log('--------------------------------------')
// console.log(`${this.config.gateUrl}${initUrlPath}`)
// console.log('--------------------------------------')
try {
const result = await superagent.post(`${this.config.gateUrl}${initUrlPath}`).send(payload);
// console.log('--------------------------------------')
// console.log("RESULT", result.body)
// console.log('--------------------------------------')
if (this.verify(this.createResultMessage(result.body), result.body.signature)) {

@@ -108,4 +111,12 @@ if (result.body.resultCode.toString() === '0') {

payload['dttm'] = this.createDttm();
// console.log('--------------------------------------')
// console.log('--------------------------------------')
// console.log('PAYLOAD', payload)
// console.log('--------------------------------------')
// console.log('PAYLOAD MESSAGE', this.createPayloadMessage(payload))
// console.log('--------------------------------------')
// console.log('--------------------------------------')
// console.log('--------------------------------------')
payload['signature'] = this.sign(this.createPayloadMessage(payload));
return this.commonInit(input, '/payment/init');
return this.commonInit(payload, '/payment/init');
}

@@ -116,4 +127,14 @@ async googlePayInit(input) {

payload['dttm'] = this.createDttm();
payload['payload'] = input.payload;
// console.log('--------------------------------------')
// console.log('--------------------------------------')
// console.log('PAYLOAD', payload)
// console.log('--------------------------------------')
// console.log('PAYLOAD MESSAGE', this.createPayloadMessage(payload))
// console.log('--------------------------------------')
// console.log('--------------------------------------')
// console.log('--------------------------------------')
payload['signature'] = this.sign(this.createPayloadMessage(payload));
payload['payload'] = input.payload;
// console.log('SIGNATURE', payload['signature'])
// console.log('--------------------------------------')
return this.commonInit(input, '/googlepay/init');

@@ -125,4 +146,4 @@ }

payload['dttm'] = this.createDttm();
payload['payload'] = input.payload;
payload['signature'] = this.sign(this.createPayloadMessage(payload));
payload['payload'] = input.payload;
return this.commonInit(input, '/applepay/init');

@@ -146,2 +167,32 @@ }

}
async processAppPayment(type, payId, fingerprint) {
var _a, _b, _c;
const dttm = this.createDttm();
const payload = {
merchantId: this.config.merchantId,
payId,
dttm,
fingerprint,
signature: this.sign(`${this.config.merchantId}|${payId}|${dttm}|${JSON.stringify(fingerprint)}`),
};
const url = `${this.config.gateUrl}/${type}/process`;
try {
const result = await superagent.post(`${this.config.gateUrl}${url}`).send(payload);
if (this.verify(this.createResultMessage(result.body), result.body.signature)) {
if (result.body.resultCode.toString() === '0') {
return result.body;
}
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.error({ result }, 'Process payment operation failed');
throw new GatewayError_1.default('Process payment operation failed', result.body);
}
else {
(_b = this.logger) === null || _b === void 0 ? void 0 : _b.error({ result }, 'Verification failed');
throw new VerificationError_1.default('Verification failed');
}
}
catch (err) {
(_c = this.logger) === null || _c === void 0 ? void 0 : _c.error({ err }, 'Uknown error');
throw err;
}
}
async status(id) {

@@ -255,2 +306,3 @@ var _a;

'dttm',
'clientIp',
'payOperation',

@@ -261,2 +313,3 @@ 'payMethod',

'closePayment',
'payload',
'returnUrl',

@@ -303,3 +356,4 @@ 'returnMethod',

}
return keys.map((key) => data[key]).filter((item) => typeof item !== 'undefined');
const filtered = keys.map((key) => data[key]).filter((item) => typeof item !== 'undefined');
return filtered;
}

@@ -306,0 +360,0 @@ createMessageString(data, keys = []) {

@@ -79,2 +79,5 @@ import { Customer } from './Customer';

authCode?: string;
actions?: {
[key: string]: string;
};
}

@@ -81,0 +84,0 @@ export interface PaymentStatusResult {

2

package.json
{
"name": "@luchalupa/csobcz_payment_gateway",
"version": "0.6.15",
"version": "0.6.17",
"description": "CSOB CZ payment gateway module",

@@ -5,0 +5,0 @@ "main": "build/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc