#DeadlyData - Android payment
1 messages · Page 1 of 1 (latest)
Hello, can you tell me a bit more about the error that you are seeing?
If the amount doesn't show up, what happens instead?
An amount does show up, and it's shown on my stripe dashboard. Once the user clicks pay, so the transaction is successful, but it's not the amount in the user's cart.
I'm not sure what's happening exactly i just followed the docs
I have the user's total saved in a variable called totalCost, i would like to pass that instead of the default value that's generated at checkout.
What amount is showing up if not the one that you created on the PaymentIntent?
Are you using Apple or Google Pay here by chance?
It's not published i am using testing data. And i do not have a createPaymentIntent method just a fetchPaymentIntent
Apologies for the very long delay here. Are you still looking in to this?
I am a bit unclear on what is happening in your code. So your client reaches out to your server, the server creates a payment intent and passes the client secret back to your client, and then when your client uses that secret the amount is different?
Do you have an example payment intent ID that this happened with?
so this is my node js payment method
/ Create a PaymentIntent with the order amount and currency
const paymentIntent = await stripe.paymentIntents.create({
amount: calculateOrderAmount(items),
currency: "eur",
automatic_payment_methods: {
enabled: true,
},
});
this is my java code
final String shoppingCartContent = "{"items": [ {"id":"xl-tshirt"}]}";
final RequestBody requestBody = RequestBody.create(
shoppingCartContent,
MediaType.get("application/json; charset=utf-8")
);
Request request = new Request.Builder()
.url(BACKEND_URL + "/create-payment-intent")
.post(requestBody)
.build();
How do i send the currency from my app, and the total cost to the server
is what im trying to say
Hi 👋 I'm stepping in for @river eagle give me a sec to catch up
okayy
So you are seeing the properly set amount in the PaymentIntent object in your dashboard, but not in the Android app?
How do i send the currency from my app, and the total cost to the server
is what im trying to say
To accomplish this you would need to build out some additional API endpoints on your server that received requests from your mobile app and either A) created a payment intent with the correct parameters or B) updated the payment intent you are using.
This is the payment intent i am using.
Okay, let me ask a different question how do i calculate the total using the server? like how do i pass the item cost inside the items, inside calculateOrderAmount(items)
lets say, items cost are 30, 13,15, ,18
and i have this information inside my android app
how do i pass it inside calculateOrderAmount(items)
Okay so you are saying you are able to get an array of amounts to the calculateOrderAmount function? Which is a function you wrote, yes?