@types/react-native-razorpay
TypeScript icon, indicating that this package has built-in type declarations

2.2.6 • Public • Published

Installation

npm install --save @types/react-native-razorpay

Summary

This package contains type definitions for react-native-razorpay (https://www.npmjs.com/package/react-native-razorpay).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-native-razorpay.

export interface SuccessResponse {
    razorpay_signature: string;
    razorpay_order_id: string;
    razorpay_payment_id: string;
}

// type valid for errors after successful API integration
export interface ErrorResponse {
    code: number;
    description: string;
    error: {
        field?: string;
        source: string;
        step: string;
        reason: string;
        metadata: {
            payment_id?: string;
            order_id: string;
        };
    };
}

export interface CheckoutOptions {
    key: string;
    amount: number;
    currency: string;
    name: string;
    description: string;
    image?: string;
    order_id: string;
    prefill?: {
        name?: string;
        email?: string;
        contact?: string;
        method?: "card" | "netbanking" | "wallet" | "emi" | "upi";
    };
    notes?: Record<string | number, string>;
    theme?: {
        hide_topbar?: boolean;
        color?: string;
        backdrop_color?: string;
    };
    modal?: {
        backdropclose?: boolean;
        escape?: boolean;
        handleback?: boolean;
        confirm_close?: boolean;
        ondismiss?: () => void;
        animation?: boolean;
    };
    subscription_id?: string;
    subscription_card_change?: boolean;
    recurring?: boolean;
    callback_url?: string;
    redirect?: boolean;
    customer_id?: string;
    timeout?: number;
    remember_customer?: boolean;
    readonly?: {
        contact?: boolean;
        email?: boolean;
        name?: boolean;
    };
    hidden?: {
        contact?: boolean;
        email?: boolean;
    };
    send_sms_hash?: boolean;
    allow_rotation?: boolean;
    retry?: {
        enabled: boolean;
        max_count: number;
    };
    config?: {
        display: {
            language: "en" | "ben" | "hi" | "mar" | "guj" | "tam" | "tel";
        };
    };
}

declare const RazorpayCheckout: {
    open: (
        options: CheckoutOptions,
        successCallback?: (data: SuccessResponse) => void,
        errorCallback?: (data: ErrorResponse) => void,
    ) => Promise<SuccessResponse>;
    onExternalWalletSelection: (externalWalletCallback: (data: unknown) => void) => void;
};

export default RazorpayCheckout;

Additional Details

  • Last updated: Thu, 03 Oct 2024 22:37:43 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Ankan Bhattacharya.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-native-razorpay

Weekly Downloads

2,638

Version

2.2.6

License

MIT

Unpacked Size

7.14 kB

Total Files

5

Last publish

Collaborators

  • types