#Seen Developer

1 messages · Page 1 of 1 (latest)

mint lindenBOT
gusty steppe
#

I want to pass the amount in AED in stripe payment API

#

please help me out

#

Jack

tranquil trench
gusty steppe
#

Jack I have done the same

#

and also passed the currency as AED and amount greater than 2 as well

#

But it is still showing the exception as Amount must be greater than 2.00 AED

tranquil trench
gusty steppe
#

request failed

tranquil trench
#

What do you see in the response?

#

Or show me the code that you wrote?

gusty steppe
#

okay sir

#

Sending you the code sir

#

Stripe\Stripe::setApiKey(STRIPE_SECRET);
$customer = Stripe\Customer::create(array(
"address" => [
"line1" => "Virani Chowk",
"postal_code" => "390008",
"city" => "Vadodara",
"state" => "GJ",
"country" => "IN",
],
"email" => "demo@gmail.com",
"name" => "Nitin Pujari",
"source" => $_REQUEST["stripeToken"]
));
Stripe\Charge::create ([
"amount" => 100 * 100,
"currency" => "AED",
"customer" => $customer->id,
"description" => "Test payment from LaravelTus.com.",
"shipping" => [
"name" => "Jenny Rosen",
"address" => [
"line1" => "510 Townsend St",
"postal_code" => "98140",
"city" => "San Francisco",
"state" => "CA",
"country" => "US",
],
]
]);

#

Jack please check

tranquil trench
#

You are not using PaymentIntents API?

#

Please read the API ref doc that I sent to you earlier, you can use the example code to create a PaymentIntent.

gusty steppe
#

we are directly using the createCharge API

#

Jack

tranquil trench
#

I'd like to clarify your ask, because you were asking about PaymentIntents API in the beginning, but you are using Charges API in the provided code.

#

Do you intent to continue using Charges API or migrate to PaymentIntents API? My recommendation is to go with PaymentIntents API.

gusty steppe
#

Charges API

#

jack

#

i would like to go with charges api

#

Jack

#

@tranquil trench please reply

tranquil trench
#

Your code looks OK to me. If you can share with me the request ID then I can find the log and help you troubleshoot further.

gusty steppe
#

We are doing the same but still it is showing the same error @tranquil trench

tranquil trench
#

If you can't get the request ID, can you share with me the detailed error message?

gusty steppe
#

sure

#

Amount must be at least 2.00 AED

#

this is the error message which we are getting

#

@tranquil trench

#

@tranquil trench

tranquil trench
#

There's no need to tag me every time after a message, your messages won't be missed.

#

I can't reproduce the problem and I'm afraid that I can't help you further unless you provide me the request ID.

gusty steppe
#

how to get the request id

gusty steppe
#

here is the request log url

tranquil trench
#

Great, let me take a look

#

OK, you are passing 2 as the amount, for 2.00 AED you should pass 200, because all API requests expect amounts to be provided in a currency’s smallest unit.

gusty steppe
#

okay sir wait let me check sir