GithubHelp home page GithubHelp logo

izettle-for-titanium's Introduction

iZettle library for Titanium

iZettle library for Titanium is a javascript module for Appcelerator Titanium. It allows to make card (VISA, Maestro,...) payments directly from your mobile device. Check how the whole system works on iZettle web page. It is very similar (same?) to Square but it works in Europe... well only in few EU countries (Sweden, Denmark, Finland, Norway, UK, Germany and Spain).

###Example Usage Check the example App to see it in action. It is ridiculously simple. You only need developer key from iZettle.

####Titanium code:

:::javascript
//initialize module
var iZettle = new (require('modules/izettle'))({
	sourceUrl : 'izettlepoc', //your app URL scheme
	apiKey : 'MY_SECRET_API_KEY', //your api key from iZettle
	quiet : false, //debuging on=false/off=true
});

//create some button
var pay = Ti.UI.createButton({
	title : 'Pay with iZettle'
});
//do some action...
pay.addEventListener('click', function() {
	//iZettle call application with payment options
	iZettle.payment({
		price : 100.34,//price
		title : 'Payment title',//description
		currency : 'EUR',
		reference : 'REFERENCE_STRING',
		success : function(m) {
			//success callback
			alert('SUCCESS: ' + JSON.stringify(m));
		},
		failure : function(m) {
			//failure callback :(
			alert('FAILURE: ' + JSON.stringify(m));
		}
	});
});

####Titanium demo: Demo App

###Testing I was unable to test payment proces with iZettle app. But according the documentation on their page iZettle app is using x-callback-url. So it was relatively easy to develop application even i didn't have access to their application.

To test callback from iZettle app i was using Safari browser. So here are the test link for Example App:

izettlepoc://iZettle/success?reference=YOUR_REFERENCE izettlepoc://iZettle/failure?reference=YOUR_REFERENCE&errorCode=TechnicalError izettlepoc://iZettle/failure?reference=YOUR_REFERENCE&errorCode=CancelledByUser izettlepoc://iZettle/failure?reference=YOUR_REFERENCE&errorCode=InvalidCurrency izettlepoc://iZettle/failure?reference=YOUR_REFERENCE&errorCode=InvalidState izettlepoc://iZettle/failure?reference=YOUR_REFERENCE&errorCode=MissingParameter

Just copy the links to Safari browser and press Go.

Demo App Safari testing

Of course in your application you will need to change URL scheme to your scheme.


###Disclaimer Unfortunately I was unable to test it on real application because iZettle is not available in my country (Slovakia) :( But it should work... if not please contact me and I will try to help.


##License All code is open source and dual licensed under GPL and MIT. Check the individual licenses for more information.

Author: Miroslav Magda Version: 0.1.0

izettle-for-titanium's People

Contributors

ejci avatar

Stargazers

Craig C avatar Mahmoud Kamal avatar Vinicius Oliveira avatar Zaher Ghaibeh avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.