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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cinchpay/react-native-sdk

v1.2.0

Published

React Native SDK for CinchAPI - Payarc Integration

Readme

CinchAPI React Native SDK

A simple and clean React Native SDK for integrating with the CinchAPI payment processing platform.

Installation

npm install @cinchapi/react-native-sdk

Quick Start

import CinchAPI from '@cinchapi/react-native-sdk';

// Initialize the SDK (Recommended: Use dual keys for PCI compliance)
const cinchAPI = new CinchAPI({
  baseURL: 'https://your-api-domain.com',
  publicKey: 'cinch_pk_test_your_public_key',  // For tokenization
  secretKey: 'cinch_sk_test_your_secret_key',  // For other operations
  timeout: 30000
});

// Create a customer
const customer = await cinchAPI.createCustomer({
  email: '[email protected]',
  name: 'John Doe'
});

// PCI Compliant Tokenization (card data processed securely server-side)
const tokenizedCard = await cinchAPI.tokenizeCard({
  card_number: 4111111111111111,
  exp_month: '12',
  exp_year: '2025',
  cvv: '123'
});

// Create a charge
const charge = await cinchAPI.createCharge({
  amount: 1000, // $10.00 in cents
  currency: 'USD',
  source: tokenizedCard.token_id
});

API Methods

Customers

  • createCustomer(data: CustomerData): Promise<Customer>
  • getCustomer(customerId: string): Promise<Customer>
  • updateCustomer(customerId: string, data: UpdateCustomerData): Promise<Customer>

Payments

  • tokenizeCard(data: TokenizeCardData): Promise<TokenizedCard> (PCI Compliant - Recommended)
  • createCharge(data: ChargeData): Promise<Charge>
  • getCharge(chargeId: string): Promise<Charge>
  • capturePayment(data: { charge_id: string; amount?: number }): Promise<Charge>
  • voidCharge(chargeId: string, data: VoidChargeData): Promise<VoidedCharge>
  • cancelPayment(transactionId: string): Promise<any>
  • refundPayment(data: RefundData): Promise<any>

Bank Accounts

  • createBankAccount(data: BankAccountData): Promise<BankAccount>
  • getBankAccount(bankAccountId: string): Promise<BankAccount>
  • deleteBankAccount(bankAccountId: string): Promise<any>
  • createACHCharge(data: ACHChargeData): Promise<any>

Plans

  • createPlan(data: PlanData): Promise<Plan>
  • getPlan(planId: string): Promise<Plan>
  • updatePlan(planId: string, data: UpdatePlanData): Promise<Plan>
  • deletePlan(planId: string): Promise<any>
  • getPlans(params?: EventsQueryParams): Promise<{ plans: Plan[]; pagination: any }>

Subscriptions

  • createSubscription(data: SubscriptionData): Promise<Subscription>
  • getSubscription(subscriptionId: string): Promise<Subscription>
  • updateSubscription(subscriptionId: string, data: UpdateSubscriptionData): Promise<Subscription>
  • cancelSubscription(subscriptionId: string): Promise<Subscription>
  • getSubscriptions(params?: EventsQueryParams): Promise<{ subscriptions: Subscription[]; pagination: any }>

API Management

  • getApiKeys(): Promise<{ test: { public: string; secret: string }; live: { public: string; secret: string } }>
  • regenerateApiKey(environment: 'test' | 'live', keyType: 'public' | 'secret'): Promise<{ key: string }>
  • getMerchantInfo(): Promise<{ merchantId: string; businessName: string; email: string; environment: string; gateway: string }>

Events & Monitoring

  • getEvents(params?: EventsQueryParams): Promise<EventsResponse>

Response Codes

  • interpretResponseCode(code: string): Promise<InterpretedResponse>
  • getResponseCodeInfo(code: string): Promise<ResponseCodeInfo>
  • getAllResponseCodes(): Promise<ResponseCodeInfo[]>
  • getResponseCodesByCategory(category: string): Promise<ResponseCodeInfo[]>

Health Check

  • healthCheck(): Promise<any>

🛡️ PCI Compliance

The tokenizeCard() method provides PCI compliant tokenization through CinchAPI's secure servers. Card data is processed safely and only tokens are returned.

// ✅ PCI Compliant - Server-side tokenization
const token = await cinchAPI.tokenizeCard({
  card_number: 4111111111111111,
  exp_month: '12',
  exp_year: '2025',
  cvv: '123'
});

Security Features:

  • 🔒 Secure transmission through HTTPS/TLS
  • 🔒 No card data storage or logging
  • 🔒 Memory-only processing with automatic cleanup
  • 🔒 PCI compliant infrastructure

Always use public keys for tokenization operations:

const cinchAPI = new CinchAPI({
  publicKey: 'cinch_pk_test_...',  // ✅ Safe for client-side
  secretKey: 'cinch_sk_test_...'   // ✅ Keep server-side only
});

Error Handling

The SDK throws CinchAPIError for various error conditions:

try {
  const customer = await cinchAPI.createCustomer({
    email: '[email protected]'
  });
} catch (error) {
  if (error instanceof CinchAPIError) {
    console.error('API Error:', error.message);
    console.error('Status:', error.status);
    console.error('Customer Message:', error.customerMessage);
    console.error('Merchant Message:', error.merchantMessage);
  }
}

Types

All TypeScript types are exported from the SDK:

import {
  CinchAPIConfig,
  CustomerData,
  Customer,
  TokenizeCardData,
  TokenizedCard,
  ChargeData,
  Charge,
  PlanData,
  Plan,
  SubscriptionData,
  Subscription,
  CinchAPIError
} from '@cinchapi/react-native-sdk';

Examples

Creating a Subscription

// First create a plan
const plan = await cinchAPI.createPlan({
  amount: 2999, // $29.99
  plan_type: 'digital',
  name: 'Premium Plan',
  interval: 'month',
  statement_descriptor: 'PREMIUM PLAN'
});

// Then create a subscription
const subscription = await cinchAPI.createSubscription({
  customer_id: customer.id,
  plan_id: plan.plan_id
});

Processing a Payment

// Tokenize the card
const tokenizedCard = await cinchAPI.tokenizeCard({
  card_number: 4111111111111111,
  exp_month: '12',
  exp_year: '2025',
  cvv: '123',
  card_holder_name: 'John Doe'
});

// Create a charge
const charge = await cinchAPI.createCharge({
  amount: 2500, // $25.00
  currency: 'USD',
  token_id: tokenizedCard.token_id,
  statement_description: 'Purchase'
});

License

MIT