Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Conversation

@ambareng
Copy link

In _createCreditCardToken I added the curency property as it was missing. Without it the tokenization process does not know which currency you are using.

I need to specify currency as 'PHP' as if it is 'IDR' which is the default, amount needs to be an integer instead of possibly a decimal for Philippine currency.

Thanks and feel free to ask me any questions or concerns you may have.

Copy link

@reynaldipane reynaldipane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @ambareng , thanks for raising this PR!
I think we can have better validation to add currency in this _createCreditCardToken method

instead of adding the field directly in the body, I think we need to validate it first, and if its okay that we can add the field to the body. Like this:

    if(tokenData.currency !== undefined && tokenData.currency !== '') {
        body.currency = tokenData.currency;
    }

Copy link

@boazcstrike boazcstrike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better than the initial proposed change. Works on our local.

@ambareng ambareng requested a review from reynaldipane April 27, 2022 06:37
@ambareng
Copy link
Author

ambareng commented Jun 6, 2022

Hi @reynaldipane. Sorry if this is super late but I already updated my code according to your comments.
It'd be great if you could approve this pull request as it'll look good on my resume having contributions to a good open source project such as Xendit.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants