RavindraChherke / Stripe-module-for-Appcelerator-Titanium-iOS-and-Android

Titanium (iOS, Android) module for Stripe payment
27 stars 17 forks source link

Stripe module for Appcelerator Titanium iOS and Android

Version 3

Check releases

iOS Module Documentation for version 3

Stripe Documentation

Version 1

Check releases

Example

//require the module
var stripe = require('com.ravindra.stripe');

//set card information using setCard method

var value = stripe.setCard({
    publishableKey : "pk_test_6pRNASCoBOKtIshFeQd4XMUh",
    cardNumber:"4242424242424242",
    month : 12,
    expiryYear : 2019,
    cvc : "123"
});

//request for token from stripe 
stripe.requestForToken({
    success : success,
    failure : failure
});

//On successful receive of token
function success(e) {
    alert("Toke received from Stripe: " + e.token);
}

//On failure 
function failure(e) {
    alert("Error: " + e.error);
}