alipay sdk
蚂蚁金服开放平台 sdk
API
API
const AlipaySdk = require('alipay-sdk');
const sdk = new AlipaySdk({
getway: 'https://openapi.alipaydev.com/gateway.do',
appId: '2016101300678716',
privateKey: fs.readFileSync(__dirname + '/fixtures/alipay-private-key.pem', 'ascii'),
});
sdk.execute('alipay.security.risk.content.analyze', bizContext)
.then(ret => {
console.log(ret);
done();
})
.catch(done);
example typescript
import AlipaySdk, { AlipaySdkCommonResult } from 'alipay-sdk';
const sdk = new AlipaySdk({
appId: '123sfd',
privateKey: '12313',
});
interface FooResult extends AlipaySdkCommonResult {
code1: string
}
sdk.execute('fooba', { a: 1 }).then((ret: FooResult) => {
console.log(ret.code1);
})
RSA key 生成
直接执行 rsa.sh