@commercetools/checkout-payments-core
v0.0.7
Published
Checkout payments SDK shared library
Readme
Checkout Payments – Shared Types and Utilities
This SDK is a shared library containing common types and utilities used across all commercetools Checkout Payments SDK packages. Use this package when you need payment method type definitions or shared interfaces in your payment connector or enabler.
Installation
# Using pnpm
pnpm add @commercetools/checkout-payments-core
# Using npm
npm install @commercetools/checkout-payments-core
# Using yarn
yarn add @commercetools/checkout-payments-coreWhat's included
- Payment method types – Union type of supported payment method identifiers (e.g.
card,paypal,applepay,ideal,klarna_pay_later, etc.) - Shared type definitions – Used by the enabler SDK and processor SDK for consistency
Example usage
import { PaymentMethodType } from '@commercetools/checkout-payments-core';
// Use the type for payment method handling
const supportedMethods: PaymentMethodType[] = ['card', 'paypal', 'applepay'];
function isSupported(type: string): type is PaymentMethodType {
return supportedMethods.includes(type as PaymentMethodType);
}For full documentation and architecture, see the root README of the checkout-sdks monorepo.
Authors
This library is created by Commercetools and the commercetools Checkout team.
