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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@deliverart/sdk-js-payment

v2.5.8

Published

Deliverart JavaScript SDK for Payment Management

Downloads

4,517

Readme

@deliverart/sdk-js-payment

Payment management package for the DeliverArt JavaScript SDK.

Installation

npm install @deliverart/sdk-js-payment @deliverart/sdk-js-core

Exported Types

Core Types

  • Payment - Payment information
  • PaymentDetails - Extended payment with order details
  • PaymentConfig - Payment configuration for point of sale
  • PaymentMethod - Payment method type
  • PaymentStatus - Payment status

Payment Method Types

type PaymentMethod = 
  | 'CASH'
  | 'CREDIT_CARD'
  | 'DEBIT_CARD'
  | 'STRIPE'
  | 'PAYPAL'
  | 'SATISPAY'
  | 'ONLINE'
  | 'POS'

Payment Status Types

type PaymentStatus = 
  | 'PENDING'
  | 'PROCESSING'
  | 'COMPLETED'
  | 'FAILED'
  | 'REFUNDED'
  | 'CANCELLED'

IRI Types

  • PaymentIri - Payment IRI (/payments/:id)
  • PaymentConfigIri - Payment config IRI (/payment_configs/:id)

Available Requests

Payments

CreatePayment

import { CreatePayment } from '@deliverart/sdk-js-payment';

const payment = await sdk.call(new CreatePayment({
  order: '/orders/123',
  method: 'CREDIT_CARD',
  amount: 2500, // In cents
  status: 'PENDING'
}));

Input Parameters:

  • order: string (required) - Order IRI
  • method: PaymentMethod (required) - Payment method
  • amount: number (required) - Amount in cents
  • status?: PaymentStatus (optional) - Initial status (default: 'PENDING')
  • transactionId?: string (optional) - External transaction ID
  • metadata?: object (optional) - Additional metadata

GetPayments

import { GetPayments } from '@deliverart/sdk-js-payment';

const payments = await sdk.call(new GetPayments({
  query: {
    order: '/orders/123',
    method: 'CREDIT_CARD',
    'status[]': ['COMPLETED', 'PENDING'],
    page: 1
  }
}));

Query Parameters:

  • order?: string - Filter by order
  • method?: PaymentMethod - Filter by payment method
  • status[]?: PaymentStatus[] - Filter by statuses
  • createdAt[before]?: string - Created before date
  • createdAt[after]?: string - Created after date
  • page?: number - Page number

GetPaymentDetails

import { GetPaymentDetails } from '@deliverart/sdk-js-payment';

const payment = await sdk.call(new GetPaymentDetails('payment-123'));

UpdatePayment

import { UpdatePayment } from '@deliverart/sdk-js-payment';

const updated = await sdk.call(new UpdatePayment('payment-123', {
  status: 'COMPLETED',
  transactionId: 'txn_abc123'
}));

Payment Configurations

CreatePaymentConfig

import { CreatePaymentConfig } from '@deliverart/sdk-js-payment';

const config = await sdk.call(new CreatePaymentConfig({
  pointOfSale: '/point_of_sales/123',
  method: 'STRIPE',
  enabled: true,
  config: {
    publicKey: 'pk_test_...',
    secretKey: 'sk_test_...'
  }
}));

Input Parameters:

  • pointOfSale: string (required) - Point of sale IRI
  • method: PaymentMethod (required) - Payment method
  • enabled: boolean (required) - Enable/disable payment method
  • config: object (required) - Method-specific configuration

GetPaymentConfigs

import { GetPaymentConfigs } from '@deliverart/sdk-js-payment';

const configs = await sdk.call(new GetPaymentConfigs({
  query: {
    pointOfSale: '/point_of_sales/123',
    enabled: true
  }
}));

UpdatePaymentConfig

import { UpdatePaymentConfig } from '@deliverart/sdk-js-payment';

const updated = await sdk.call(new UpdatePaymentConfig('config-123', {
  enabled: false
}));

Complete Usage Example

import { sdk } from './lib/sdk';
import {
  CreatePaymentConfig,
  CreatePayment,
  UpdatePayment,
  GetPayments
} from '@deliverart/sdk-js-payment';

async function paymentWorkflow() {
  // Setup payment methods for point of sale
  await sdk.call(new CreatePaymentConfig({
    pointOfSale: '/point_of_sales/123',
    method: 'STRIPE',
    enabled: true,
    config: {
      publicKey: process.env.STRIPE_PUBLIC_KEY,
      secretKey: process.env.STRIPE_SECRET_KEY
    }
  }));

  // Create payment for order
  const payment = await sdk.call(new CreatePayment({
    order: '/orders/456',
    method: 'CREDIT_CARD',
    amount: 2500,
    status: 'PENDING'
  }));

  // Process payment (integrate with payment gateway)
  // ... payment processing logic ...

  // Update payment status
  await sdk.call(new UpdatePayment(payment.id, {
    status: 'COMPLETED',
    transactionId: 'txn_abc123'
  }));

  // Get all completed payments
  const completed = await sdk.call(new GetPayments({
    query: {
      'status[]': ['COMPLETED'],
      'order[createdAt]': 'desc'
    }
  }));

  console.log(`Total completed: ${completed.pagination.totalItems}`);
}

License

MIT