npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@plasma-platform/tm-service-payment-gate

v2.1.9

Published

Scaffolder to start new service api

Downloads

10

Readme

Documentation

PaymentClientService

Extends TMMicroServiceAPI

Payment client Micro Service API SDK

Parameters

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

messages

Object with class service messages

constructor

Constructor of instance

Parameters

  • props ...any
  • url string (required) url to service
  • token string? user token

Examples

(async () => {
  const paymentClientService = new CartsService('https://jsonplaceholder.typicode.com/', 'dsugsahfdkljhafljkdfhajkldshfad');
})();

Returns object service SDK 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

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 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

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
    • 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('[email protected]');
})();

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