@plasma-platform/service-payment-gate
v3.0.1
Published
Payment gate service api
Downloads
22
Readme
Full documentation
install:npm i @plasma-platform/service-payment-gate -S
Short documentation
Table of Contents
PaymentClientService
Payment client Micro Service API SDK
Parameters
messages
Object with class service messages
Type: Object
createExtendedPayment
Create extended payment
Parameters
args
object (required) arguments for paymentsargs.currency
string? currency ISO-3 code (default: USD)args.locale
string? locale code, max length 2 (default en)args.cartId
string (required) cart idargs.project
string (required) project idargs.paymentMethodIds
array (required) payment method idsargs.savedPaymentMethodId
string Saved arguments for paymentsargs.email
string (required) user Emailargs.phone
string (required) user phone numberargs.bonuses
number Amount of bonuses to use for payment.args.trackingInfo
object tracking info for paymentargs.paymentOptions
object payment options
Examples
(async () => {
const paymentClientService = new PaymentClientService('https://jsonplaceholder.typicode.com/', 'dsugsahfdkljhafljkdfhajkldshfad');
const data = await paymentClientService.createExtendedPayment({
cartId: 111,
project:'monster',
paymentMethodIds: ['dsfsdhfi9i8304ufds'],
email: '[email protected]',
phone: '123456789',
});
})();
Returns object object with new cart properties
createPayment
Create payment
Parameters
args
object (required) arguments for paymentsargs.currency
string? currency ISO-3 code (default: USD)args.locale
string? locale code, max length 2 (default en)args.cartId
string (required) cart idargs.project
string (required) project idargs.paymentMethodIds
array (required) payment method idsargs.email
string (required) user Emailargs.phone
string (required) user phone numberargs.trackingInfo
object tracking info for paymentargs.paymentOptions
object payment options
Examples
(async () => {
const paymentClientService = new PaymentClientService('https://jsonplaceholder.typicode.com/', 'dsugsahfdkljhafljkdfhajkldshfad');
const data = await paymentClientService.createPayment({
cartId: 111,
project:'monster',
paymentMethodIds: ['dsfsdhfi9i8304ufds'],
email: '[email protected]',
phone: '123456789',
});
})();
Returns object object with new cart properties
retryPayment
Retry payment
Parameters
args
object (required) arguments for payments
Examples
(async () => {
const paymentClientService = new PaymentClientService('https://jsonplaceholder.typicode.com/', 'dsugsahfdkljhafljkdfhajkldshfad');
const data = await paymentClientService.retryPayment({
orderId: 111,
paymentMethodId: 'dsfsdhfi9i8304ufds',
});
})();
Returns object object with new payment url
getSavedPaymentMethodCount
Get saved payment method count
Parameters
email
string (required) client email
Examples
(async () => {
const paymentClientService = new PaymentClientService('https://jsonplaceholder.typicode.com/', 'dsugsahfdkljhafljkdfhajkldshfad');
const data = await paymentClientService.getSavedPaymentMethodCount('[email protected]');
})();
Returns number payment method count
getCommonPaymentMethodsProjects
Get common payment methods
Parameters
args
object (required) list of arguments for payment methods
Examples
(async () => {
const paymentClientService = new PaymentClientService('https://jsonplaceholder.typicode.com/', 'dsugsahfdkljhafljkdfhajkldshfad');
const data = await paymentClientService.getCommonPaymentMethodsProjects({project: 'monster'});
})();
Returns array payment method count
getCommonPaymentMethods
Get common payment methods
Parameters
args
object (required) list of arguments for payment methods
Examples
(async () => {
const paymentClientService = new PaymentClientService('https://jsonplaceholder.typicode.com/', 'dsugsahfdkljhafljkdfhajkldshfad');
const data = await paymentClientService.getCommonPaymentMethods({project: 'monster'});
})();
Returns array payment method count
getUserSavedPaymentMethods
Get user saved payment methods
Parameters
args
object (required) list of arguments for payment methods
Examples
(async () => {
const paymentClientService = new PaymentClientService('https://jsonplaceholder.typicode.com/', 'dsugsahfdkljhafljkdfhajkldshfad');
const data = await paymentClientService.getUserSavedPaymentMethods({project: 'monster', locale: 'en'});
})();
Returns array payment method count