SumUp
Plugin to communicate with a SumUp payment terminal
https://github.com/mariusbackes/cordova-plugin-sumup
Stuck on a Cordova issue?
If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.
Installation
- Capacitor
- Cordova
- Enterprise
$ npm install cordova-sumup-plugin
$ npm install @awesome-cordova-plugins/sum-up
$ ionic cap sync
$ ionic cordova plugin add cordova-sumup-plugin
$ npm install @awesome-cordova-plugins/sum-up
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Learn More or if you're interested in an enterprise version of this plugin Contact Us
Supported Platforms
- Android
- iOS
Usage
React
Learn more about using Ionic Native components in React
Angular
import { SumUp } from '@awesome-cordova-plugins/sum-up';
constructor(private sumUp: SumUp) { }
const sumUpKeys: SumUpKeys = new SumUpKeys();
sumUpKeys.affiliateKey = 'YOUR_API_KEY'; // if not provided in installation
sumUpKeys.accessToken = 'YOUR_ACCESS_TOKEN';
this.sumUp.login(sumUpKeys)
.then((res: SumUpResponse) => console.log(res))
.catch((error: SumUpResponse) => console.error(error));
this.sumUp.auth('YOUR_ACCESS_TOKEN')
.then((res: SumUpResponse) => console.log(res))
.catch((error: SumUpResponse) => console.error(error));
this.sumUp.getSettings()
.then((res: SumUpResponse) => console.log(res))
.catch((error: SumUpResponse) => console.error(error));
this.sumUp.logout()
.then((res: SumUpResponse) => console.log(res))
.catch((error: SumUpResponse) => console.error(error));
this.sumUp.isLoggedIn()
.then((res: SumUpLoginStatus) => console.log(res))
.catch((error: SumUpLoginStatus) => console.error(error));
this.sumUp.prepare()
.then((res: SumUpResponse) => console.log(res))
.catch((error: SumUpResponse) => console.error(error));
this.sumUp.closeConnection()
.then((res: SumUpResponse) => console.log(res))
.catch((error: SumUpResponse) => console.error(error));
this.sumUp.pay(10.0, 'EUR')
.then((res: SumUpPayment) => console.log(res))
.catch((error: SumUpPayment) => console.error(error));