Giter VIP home page Giter VIP logo

cordova-plugin-sumup3's Introduction

cordova-plugin-sumup3

Cordova plugin for native acces to the SumUp payment system via the SumUp SDK v3.x

This plugin permits interconnection beetween native SumUp SDK and hybrid mobile apps (cordova/phonegap).

Platforms

  • iOS 9+
  • Android

Installation

$ cordova plugin add cordova-plugin-sumup3 --variable SUMUP_API_KEY=<YOUR_AFFILIATION_KEY>

You can add your affiliation key here: https://me.sumup.com/developers You have to add your cordova package ID in the 'Application identifiers'

API

The plugin exposes an interface object to cordova.SumUp for direct interaction with the SDK functions. See www/sumup.js for details about the available functions and their arguments. All API functions are asynchronous and return a Promise.

Usage Example

  // perform a (mandatory) merchant login
  cordova.Sumup.login()
    .then(function(res) {
      /*
      res: {
        currencyCode: {String},
        merchantCode: {String}
      }
      */
    }).catch(function(error) {
      // handle error
    });

  // initiate payment with a SumUp card reader
  cordova.Sumup.pay(amount, currency (e.g. 'EUR'), title, transactionId)
    .then(function(res) {
      /*
      res: {
          txcode: {String} // transaction code from sumup
          amount: {Number}  // result code from sumup, more info here : https://github.com/sumup/sumup-android-sdk#1-response-fields
          currency: {String} // message from sumup
          status: {String}
        }
      */
    }.catch(function(error) {
      // handle error
    });

License

MIT License

Credits

Inspired by https://github.com/Oupsla/cordova-sumup-plugin

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.