online-payment-api v1.0.0
online-payment-api
OnlinePaymentApi - JavaScript client for online-payment-api \u5728\u7EBF\u652F\u4ED8 This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-04-26T05:43:01.891Z
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install online-payment-api --save
git
If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/online-payment-api then install it via:
npm install YOUR_USERNAME/online-payment-api --save
For browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Getting Started
Please follow the installation instruction and execute the following JS code:
var OnlinePaymentApi = require('online-payment-api');
var api = new OnlinePaymentApi.ToPayApi()
var token = "token_example"; // {String} \u7528\u6237\u4EE4\u724C.
var payChannel = "payChannel_example"; // {String} \u652F\u4ED8\u6E20\u9053 1:\u5FAE\u4FE1 2:\u652F\u4ED8\u5B9D 3:\u94F6\u8054.
var payType = "payType_example"; // {String} \u652F\u4ED8\u7C7B\u578B 1:web 2:app 3:wap.
var subject = "subject_example"; // {String} \u5546\u54C1\u63CF\u8FF0.
var payFee = "payFee_example"; // {String} \u652F\u4ED8\u91D1\u989D.
var notifyUrl = "notifyUrl_example"; // {String} \u652F\u4ED8\u5F02\u6B65\u901A\u77E5\u5730\u5740(\u901A\u77E5\u56DE\u8C03\u5730\u5740\u4E0D\u80FD\u643A\u5E26\u53C2\u6570).
var opts = {
'openid': "openid_example", // {String} \u5FAE\u4FE1openid.
'ip': "ip_example", // {String} \u7528\u6237IP\u5FAE\u4FE1\u652F\u4ED8\u65F6\u5FC5\u586B.
'returnUrl': "returnUrl_example" // {String} \u652F\u4ED8\u540C\u6B65\u901A\u77E5\u5730\u5740(\u901A\u77E5\u56DE\u8C03\u5730\u5740\u4E0D\u80FD\u643A\u5E26\u53C2\u6570).
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.onlinePaymentToPayPost(token, payChannel, payType, subject, payFee, notifyUrl, opts, callback);
Documentation for API Endpoints
All URIs are relative to http://115.159.113.37:15400/
Class | Method | HTTP request | Description |
---|---|---|---|
OnlinePaymentApi.ToPayApi | onlinePaymentToPayPost | POST /onlinePayment/toPay | \u8C03\u7528\u652F\u4ED8 |
OnlinePaymentApi.ToQueryApi | onlinePaymentToQueryPost | POST /onlinePayment/toQuery | \u67E5\u8BE2\u8BA2\u5355 |
OnlinePaymentApi.ToRfundApi | onlinePaymentToRefundPost | POST /onlinePayment/toRefund | \u8C03\u7528\u9000\u6B3E |
Documentation for Models
Documentation for Authorization
All endpoints do not require authorization.
8 years ago