by Piotr Ilski | v1.2.0
NativeScript implementation of Stripe's iOS SDK - 11.3.0
npm i --save nativescript-stripe-sdk
  • Version: 1.2.0
  • GitHub:
  • Downloads:
    • Last Day:   0
    • Last Week:  1
    • Last Month: 60

NativeScript Stripe-SDK

This repo is based on @Osei Fortune's nativescript-stripe. Perfect job, Sir!

IMPORTANT: Highly recomend using @Osei Fortune's nativescript-stripe

The purpose of this plugin is to add some specific functionalities required by the app I work on. I have also wanted to use official nativescript-plugin-seed

Implemented for iOS only - this plugin uses 11.3 Stripe's SDK.


tns plugin add nativescript-stripe-sdk

Usage in Android

Set API key

Add this to the main *.module.ts file (app.module.ts)

import * as application from 'tns-core-modules/application';
import * as platform from 'tns-core-modules/platform';

const stripeSdk = require('nativescript-stripe-sdk');

application.on(application.launchEvent, () => {
if (platform.isIOS) {

Usage in UI



Example paymentCardTextFieldDidChange handler

import { StripeSdk } from 'nativescript-stripe-sdk';


onPaymentCardTextFieldDidChange(payload) {
const isValid = StripeSdk.validateCard(payload.cardParams);

if (isValid) {
.then(token => {
console.log('Created token: ', token.toString());
.catch((error: Error) => {
console.error('Create token error: ', error);

Usage in vanilla NS

IMPORTANT: SDK API key needs to be set on app startup

import { StripeSdk } from 'nativescript-stripe-sdk';

application.on(application.launchEvent, () => {
if (platform.isIOS) {

Usage in UI

expDate="{{ date }}"
number="{{ number }}"
cvc="{{ cvc }}"/>
paymentCardTextFieldDidChange="{{ callbackFn }}"/>

Check if given CC is valid (card of STPCardParams type)

import { StripeSdk } from 'nativescript-stripe-sdk';

const isValid = StripeSdk.validateCard(card);

Generate stripe token

IMPORTANT: valid stripe API key needs to be set on app startup

import { StripeSdk } from 'nativescript-stripe-sdk';

.then(token => { console.log(token); })
.catch(error => { console.error(error); });



Property Default Description
expDate not set CC expiration date - typeof Date
number not set CC number - typeof string
cvc not set CC expiration date - typeof string

Running the demo app

git clone
cd src/
npm run setup
npm run demo.ios

Running angular demo

git clone
cd src/
npm run setup
npm run demo.angular.ios


Apache License Version 2.0, January 2004