npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@globy-app/capacitor-sumup

v0.1.0

Published

Capacitor plugin to connect capacitor based applications to the native SumUp SDK to take card payments.

Downloads

2

Readme

capacitor-sumup

Capacitor plugin to connect capacitor based applications to the native SumUp SDK to take card payments.

Install

npm install capacitor-sumup
npx cap sync

Compatibility of this plugin

The aim of this plugin is to be as close to the Native SDK's as possible. This means that the returned result code and message is chosen by the SDK and the SDK probably has the correct documentation on how to interpret the code / message.

Android

The complete function set of this plugin is implemented on Android. This is the reference implementation.

Web

Sumup does not provide a way to integrate the SDK on web. The SumUp Payment Switch API does exist but cannot be integrated as nicely as the native SDK's. The native SDK's allow waiting for the user to return to the application, web application don't support this.

IOS

Not implemented yet.

Requirements

See SumUp Android SDK documentation on how to setup your account to accept calls from the SDK.

API

login(...)

login(options: LoginOptions) => Promise<SumupResponse>

Logout the user

| Param | Type | Description | | ------------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | options | LoginOptions | Options to use when loggin in. Must contain an affiliate key matching the bundle identifier of the application. |

Returns: Promise<SumupResponse>


logout()

logout() => Promise<void>

Logout the user


makePayment(...)

makePayment(options: PaymentOptions) => Promise<CheckoutResponse>

Trigger a payment. SumUp will open a window that helps the user letting the customer pay.

| Param | Type | Description | | ------------- | --------------------------------------------------------- | ---------------------- | | options | PaymentOptions | Options of the payment |

Returns: Promise<CheckoutResponse>


openCardReaderPage()

openCardReaderPage() => Promise<SumupResponse>

Opens a page to configure a SumUp card reader on the device. May never resolve, this is due to SumUp's implementation.

Returns: Promise<SumupResponse>


prepareForCheckout()

prepareForCheckout() => Promise<void>

Offers the possibility to connect the card reader ahead of initiating the checkout which speeds up the overall checkout time.


Interfaces

SuccesSumupResponse

| Prop | Type | | ---------------- | --------------------------------------------------------------- | | ResultCode | SuccessResultCode | | Message | string |

ErrorSumupResponse

| Prop | Type | | ---------------- | ----------------------------------------------------------- | | ResultCode | ErrorResultCode | | Message | string |

LoginOptions

| Prop | Type | | ------------------ | ------------------- | | affiliatekey | string |

SuccessCheckoutResponse

| Prop | Type | | --------------------- | --------------------------------------------------------------- | | ResultCode | SuccessResultCode | | Message | string | | TransactionCode | string | | TransactionInfo | TransactionInfo | | ReceiptSent | boolean |

TransactionInfo

| Prop | Type | | -------------------------- | ------------------------------------------------------- | | TransactionCode | string | | MerchantCode | string | | Amount | number | | ForeignTransactionId | string | | Currency | Currency | | PaymentStatus | PaymentStatus | | PaymentType | PaymentType | | EntryMode | string | | CardType | string |

PaymentOptions

| Prop | Type | | -------------------------- | --------------------------------------------- | | total | number | | currency | Currency | | title | string | | receiptEmail | string | | receiptSMS | string | | additionalInfo | { [key: string]: string; } | | foreignTransactionId | string | | skipSuccessScreen | boolean | | skipFailedScreen | boolean |

Type Aliases

SumupResponse

SuccesSumupResponse | ErrorSumupResponse

CheckoutResponse

SuccessCheckoutResponse | ErrorSumupResponse

Enums

SuccessResultCode

| Members | Value | | ---------------- | -------------- | | SUCCESSFUL | 1 |

ErrorResultCode

| Members | Value | | ----------------------------------- | --------------- | | ERROR_TRANSACTION_FAILED | 2 | | ERROR_GEOLOCATION_REQUIRED | 3 | | ERROR_INVALID_PARAM | 4 | | ERROR_INVALID_TOKEN | 5 | | ERROR_NO_CONNECTIVITY | 6 | | ERROR_PERMISSION_DENIED | 7 | | ERROR_NOT_LOGGED_IN | 8 | | ERROR_DUPLICATE_FOREIGN_TX_ID | 9 | | ERROR_INVALID_AFFILIATE_KEY | 10 | | ERROR_ALREADY_LOGGED_IN | 11 | | ERROR_INVALID_AMOUNT_DECIMALS | 12 | | ERROR_API_LEVEL_TOO_LOW | 13 |

Currency

| Members | Value | | --------- | ------------------ | | BGN | "BGN" | | BRL | "BRL" | | CHF | "CHF" | | CLP | "CLP" | | COP | "COP" | | CZK | "CZK" | | DKK | "DKK" | | EUR | "EUR" | | GBP | "GBP" | | HRK | "HRK" | | HUF | "HUF" | | NOK | "NOK" | | PEN | "PEN" | | PLN | "PLN" | | RON | "RON" | | SEK | "SEK" | | USD | "USD" |

PaymentStatus

| Members | Value | | ---------------- | ------------------------- | | PENDING | "PENDING" | | SUCCESSFUL | "SUCCESSFUL" | | CANCELLED | "CANCELLED" | | FAILED | "FAILED" |

PaymentType

| Members | Value | | --------------- | ------------------------ | | CASH | "CASH" | | POS | "POS" | | ECOM | "ECOM" | | UNKNOWN | "UNKNOWN" | | RECURRING | "RECURRING" | | BITCOIN | "BITCOIN" | | BALANCE | "BALANCE" |