#deondk-PaymentIntentCreateOptions-cents

1 messages · Page 1 of 1 (latest)

stable current
#

Hello 👋
Let's use the thread here
Do you have any example Payment Intent IDs?

ebon obsidian
#

well the PI shows 500

#

when the amount is 550

#

with cents

#

Amount = (long)payment.Amount * 100,
Currency = currency.CurrencyCode,

#

I paid 5.50 pounds

#

but after the options it makes the Amount = 500

#

I can send a screenshot of the PI Create Options?

stable current
#

Yes please provide as many as details as you can

ebon obsidian
#

first image shows amount I send through

#

second image shows options amount after created

#

pi_3KsTErFDPlX5rx8l1GRxU0Ag

#

this is my code:

#

var options = new PaymentIntentCreateOptions
{

                    Amount = (long)payment.Amount * 100,
                    Currency = currency.CurrencyCode,
                    Description = payment.Description,
                    PaymentMethodId = payment.StripeCardId, 
                    CustomerId = payment.StripeCustomerId,
                    ApplicationFeeAmount = (long)totalApplicationFee,
                    TransferData = new PaymentIntentTransferDataOptions
                    {
                        Destination = subvendorMerchantId,
                    },
                    Confirm = true,
                    ReturnUrl = "https://www.lastmanstands.com/auth-load"


                };
stable current
#

Thanks
Can you try printing (long)payment.Amount * 100 before you pass it into the options?

ebon obsidian
#

ok

#

ok so it does go to 500

#

doesnt make any sense

#

var amount = (long)payment.Amount * 100;

stable current
#

yeah my Java skills are not that great but maybe try with a different data type there and see if that helps?

ebon obsidian
#

I think it needs long in .net

#

will first do the calc

#

and then convert to LONG

stable current
#

ah whoops my bad.