Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CardPaymentActivity amount should be a double #22

Closed
hclemson opened this issue Mar 15, 2021 · 4 comments
Closed

CardPaymentActivity amount should be a double #22

hclemson opened this issue Mar 15, 2021 · 4 comments

Comments

@hclemson
Copy link

hclemson commented Mar 15, 2021

Expected Behavior

To be able to take payments in pounds and pence, dollar and cents, e.g. 1.99, the amount value in CardPaymentActivity should be a double.

Current Behavior

The amount value is currently a Long

Steps to Reproduce

See example Step 5

val intent = CardPaymentActivity.IntentBuilder(this)
    // MANDATORY: Transaction amount in account currency 
    .amount(20000L)
    // MANDATORY, Reference object created in previous step        
    .reference(reference)
    // MANDATORY, you can enable login prompt in the payment flow if user is not yet logged-in
    .enableLogin(enableLogin)
    // OPTIONAL, you can enable tipping (disabled by default)       
    // This option will only work for markets with tipping support
    .enableTipping(true)
    // OPTIONAL, you can enable installments (enabled by default)
    // This option will only work for markets with installments support
    .enableInstalments(enableInstallments)
    .build()
@adamvoncorswant
Copy link

Hey @hclemson ! All monetary amounts that we handle are always specified as an integer (long) in the minimal denominator of the currency. So, for GBP1.99 you should use the value of 199.

I hope that clarifies.

@hclemson
Copy link
Author

Hi @adamvoncorswant That's perfect, that you for clarifying. Do you have any docs that detail this and the other values, as I wasn't able to locate any?

@fabriciovergara
Copy link
Contributor

fabriciovergara commented Mar 15, 2021

Hi @hclemson, all the documentation that we have in the README in this repository. Ass @adamvoncorswant said, we use a long for all currency values. For example, EUR has cents, then €1.99 is 199 - but SEK doesn't have cents, then 199kr is 19900

Regarding other values, do you mean when creating the intent?

.reference(reference) -> You create by providing a unique id created and store by you and with that you can use to locate a transaction.

.enableLogin(boolean) -> If user is not signed in our sdk, it will prompt before continuing a payment

.enableTipping(boolean) -> will enable tipping for a transaction, but only if the country that transaction is happening has support for tipping/gratuity.

.enableInstalments(boolean) -> will enable installments for a tranaction, but only if the country that transaction is happening has support for installments. I can say that by now only Brazil and Mexico has such support.

Please, let me know if is something else specifically.

@fabriciovergara
Copy link
Contributor

Fixed mistake in the SEK case explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants