#Santhosh Kumar R - PaymentLinks

1 messages · Page 1 of 1 (latest)

tiny basinBOT
drowsy stump
#

Hi there!

#

Which programming language are you using?

bitter birch
#

Java

drowsy stump
#

then the price api fails for unknown reason
Can you share more details about this? What is your code doing exactly? And what's the error message?

bitter birch
#

I am attaching a dynamic price to my product everytime customer checkout..and then generate a paymentlink and sent it to the customer

drowsy stump
#

Which part of this is causing the error?

bitter birch
#

when i am using the latest version of 22.8.0 the price part failed..I am now trying with the 20.97.0 to attach price and generate a paymentlink against it..

drowsy stump
#

when i am using the latest version of 22.8.0 the price part failed.
But can you give more details on exactly what failed? Like can you share the code that returns an error, and also share the error message you see? Without this information I cannot help.

bitter birch
#

Ok let me switch to 22.8.0 and hit the error

#

in the meanwhile. I am .setUnitAmountDecimal(BigDecimal.valueOf(myobjct.getTotalAmount())) using this to set my amount value for example 110.00 however in the stripe dashboard its alwas pricing as 1.10

drowsy stump
bitter birch
#

when i switch to 22.8.0 the request fails abruptly..i dont see any logs on the stripe developer

#

Price price = Price.create(params); Throws error and is not caught in the immediate catch block

#

?

grave sleet
#

If it creates a price, there should be a dashboard log

#

Do you have the ID of the price that was created this way (price_1234)?

#

It sounds like you may be trying to give the price in dollars (or pounds, etc) but our API expects the price to be in cents. If you multiply your price by 100 you should get the one that you are expecting

bitter birch
#

no it fails in the above step

grave sleet
#

What is the full error being thrown?

bitter birch
#

the same code when i switch to 20.97.0 works fine

grave sleet
#

Good to hear! So all of this code is working now?

bitter birch
#

yes except for the below issue>>
during pricing
setUnitAmountDecimal(BigDecimal.valueOf(myobjct.getTotalAmount())) using this to set my amount value for example 110.00 however in the stripe dashboard its alwas pricing as 1.10

grave sleet
#

I addressed this above:

It sounds like you may be trying to give the price in dollars (or pounds, etc) but our API expects the price to be in cents. If you multiply your price by 100 you should get the one that you are expecting

#

Santhosh Kumar R - PaymentLinks

bitter birch
#

Thanks

#

nice i dint see that coming..just checking the api after you mentioned yes it is mentioned as cents