Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rbedemann/capacitor-sumup-plugin
https://github.com/rbedemann/capacitor-sumup-plugin
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rbedemann/capacitor-sumup-plugin
- Owner: rbedemann
- License: mit
- Created: 2020-11-19T17:58:36.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-10T06:54:15.000Z (about 2 years ago)
- Last Synced: 2024-08-04T00:06:18.249Z (5 months ago)
- Language: Kotlin
- Size: 118 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-capacitor - Sumup - SumUp Mobile SDK. (Other plugins)
README
SumUp
@capacitor-community/sumup
Plugin for SumUp Mobile SDK.## Maintainers
| Maintainer | GitHub | Social |
| -----------| -------| -------|
| Robin Bedemann | [rbedemann](https://github.com/rbedemann) | |## Installation
### Web application
1. Add plugin to your dependencies
with yarn
```shell script
yarn add @capacitor-community/sumup
```
or
npm
```shell script
npm i -S @capacitor-community/sumup
```2. Import Plugin in your code
```typescript
import { Plugins } from '@capacitor/core';
const { SumUp } = Plugins;
```### Android
1. Setup SumUp Maven repository
In `app/build.gradle` add following lines:
```groovy
allprojects {
repositories {
maven { url 'https://maven.sumup.com/releases' }
}
}
```2. Add Plugin to your app's MainActivity
In Java:
```java
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initializes the Bridge
this.init(savedInstanceState, new ArrayList>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(SumUp.class);
}});
}
}
```
Or Kotlin:
```kotlin
class MainActivity : BridgeActivity() {
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Initializes the Bridge
this.init(savedInstanceState, object : ArrayList?>() {
init {
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(SumUp::class.java)
}
})
}
}
```## Usage
1. Login
```typescript
SumUp.login({
affiliateKey: "<< YOUR AFFILIATE KEY >>",
// optional: Login Screen will be shown every time, if not provided
accessToken: "<< ACCESS TOKEN >>",
})
.then((loginResponse: SumUpResponse) => {})
```
Get your affiliate key [here](https://me.sumup.com/developers) and
find out more about how to generate an access token in SumUps official [documentation](https://developer.sumup.com/rest-api/#section/Authentication)2. Initiate a checkoout (Login required)
```typescript
SumUp.checkout(
{
title: 'Test checkout',
total: 100.50,
currency: 'EUR',
skipSuccessScreen: true,
additionalInfo: {
title: 'Booking 1'
}
} as CheckoutOptions
).then((r: SumUpResponse) => {
// Checkout completed
})
.catch((r: SumUpResponse) => {
// Checkout failed
})
```
Find a detailed description of possible parameters in SumUp's [documentation](https://github.com/sumup/sumup-android-sdk#4-make-a-payment).