Code Monkey home page Code Monkey logo

nativescript-izettle's Introduction

NativeScript iZettle plugin

Accept payments directly in your NativeScript app with iZettle.

Supported platforms

Features

  • Fully integrated payment flow (no app-to-app switching, no installed iZettle app required).
  • Extremely simple API - just pass in an amount and you're done.
  • After a payment completes you'll get info on the payment type and status so your app can respond appropriately.

API

Creating a payment

You can use the plugin with JavaScript or TypeScript. In case of the latter, the relevant code is:

  new IZettle().pay({
    apiKey: "your-iZettle-API-key",
    amount: 100, // 100 USD/EUR/.., depends on the configuration of your iZettle account
    currency: "EUR", // optionally set a currency. If set, it must match you iZettle account's currency, or you'll get an error.
    reference: "your optional app payment reference",
    enforcedUserAccount: "[email protected]", // optionally lock login to a certain account (readonly if set)
  }).then((result: IZettlePaymentResult) => {
    // Payment succeeded, the result object contains:
    // 'entryMode', 'referenceNumber', 'obfuscatedPan', 'cardBrand', 'authorizationCode', 'applicationName'.

  }, (error: IZettleError) => {
    // No need to show the error to the user as that has already been done by the iZettle UI,
    // but the error object contains a 'message' and 'code' anyway.
  });

Launch iZettle Settings

You can launch the iZettle settings screens from within your app, which is pretty fancy IMO.

  new IZettle().launchSettings({
    apiKey: "your-iZettle-API-key"
  }).then(() => {
    // Settings launched successfully
  });

Want to use this plugin?

For various reasons the plugin code is not out there in the wild, so if you want to use this plugin, please contact me at eddyverbruggen at gmail dot com.

nativescript-izettle's People

Contributors

eddyverbruggen avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.