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

@abdelrahman.rabie/payment-sdk-react-native

v1.0.0

Published

React Native SDK for payment processing with E_API and E_LINKS support

Readme

Payment SDK React Native

A comprehensive React Native SDK for payment processing with E_API and E_LINKS support, including Apple Pay and Google Pay integration.

Features

  • 🚀 Easy integration with React Native apps
  • 💳 Support for multiple payment methods (Visa, Mastercard, Apple Pay, Google Pay, KNET)
  • 🔄 E_API and E_LINKS payment products
  • 🍎 Apple Pay merchant validation
  • 🎣 React hooks for seamless state management
  • 📱 TypeScript support with full type definitions
  • 🌍 Multi-language support (Arabic/English)

Installation

npm install @abdelrahman.rabie/payment-sdk-react-native
# or
yarn add @abdelrahman.rabie/payment-sdk-react-native

For iOS projects using CocoaPods:

```bash
cd ios && pod install

Quick Start

1. Initialize the SDK

import { PaymentSDK } from "payment-sdk-react-native";

const sdk = new PaymentSDK({
  baseURL: "https://your-payment-api.com",
  paymentPageApiToken: "your-api-token",
  paymentCoreURL: "https://your-payment-core-api.com", // optional
});

2. Using React Hooks

import React from "react";
import { View, Button, Text } from "react-native";
import {
  usePayment,
  EPaymentProduct,
  EPaymentMethods,
  ELanguages,
} from "payment-sdk-react-native";

const PaymentScreen = () => {
  const { loading, error, paymentInfo, executePayment, initializePayment } =
    usePayment({ sdk });

  const handleInitialize = async () => {
    await initializePayment(EPaymentProduct.E_API, "your-payment-token");
  };

  const handlePayment = async () => {
    await executePayment(EPaymentProduct.E_API, "your-payment-token", {
      paymentMethod: EPaymentMethods.VISA,
      language: ELanguages.EN,
    });
  };

  return (
    <View>
      <Button title="Initialize Payment" onPress={handleInitialize} />
      <Button
        title="Pay with Visa"
        onPress={handlePayment}
        disabled={loading}
      />
      {error && <Text style={{ color: "red" }}>{error}</Text>}
      {paymentInfo && <Text>Amount: {paymentInfo.data.amount.value}</Text>}
    </View>
  );
};

3. Apple Pay Integration

import { useApplePay } from "payment-sdk-react-native";

const ApplePayComponent = () => {
  const { loading, error, validateMerchant } = useApplePay({ sdk });

  const handleApplePayValidation = async (validationURL: string) => {
    await validateMerchant(validationURL);
  };

  // Use with Apple Pay button implementation
};

API Reference

PaymentSDK

Main SDK class for payment operations.

Methods

  • initializePayment(product, paymentToken) - Get payment information
  • executePayment(product, paymentToken, payload) - Process payment
  • getPaymentStatus(product, paymentToken) - Get payment status
  • validateApplePayMerchant(validationURL) - Validate Apple Pay merchant

Hooks

usePayment

React hook for payment operations.

Returns:

  • loading - Loading state
  • error - Error message
  • paymentInfo - Payment information
  • paymentResult - Payment result
  • initializePayment() - Initialize payment function
  • executePayment() - Execute payment function
  • getPaymentStatus() - Get status function

useApplePay

React hook for Apple Pay operations.

Returns:

  • loading - Loading state
  • error - Error message
  • applePaySession - Apple Pay session data
  • validateMerchant() - Validate merchant function

Payment Products

  • EPaymentProduct.E_API - API-based payments
  • EPaymentProduct.E_LINKS - Link-based payments

Payment Methods

  • EPaymentMethods.VISA
  • EPaymentMethods.MASTERCARD
  • EPaymentMethods.APPLE_PAY
  • EPaymentMethods.GOOGLE_PAY
  • EPaymentMethods.KNET
  • And more...

Error Handling

The SDK provides comprehensive error handling:

try {
  const result = await sdk.executePayment(product, token, payload);
  if (result.success) {
    // Payment successful
    console.log("Payment completed:", result.data);
  } else {
    // Payment failed
    console.error("Payment failed:", result.error);
  }
} catch (error) {
  console.error("SDK error:", error.message);
}

TypeScript Support

The SDK is fully typed with TypeScript. All interfaces and types are exported for use in your application.

License

MIT

New SDK Package Structure

payment-sdk-react-native/ ├── src/ │ ├── core/PaymentSDK.ts # Main SDK class │ ├── services/ │ │ ├── httpClient.ts # HTTP client for API calls │ │ └── paymentService.ts # Payment logic extracted from your app │ ├── hooks/ │ │ ├── usePayment.ts # React hook for payments │ │ └── useApplePay.ts # React hook for Apple Pay │ ├── types/payment.types.ts # All TypeScript interfaces │ ├── constants/endpoints.ts # API endpoints and regex │ └── index.ts # Main exports ├── example/App.tsx # Complete usage example ├── package.json # NPM package config ├── tsconfig.json # TypeScript config └── README.md # Documentation