Short Payment Descriptor generator for Kotlin Multiplatform. Generated SPAYD can be forwarded to a bank application or used to generate a QR code.
Add this to your dependencies:
implementation 'io.stepuplabs.spaydkmp:spayd-kmp-android:<latest-version>'
Add dependency using Swift Package Manager:
Go to you project and select Package Dependencies, click +
in the lower left corner and add https://github.com/step-up-labs/spayd-kmp-spm.git
in the upper right corner of the presented dialog (marked "Search or Enter Package URL").
Add a new entry into dependencies
: .package(url: "https://github.com/step-up-labs/spayd-kmp-spm.git", from: "<latest-version>"),
Create Spayd
instance. The only mandatory parameter is account
. Example:
val spayd = Spayd(
account = Account(iban = "CZ7603000000000076327632"),
amount = 500.00,
currency = "CZK",
message = "Clovek v tisni",
)
Then call:
val spaydString = spayd.toString()
This will validate data and possibly throw ValidationException
with a short message describing the first problem it encountered.
val spayd = Spayd(
Key.ACCOUNT to Account(iban = "CZ7603000000000076327632"),
Key.AMOUNT to 500.00,
Key.CURRENCY to "CZK",
Key.MESSAGE to "Clovek v tisni",
)
or
val parameters: Map<Key, Any> = mapOf(
Key.ACCOUNT to Account(iban = "CZ7603000000000076327632"),
Key.AMOUNT to 500.00,
Key.CURRENCY to "CZK",
Key.MESSAGE to "Clovek v tisni",
)
val spayd = Spayd(parameters)
For any contributions, make sure all unit tests pass. Ideally, add one or more new unit tests. Any contributions via pull requests are welcome.