MsbPayApi - JavaScript client for msb_pay_api
API specification for payment processing via the MySchoolBucks.com cart checkout.
<a href="MSBPayAPI-v2-changelog.txt">Changelog
This SDK is automatically generated by the Swagger Codegen project:
- API version: v2
- Package version: v2
- Build package: io.swagger.codegen.v3.generators.javascript.JavaScriptClientCodegen
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install msb_pay_api --save
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
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.
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
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var MsbPayApi = require('msb_pay_api');
var api = new MsbPayApi.CartApi()
var authorization = "authorization_example"; // {String} Login details to authenticate call.
var cartId = "cartId_example"; // {String} Cart identifier assigned by MySchoolBucks.
var opts = {
'body': null // {Object} Item ID must be fewer than or equal to 60 characters, and may contain only letters, numbers, underscores, dashes, periods, or at signs.<br /> Item name must be fewer than or equal to 80 characters.<br /> Unit price must be a positive number.<br /> Quantity must be greater than 0.<br /><br /> OPTIONAL FIELDS<br /> Student name must fewer than or equal to 60 characters.<br /> Reference must be fewer than or equal to 80 characters.<br /> Property names must not be empty or null.<br /> Property Display Response must be "visible", "hidden", or null/empty.<br /> Redirect URL and Return to Site URL must be fewer than or equal to 1900 characters.<br />
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.cartsCartIdAddItemsPost(authorization, cartId, opts, callback);
All URIs are relative to https://schoolbucks.msb-lab.com/msbpay/v2
Class | Method | HTTP request | Description |
---|---|---|---|
MsbPayApi.CartApi | cartsCartIdAddItemsPost | POST /carts/{cartId}/addItems | Create cart item |
MsbPayApi.CartApi | cartsCartIdDelete | DELETE /carts/{cartId} | Delete cart |
MsbPayApi.CartApi | cartsCartIdGet | GET /carts/{cartId} | Get cart by ID |
MsbPayApi.CartApi | cartsCartIdProcessPost | POST /carts/{cartId}/process | Process cart |
MsbPayApi.CartApi | cartsCartIdPut | PUT /carts/{cartId} | Update cart |
MsbPayApi.CartApi | cartsGet | GET /carts | Read carts for developer key |
MsbPayApi.CartApi | cartsPost | POST /carts | Create cart |
MsbPayApi.DepartmentsApi | clientsClientIdDepartmentsGet | GET /clients/{clientId}/departments | Get department IDs |
MsbPayApi.GLAccountsApi | clientsClientIdGlAccountsGet | GET /clients/{clientId}/glAccounts | Get G/L account IDs |
MsbPayApi.PaymentApi | cartsCartIdOrdersGet | GET /carts/{cartId}/orders | Get orders for cart |
MsbPayApi.PaymentApi | cartsCartIdPaymentsGet | GET /carts/{cartId}/payments | Get payments for cart |
MsbPayApi.PaymentMethodsApi | clientsClientIdPaymentMethodsGet | GET /clients/{clientId}/paymentMethods | Get payment methods |
MsbPayApi.ReconciliationApi | clientsClientIdPaymentsGet | GET /clients/{clientId}/payments | Get payments for client |
MsbPayApi.ReconciliationApi | clientsClientIdPaymentsPaymentIdConfirmtransferPost | POST /clients/{clientId}/payments/{paymentId}/confirmtransfer | Confirm payment |
MsbPayApi.RefundApi | cartsCartIdPaymentsPaymentIdRefundPost | POST /carts/{cartId}/payments/{paymentId}/refund | Refund payment |
MsbPayApi.StoresApi | clientsClientIdStoresGet | GET /clients/{clientId}/stores | Get store IDs |
MsbPayApi.UtilityApi | rootGet | GET / | System details |
MsbPayApi.UtilityApi | testExceptionsGet | GET /testExceptions | Developer tool to test responses from exceptions. |
MsbPayApi.UtilityApi | whoAmIGet | GET /whoAmI | Account details |
- MsbPayApi.Cart
- MsbPayApi.CartItem
- MsbPayApi.CartOrder
- MsbPayApi.CartOrderItem
- MsbPayApi.CartPayment
- MsbPayApi.CartPaymentItem
- MsbPayApi.CartRefundItem
- MsbPayApi.CartStatus
- MsbPayApi.ClientProperty
- MsbPayApi.InlineResponse200
- MsbPayApi.InlineResponse2001
- MsbPayApi.InlineResponse20010
- MsbPayApi.InlineResponse20011
- MsbPayApi.InlineResponse2002
- MsbPayApi.InlineResponse2003
- MsbPayApi.InlineResponse2004
- MsbPayApi.InlineResponse2005
- MsbPayApi.InlineResponse2006
- MsbPayApi.InlineResponse2007
- MsbPayApi.InlineResponse2008
- MsbPayApi.InlineResponse2009
- MsbPayApi.InlineResponse201
- MsbPayApi.ItemProperty
- MsbPayApi.ListPaging
- MsbPayApi.MsbPayResponse
- MsbPayApi.MsbPayResult
- MsbPayApi.MsbPayUser
- MsbPayApi.MsbPayUserClient
- MsbPayApi.OrderStatus
- MsbPayApi.PayApiEventType
- MsbPayApi.PaymentTxnType
- MsbPayApi.PaymentType
- MsbPayApi.WebhookSubscription
All endpoints do not require authorization.