New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cordova-paytm-allinonesdk

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-paytm-allinonesdk

A starting point for all in one sdk

1.2.1
latest
Source
npm
Version published
Maintainers
2
Created
Source

Paytm All-in-One SDK ionic cordova

Paytm All-in-One SDK provides a swift, secure and seamless payment experience to your users by invoking the Paytm app (if installed on your user’s smartphone) to complete payment for your order.

Paytm All-in-One SDK enables payment acceptance via Paytm wallet, Paytm Payments Bank, saved Debit/Credit cards, Net Banking, BHIM UPI and EMI as available in your customer’s Paytm account. If Paytm app is not installed on a customer's device, the transaction will be processed via web view within the All-in-One SDK.

This Cordova plugin helps you to be able to use the All-in-One SDK with your ionic application. This plugin supports both Android and iOS.

Installation:

Step 1: Add the plugin in your ionic application with the following command.

ionic cordova plugin add cordova-paytm-allinonesdk

It is also possible to install the plugin via repo url directly

ionic cordova plugin add https://github.com/paytm/paytm-allinonesdk-ionic-cordova.git

Step 2: Add an ionic wrapper for All In One SDK. npm install @ionic-native/all-in-one-sdk --save

For iOS:

Add iOS platform to you application.

ionic cordova platform add ios

This will create an iOS platform for your application at the following path: applicationName/platforms/ios/applicationName.xcworkspace

Make the following changes in your iOS project.

  • In case merchant don’t have callback URL, Add an entry into Info.plist LSApplicationQueriesSchemes(Array) Item 0 (String)-> paytm

info.plist

  • Add a URL Scheme “paytm”+”MID” urlScheme

Usage:

Add the plugin to your app's provider list

import { AllInOneSDK } from '@ionic-native/all-in-one-sdk/ngx'

@NgModule({
  declarations: [...],
  entryComponents: [...],
  imports: [...],
  providers: [..., AllInOneSDK],
  bootstrap: [...]
})
export class AppModule {}

In your page from where you want to invoke the All-in-One SDK, add the following code:

import { AllInOneSDK } from '@ionic-native/all-in-one-sdk/ngx'

constructor(private allInOneSDK : AllInOneSDK) {}
//Call Initiate Transaction API from your backend to generate Transaction Token.
let paymentIntent = { mid : "<Merchant ID>",
                      orderId: "<Order ID>",
                      txnToken: "<Transaction Token generated by Initiate Transaction API from your backend>",
                      amount: "<Amount>",
                      isStaging: "<Environment(true/false)>",
                      callbackUrl: "<Callback URL>",
                      restrictAppInvoke: "<Restrict(true/false)>" };

// OR
//let paymentIntent = { mid : "<Merchant ID>",
//                      orderId: "<Order ID>",
//                      txnToken: "<Transaction Token generated by Initiate Transaction API from your backend>",
//                      amount: "<Amount>",
//                      isStaging: "<Environment(true/false)>",
//                      callbackUrl: "<Callback URL>",
//                      restrictAppInvoke: "<Restrict(true/false)>"
//                      enableAssist : <Restrict(true/false)>};

this.allInOneSDK.startTransaction(paymentIntent).then(
resp => {
  // The response recieved after the transaction is completed will be an object containing `message` and `response`. You can parse both and use them as required in your application
  if(resp.response != '')alert(JSON.parse(resp.response));
  else alert(resp.message);
}).catch(error => {
  alert(error);
})

All-In-One API & SDK reference

https://developer.paytm.com/docs/all-in-one-sdk/

Keywords

ecosystem:cordova

FAQs

Package last updated on 30 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts