#abdullahergun_code
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/1328835617139720224
๐ 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.
- abdullahergun_code, 19 hours ago, 70 messages
Hi, can you share an example request id please? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
yes
req_fP6NrbmrklPgaI
So I want to get the id of
"id":
"pi_3QhGw9BZ8dpn0pCV1dRHRmkL"
Taking a look
Just so you know I am using wordpress/woocomerce
Yeah, we can't help if the issue is related to wordpress/woocomerce. However, I'm trying to see if I can help unblock you here.
Are you trying to attain the txn_ id from the response on the PaymentIntent creation? Is that right?
Yes exctly
Hello
When you say Transaction ID, do you mean a Balance Transaction ID or something else?
https://docs.stripe.com/api/balance_transactions
A transaction could mean different things on Stripe and Woocommerce
In this request req_fP6NrbmrklPgaI
Response body contains
"id":
"pi_3QhGw9BZ8dpn0pCV1dRHRmkL"
I want to this id
This is in response object so should be easy to access
What does your $order look like?
function custom_action_on_pending_to_processing( $order_id ) {
// Do something when the order status changes from "pending" to "processing"
$order = wc_get_order( $order_id );
$TotalOrderValue = $order->get_total() ;
$PercentageToCharge = 50;
$calculated_percentage = calculate_percentage($TotalOrderValue, $PercentageToCharge );
$order->add_order_note(
'Order ID: ' . $order_id .
' Total : '. $order->get_total() .
' Currency : ' . $order->get_currency() .
' Payment Method Id '. $order->get_payment_method() .
' Payment Method Title ' . $order->get_payment_method_title() .
' Calculated percentage2 ' . $calculated_percentage .
' Transaction ID '. $order->get_transaction_id()
And this is where the charge is created
๐ Stepping in for my teammate, give me a few minutes to catch up
I removed your prior message since it contained a secret key (albeit a test mode secret key)
Its a test one should not be an issue
You mentioned you're trying to retrieve a PaymentIntent ID but the code you shared in your prior message is creating Charges.
In the code above, what does wc_get_order do? Do you have an example $order value?
Intent and charges they both contains a unique 'id' field which is what I need
I can get order details such as
'Order ID: ' . $order_id .
' Total : '. $order->get_total() .
' Currency : ' . $order->get_currency() .
' Payment Method Id '. $order->get_payment_method() .
' Payment Method Title ' . $order->get_payment_method_title() .
Order is wordpress or id dont let it confuse you
I need to access the return object
I'm still a little confused on what you're trying to do. Like you mentioned, Wordpress is creating the PaymentIntents on a connected account by calling the create PaymentIntents endpoint. How/where does your Charges code come in?
@gleaming dove let me know if you can provide more context