paytm-routersdk-react-native
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

paytm-routersdk-react-native

Paytm Router is an aggregator which connects with multiple payment aggregators to provide a single point of contact for routing payment traffic

Installation

npm install paytm-routersdk-react-native

Usage

    startTransaction(
        orderId: string,
        mid: string,
        txnToken: string,
        amount: string,
        callbackUrl: string,
        isStaging: boolean
    ): Promise<any>;

Contributing

Android

  1. Add the below line to the ‘repositories’ section of your project-level build.gradle file as below
allprojects {
    repositories {
        google()
        .
        .
        maven {
            url "https://artifactory.paytm.in/libs-release-local"
        }
    }
}

iOS

1: Open Podfile and Update Platform Version Navigate to the ios folder and open Podfile. You can do this using the following code. $ cd ios && open podfile.

2: Install Pods Using Cocoapods Install pods after updating iOS platform. : pod install && cd .. 3. Add the following in ios project. Open the projectName.workspace in ios folder. Open Info.plist : Add LSApplicationQueriesSchemes. Change its type to Array. Create a new item in it and set its value as "paytm"

Go to Info tab -> URL Types : Add a new URL Type that you’ll be using as the callback from Paytm App (URL Scheme: "paytm"+"MID"). Example: paytmMid123

Open AppDelegate.m: Add following method before the end of the file ended by @end Open AppDelegate.m and Import LinkingManager to the top of the file which has delegate methods for implementing and handling URLScheme(response from Paytm invoke will be received here in this method. Which in turns notifies the Plugin.)

#import <React/RCTLinkingManager.h>

  • (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {

    NSString *urlString = url.absoluteString; NSDictionary *userInfo = [NSDictionary dictionaryWithObject:urlString forKey:@"appInvokeNotificationKey"]; [[NSNotificationCenter defaultCenter] postNotificationName: @"appInvokeNotification" object:nil userInfo:userInfo]; return [RCTLinkingManager application:app openURL:url options:options]; }

For more details, please visit

https://business.paytm.com/docs/ai-router-overview

License

MIT

Package Sidebar

Install

npm i paytm-routersdk-react-native

Weekly Downloads

5

Version

1.0.2

License

MIT

Unpacked Size

1.33 MB

Total Files

58

Last publish

Collaborators

  • paytmsupport