Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alipay-sdk

Package Overview
Dependencies
Maintainers
2
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alipay-sdk - npm Package Compare versions

Comparing version 1.0.11 to 1.0.14

coverage/coverage.json

2

index.d.ts

@@ -6,3 +6,3 @@ declare module 'alipay-sdk' {

// 请求执行
execute(method: string, bizContext?: Object, publicArgs?: Object): Promise<AlipaySdkCommonResult>;
execute(method: string, bizContext?: Object, publicArgs?: Object, validateSign?: boolean): Promise<AlipaySdkCommonResult>;
// 签名

@@ -9,0 +9,0 @@ sign(params: Object, needEncode?: boolean): string;

@@ -62,6 +62,9 @@ 'use strict';

* @param {object} publicArgs 公共请求参数
* @param {Boolean} validateSign 是否验签
* @return {Promise} 请求执行结果
*/
execute(method, bizContext, publicArgs) {
execute(method, bizContext, publicArgs, validateSign) {
publicArgs = publicArgs || {};
// 默认不验签
validateSign = validateSign || false;
const config = this.config;

@@ -91,4 +94,7 @@ const params = Object.assign({}, config.params, {

const data = ret.data[method.replace(/\./g, '_') + '_response'];
// 验签
const validateSuccess = this.checkResponseSign(data, ret.data.sign);
// 默认不验签
let validateSuccess = true;
if (validateSign) {
validateSuccess = this.checkResponseSign(data, ret.data.sign);
}
if (validateSuccess) {

@@ -100,3 +106,2 @@ if (config.camelcase) {

}
reject(ret);
}

@@ -103,0 +108,0 @@ reject(ret);

{
"name": "alipay-sdk",
"version": "1.0.11",
"version": "1.0.14",
"description": "",

@@ -11,3 +11,2 @@ "main": "index.js",

},
"author": "",
"license": "ISC",

@@ -27,4 +26,5 @@ "dependencies": {

"mocha-lcov-reporter": "^1.2.0",
"should": "^11.1.1"
"should": "^11.1.1",
"sinon": "^1.17.7"
}
}
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