#I need urgent help

1 messages · Page 1 of 1 (latest)

cinder vector
#

Hi, how can we help?

#

can you provide your request id?

#

req_xxx

#

When you pass decimal amount

sinful elbow
#

means

cinder vector
#

then find the request you sent

sinful elbow
#

suppose that i am passing 50.25*100 then after payment success for $amount[charge] i am getting value as 502500

cinder vector
#

I could help you better if we have a request id (in the format req_xxx from above links)

#

It depends on the currency

#

and the parameter you used

sinful elbow
#

i will send you req_xxx

#

req_2uHCzlw5M1SNzS

cinder vector
#

Okie, you passed 40200 for MYR. MYR is a non-zero-decimal so it means 402

#

All API requests expect amounts to be provided in a currency’s smallest unit. For example, to charge 10 USD, provide an amount value of 1000 (that is, 1000 cents).

sinful elbow
#

can you brief me this

cinder vector
#

The Doc above could explain better than me 🙂

#

It's basically when you pass 40200, it means 402

sinful elbow
#

then how to store its as MYR 40.2 in my database

cinder vector
#

4020 I believe

#

it is to multiple w 100

sinful elbow
#

????

cinder vector
#

So instead of setting amount = 40200 in your request req_2uHCzlw5M1SNzS, you set amount = 4020, stands for 40.2 MYR

sinful elbow
#

how to set that

#

$charge = Stripe\Charge::create ([
"amount" => $request->Price*100,
"currency" => $request->paymentCurrency,
"source" => $request->stripeToken,
"description" => "Test payment.",

    ]);
cinder vector
#

What is in your $request->Price?

#

I suppose it's 402?

sinful elbow
#

its 40.2

cinder vector
#

then $request->Price*100 should be 4020

#

But I am seeing you passed 40200 on req_2uHCzlw5M1SNzS

sinful elbow
#

after multiplying 40.2*100 why is showing me "amount" => 40200

cinder vector
#

So you want to add debug on your code

#

to show what really was $request->Price and what really was $request->Price*100