cordova-plugin-tci-sdk

1.1.4 • Public • Published

TCI (Telecommunication Ministry of Iran - tci.ir) Payment SDK Plugin for Android

TCI Payment SDK Plugin for Cordova 3.0+ Android

This plugin in based on documentation from http://my.tci.ir/Admin.html#!/admin/documents

there is an implementation of .aar module of TCI SDK for Cordova projects

Installation

For Cordova CLI - cordova plugin add cordova-plugin-tci-sdk --save

Usage (in javascript anywhere in your project)

  • TciSdk.Buy("appName", "itemName", successCallback, errorCallback, "customPrice"); // customPrice is optional

the success callback and error callback have an data attribute that is a json object returned from the SDK. the sample code maybe like this:

TciSdk.Buy("appName", "itemName", function(data) {
    // Optional: implement some api check purchase at http://my.tci.ir/api/v1/IAP/Consume/{data.token}
    alert("Success: Your purchase token is: " + data.token + ", and your RRN code is: " + data.RRN);
}, function(data) {
     if (data.RRN) {
         alert("Error: you didn't complete the payment, your RRN code is: " + data.RRN);
     } else {
         alert("Error: you didn't complete the payment");
     }
 });

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.44latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.44
1.1.31
1.1.21
1.1.11
1.1.01
1.0.21
1.0.11
1.0.01

Package Sidebar

Install

npm i cordova-plugin-tci-sdk

Weekly Downloads

11

Version

1.1.4

License

Apache 2.0

Last publish

Collaborators

  • ivir3zam