HussainLatiff's picture
Added node.js AI Mastering module (#21)
0e27770 verified
|
raw
history blame
5.92 kB

Aimastering.PaymentApi

All URIs are relative to https://api.bakuage.com:443

Method HTTP request Description
createPayment POST /payments Create a new payment.
executePayment PUT /payments/{id}/execute Execute a payment by id.
getPayment GET /payments/{id} Get a payment by id.
listPayments GET /payments Get all accessable payments.

createPayment

Payment createPayment(productToken, service, opts)

Create a new payment.

Example

var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;

// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';

var apiInstance = new Aimastering.PaymentApi();

var productToken = "productToken_example"; // String | This parameter represents the product token.

var service = "service_example"; // String | This parameter represents the payment message.

var opts = { 
  'token': "token_example" // String | This parameter represents the card token. This parameter is effective only when the service is \"stripe\".
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createPayment(productToken, service, opts, callback);

Parameters

Name Type Description Notes
productToken String This parameter represents the product token.
service String This parameter represents the payment message.
token String This parameter represents the card token. This parameter is effective only when the service is "stripe". [optional]

Return type

Payment

Authorization

bearer

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

executePayment

Payment executePayment(id, payerId)

Execute a payment by id.

Example

var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;

// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';

var apiInstance = new Aimastering.PaymentApi();

var id = 56; // Number | Payment id

var payerId = "payerId_example"; // String | This parameter represents the card token. This parameter is effective only when the service is \"paypal\".


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.executePayment(id, payerId, callback);

Parameters

Name Type Description Notes
id Number Payment id
payerId String This parameter represents the card token. This parameter is effective only when the service is "paypal".

Return type

Payment

Authorization

bearer

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

getPayment

Payment getPayment(id, )

Get a payment by id.

Example

var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;

// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';

var apiInstance = new Aimastering.PaymentApi();

var id = 56; // Number | Payment id


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getPayment(id, , callback);

Parameters

Name Type Description Notes
id Number Payment id

Return type

Payment

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listPayments

[Payment] listPayments()

Get all accessable payments.

Example

var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;

// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';

var apiInstance = new Aimastering.PaymentApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listPayments(callback);

Parameters

This endpoint does not need any parameter.

Return type

[Payment]

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json