PaystackHQ / paystack-android

Paystack SDK for Android. Accept payments on Android
Apache License 2.0
126 stars 102 forks source link

Paystack Transaction Amount Conversion #47

Closed AdityaLabhade closed 6 years ago

AdityaLabhade commented 6 years ago

We have successfully integrated Paystack sdk in Web, Android and iOS application. We are able to do successful transactions also. But we are getting one problem during transactions is that when we are sending the transaction amount it is getting divided by 100 for Nigerian currency ( Naira )

eg. If we assign transaction amount as 3500 /- then it is converted to 35 ₦

How to solve this? Any help will be appreciated.

steveamaza commented 6 years ago

Hello @AdityaLabhade , the documentation states that amount is sent in kobo. If you do not convert it to naira by first multiplying it by 100, what you are effectively doing is sending 3500 kobo which is equal to N35. Please close this issue as it is not a bug and instead multiply your values by 100 before passing it on to the API.

AdityaLabhade commented 6 years ago

Solved my problem, Thank you..

aivision369 commented 5 years ago

I have successfully integration the PayStack in android platform. How to pass 1500.50 INR amount using it. I have checked in the PayStack SDK that Charge.setAmount is supported only Integer value. When I pass 1000 or something like that kind of amount which is not contain any fraction value then it working fine.

steveamaza commented 5 years ago

Hi @IDFDeveloper, in that case, pass 150050. The currency is passed in the subunit of the currency, not the main unit

aivision369 commented 5 years ago

@steveamaza Thank you so much for your reply. I have another question that If I want to pay $100 then how I can send that amount because there is no any option where I will set currency type. I mean user is request to pay amount in dollar($), nigerian (NGN), INR, etc. ? I have checked belowe are the documents.

Document 1,
Question 1 and Question 2

Help would be very appreciate.... :)