Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@plasma-platform/service-payment-gate

Package Overview
Dependencies
Maintainers
5
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plasma-platform/service-payment-gate

Payment gate service api

  • 3.0.0
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-66.67%
Maintainers
5
Weekly downloads
 
Created
Source

version nextVersion downloads license dependency


Full documentation
install:
npm i @plasma-platform/service-payment-gate -S

Short documentation

Table of Contents

PaymentClientService

Payment client Micro Service API SDK

Parameters

  • url string service url
  • token (string | null) user access token if available (optional, default null)

messages

Object with class service messages

Type: Object

createExtendedPayment

Create extended payment

Parameters
  • args object (required) arguments for payments
    • args.currency string? currency ISO-3 code (default: USD)
    • args.locale string? locale code, max length 2 (default en)
    • args.cartId string (required) cart id
    • args.project string (required) project id
    • args.paymentMethodIds array (required) payment method ids
    • args.savedPaymentMethodId string Saved arguments for payments
    • args.email string (required) user Email
    • args.phone string (required) user phone number
    • args.bonuses number Amount of bonuses to use for payment.
    • args.trackingInfo object tracking info for payment
    • args.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: 'user@mail.com',
    phone: '123456789',
  });
})();

Returns object object with new cart properties

createPayment

Create payment

Parameters
  • args object (required) arguments for payments
    • args.currency string? currency ISO-3 code (default: USD)
    • args.locale string? locale code, max length 2 (default en)
    • args.cartId string (required) cart id
    • args.project string (required) project id
    • args.paymentMethodIds array (required) payment method ids
    • args.email string (required) user Email
    • args.phone string (required) user phone number
    • args.trackingInfo object tracking info for payment
    • args.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: 'user@mail.com',
    phone: '123456789',
  });
})();

Returns object object with new cart properties

retryPayment

Retry payment

Parameters
  • args object (required) arguments for payments
    • args.orderId string (required) cart id
    • args.paymentMethodId string (required) payment method id
    • args.trackingInfo object tracking info for payment
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('user@mail.com');
})();

Returns number payment method count

getCommonPaymentMethods

Get common payment methods

Parameters
  • args object (required) list of arguments for payment methods
    • args.project string (required) project name
    • args.countryCode string country code max length 2 (default us)
    • args.locale string locale code, max length 2 (default en)
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
    • args.project string (required) project name
    • args.locale string locale code, max length 2 (default en)
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

Keywords

FAQs

Package last updated on 06 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc