swirepay_payment_api v1.4.0
swirepay_payment_api
SwirepayPaymentApi - JavaScript client for swirepay_payment_api
Swirepay REST APIs' are resource-oriented URLs that accept JSON-encoded request bodies, return JSON-encoded responses, and use standard HTTP response codes, authentication, and verbs. You can use the Swirepay API in test mode, which does not affect your live data or interact with the banking networks. The API key
you use to authenticate the request determines whether the request is live mode or test mode.
This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.4.0
- Package version: 1.4.0
- Build package: io.swagger.codegen.v3.generators.javascript.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 swirepay_payment_api --save
git
If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --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.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Getting Started
Please follow the installation instruction and execute the following JS code:
var SwirepayPaymentApi = require('swirepay_payment_api');
var defaultClient = SwirepayPaymentApi.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['x-api-key'] = "Token"
var api = new SwirepayPaymentApi.BalanceApi()
var xApiKey = "xApiKey_example"; // {String}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getBalance(xApiKey, callback);
Documentation for API Endpoints
All URIs are relative to https://api.swirepay.com/v1
Class | Method | HTTP request | Description |
---|---|---|---|
SwirepayPaymentApi.BalanceApi | getBalance | GET /balance | Get balance |
SwirepayPaymentApi.CategoryApi | getCategory | GET /category | Get category |
SwirepayPaymentApi.CountryApi | getCountry | GET /country | Get country |
SwirepayPaymentApi.CurrencyApi | getCurrency | GET /currency | Get currency |
SwirepayPaymentApi.CustomerApi | addCustomer | POST /customer | Add a customer |
SwirepayPaymentApi.CustomerApi | getCustomer | GET /customer | Get customers |
SwirepayPaymentApi.DisputeApi | getDispute | GET /dispute | Get dispute |
SwirepayPaymentApi.EventApi | getEvent | GET /event | Get event |
SwirepayPaymentApi.InvoiceApi | getInvoice | GET /invoice | Get invoice |
SwirepayPaymentApi.MembershipApi | getMembership | GET /membership | Get membership |
SwirepayPaymentApi.PaymentApi | getPayment | GET /payment | Get payment |
SwirepayPaymentApi.PaymentButtonApi | getPaymentButton | GET /payment-button | Get payment button |
SwirepayPaymentApi.PaymentLinkApi | getPaymentLink | GET /payment-link | Get payment link |
SwirepayPaymentApi.PaymentMethodApi | addPaymentMethod | POST /payment-method | Add a payment method |
SwirepayPaymentApi.PaymentMethodApi | getPaymentMethod | GET /payment-method | Get payment methods |
SwirepayPaymentApi.PaymentSessionApi | getPaymentSession | GET /payment-session | Get payment sessions |
SwirepayPaymentApi.PayoutApi | getPayout | GET /payout | Get payout |
SwirepayPaymentApi.PlanApi | getPlan | GET /plan | Get plan |
SwirepayPaymentApi.ProductApi | getProduct | GET /product | Get product |
SwirepayPaymentApi.PublicKeyApi | getPublicKey | GET /public-key | Get public key |
SwirepayPaymentApi.RefundApi | getRefund | GET /refund | Get refund |
SwirepayPaymentApi.ReminderApi | getReminder | GET /reminder | Get reminder |
SwirepayPaymentApi.ReportApi | getReport | GET /report | Get report |
SwirepayPaymentApi.SetupSessionApi | getSetupSession | GET /setup-session | Get setup session |
SwirepayPaymentApi.SetupSubscriptionApi | getSubscription | GET /subscription | Get subscription |
SwirepayPaymentApi.TerminalApi | getTerminal | GET /terminal | Get terminal |
SwirepayPaymentApi.TransactionApi | getTransaction | GET /transaction | Get transaction |
Documentation for Models
- SwirepayPaymentApi.Balance
- SwirepayPaymentApi.BalanceResponse
- SwirepayPaymentApi.BalanceResponseEntity
- SwirepayPaymentApi.CardRequest
- SwirepayPaymentApi.CategoryResponse
- SwirepayPaymentApi.CategoryResponseEntity
- SwirepayPaymentApi.CountryResponse
- SwirepayPaymentApi.CurrencyResponse
- SwirepayPaymentApi.CustomerRequest
- SwirepayPaymentApi.CustomerResponse
- SwirepayPaymentApi.DefaultResponse
- SwirepayPaymentApi.DisputeResponse
- SwirepayPaymentApi.EventResponse
- SwirepayPaymentApi.InvoiceResponse
- SwirepayPaymentApi.MembershipResponse
- SwirepayPaymentApi.PaymentButtonResponse
- SwirepayPaymentApi.PaymentLinkResponse
- SwirepayPaymentApi.PaymentMethodRequest
- SwirepayPaymentApi.PaymentMethodRequestCard
- SwirepayPaymentApi.PaymentMethodResponse
- SwirepayPaymentApi.PaymentResponse
- SwirepayPaymentApi.PaymentSessionResponse
- SwirepayPaymentApi.PayoutResponse
- SwirepayPaymentApi.PlanResponse
- SwirepayPaymentApi.ProductResponse
- SwirepayPaymentApi.PublicKeyResponse
- SwirepayPaymentApi.RefundResponse
- SwirepayPaymentApi.ReminderResponse
- SwirepayPaymentApi.ReportResponse
- SwirepayPaymentApi.SetupSessionResponse
- SwirepayPaymentApi.SubscriptionResponse
- SwirepayPaymentApi.TerminalResponse
- SwirepayPaymentApi.TransactionResponse
- SwirepayPaymentApi.UserResponse
Documentation for Authorization
api_key
- Type: API key
- API key parameter name: x-api-key
- Location: HTTP header