#feni-patel_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1308380930448162866
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- feni-patel_api, 4 days ago, 12 messages
- feni-patel_api, 4 days ago, 22 messages
- feni-patel_api, 5 days ago, 6 messages
Hello @thorn saddle
I am using separate charge and transfer method. I have used create payment intent id and transfer method. first i used pyment intent id creation method and used that intent id into transfer as source but into transfer i am getting error like, No such charge: 'pi_3QMnkxFhYfQgOdcB1nsla5Wi' . can you help me with this isuue ?
request ID from the error req_xxx please
actually no
I already answered this question last week
please read #1306592278629978163 message please and let me know if I can help further.
@noble remnant do you have any followup questions?
what does paymentIntent.latest_charge mean?
what do you think it means?
I'm unsure how I can explain this.
You have a PaymentIntent. it has a field called latest_charge. The value of that field is what you need to pass to the source_transaction parameter of the Transfer API.
is that clearer @noble remnant ?
yup
@noble remnant did you try it and did things work? is it all working well now?
no not working
can I help you then @noble remnant ?
yes, i need your help. i am getting latest_charge: null, from const paymentIntent = await stripe.paymentIntents.retrieve(req.body.paymentIntentId);
what's the PaymentIntent ID in question?
pi_3QMpJHFhYfQgOdcB0WHn8T0r
well that PaymentIntent hasn't been completed and paid yet, right?
so it makes no sense to be trying to do a transfer yet ๐
so how can i confimr this ?
not sure what you're asking, can you elaborate?
how can i confirm from my end that this payment intent is confimr ?
well in multiple ways:
- look at the
statusfield on the PaymentIntent object - check the code you wrote to actually collect payment details from a customer
- and if you didn't write it, well that's the problem
- check the Stripe Dashboard
Okay, let me check these points
so do i need to use cutomer meta data compulsory ?
no, passing metadata is never compulsory in the API.
now i can see payment successed but still getting error in transfer like No such charge: 'pi_3QMpwiFhYfQgOdcB12BuTVFE'
and we know how to fix that right @noble remnant ?
it was the first answer in the thread, about using latest_charge .
how can you please clearify once ?
You have a PaymentIntent. it has a field called latest_charge. The value of that field is what you need to pass to the source_transaction parameter of the Transfer API
that's what i told you when i try to log the intent then i am getting below resposne,
resposne {
id: 'pi_3QMpwiFhYfQgOdcB12BuTVFE',
object: 'payment_intent',
amount: 18500,
amount_capturable: 0,
amount_details: { tip: {} },
amount_received: 0,
application: null,
application_fee_amount: null,
automatic_payment_methods: null,
canceled_at: null,
cancellation_reason: null,
capture_method: 'automatic_async',
client_secret: 'pi_3QMpwiFhYfQgOdcB12BuTVFE_secret_d2zS2qmaYYNPe4ANggZ1VHmYW',
confirmation_method: 'automatic',
created: 1732017016,
currency: 'usd',
customer: null,
description: 'Payment for booking ID: 673c7b844bcd7c0d8c7d8528',
invoice: null,
last_payment_error: null,
latest_charge: null,
livemode: false,
metadata: {},
next_action: null,
on_behalf_of: null,
payment_method: 'pm_1QMpwhFhYfQgOdcBCtW2EVEl',
payment_method_configuration_details: null,
payment_method_options: {
card: {
installments: null,
mandate_options: null,
network: null,
request_three_d_secure: 'automatic'
}
},
payment_method_types: [ 'card' ],
processing: null,
receipt_email: null,
review: null,
setup_future_usage: null,
shipping: null,
source: null,
statement_descriptor: null,
statement_descriptor_suffix: null,
status: 'requires_confirmation',
transfer_data: null,
transfer_group: '673c7b844bcd7c0d8c7d8528'
}
that's an old snapshot of the object
if you call stripe.paymentIntents.retrieve now, you'll see that it is status:succeeded, and that it has a latest_charge.
you need to make sure that you run this code that tries to create a Transfer, only after the PaymentIntent has fully completed(this is what webhooks can be useful for).
okay so do i need to use that webhook for the paymentIntent confirmation ?
bcz we are using one flutter package for the loading the card details. so does using this payment intent will be completed or do i compulsory need to use webhook ?
hi! I'm taking over this thread.
the recommended approach:
- have a webhook endpoint listening to the
payment_intent.suceededevent - when you receive that event, you create the Transfert with the
source_transactionas mentioned above
currently i am using transfer group and source_transaction bothy so i am getting error You cannot use transfer_group if the source_transaction already has one set. so which i need to use for transfer the amount?
we recommend using source_transaction