#Adil kadiyawala
1 messages · Page 1 of 1 (latest)
Hi there, there's no API to retrieve upfront stripe fee or tax calculation.
I am using Magento2. I tried to get the stripe charges in the response of "paymentIntents retrieve" Api after successfully payment done but I am getting null value.
Can you share with me the PaymentIntent ID?
pi_3M1Rx2SDmeQaIema0DrAiTfi
pi_3M1ke8SDmeQaIema1LzA9G52
pi_3M1l2dSDmeQaIema1qo4gCPs
Did you retrieve the PaymentIntent before its status becomes succeeded? From my end I can see charges available for all of these three PaymentIntents
after successfully place order when I debug the log of payment intent object then I get this log:
{"id":"pi_3M1l2dSDmeQaIema1qo4gCPs","object":"payment_intent","amount":13500,"amount_capturable":0,"amount_details":{"tip":[]},"amount_received":0,"application":null,"application_fee_amount":null,"automatic_payment_methods":{"enabled":true},"canceled_at":null,"cancellation_reason":null,"capture_method":"automatic","charges":{"object":"list","data":[],"has_more":false,"total_count":0,"url":"/v1/charges?payment_intent=pi_3M1l2dSDmeQaIema1qo4gCPs"},"client_secret":"pi_3M1l2dSDmeQaIema1qo4gCPs_secret_Xs5CFRfN33vFaawIPUyOLu0Za","confirmation_method":"automatic","created":1667887931,"currency":"inr","customer":"cus_MSvUa01Ts3209Y","description":"Order #000000168 by Abhijit Dhada","invoice":null,"last_payment_error":null,"livemode":false,"metadata":{"Module":"Magento2 v3.2.8","Order #":"000000168"},"next_action":null,"on_behalf_of":null,"payment_method":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":"adil_kadiyawala@yahoo.co.in","review":null,"setup_future_usage":null,"shipping":{"address":{"city":"Pune","country":"IN","line1":"pune","line2":null,"postal_code":"411038","state":"Maharashtra"},"carrier":null,"name":"Abhijit Dhada","phone":"7876990876","tracking_number":null},"source":null,"statement_descriptor":null,"statement_descriptor_suffix":null,"status":"requires_payment_method","transfer_data":null,"transfer_group":"group_pi_365866455"}
please check the "charges" array. It is null
The status is requires_payment_method, which means there is no payment attempts to this PaymentIntent yet.
I am retrieving after place an order event of magento so I think it is retrieve data before success.
You should listen to the payment_intent.succeeded event and retrieve the paymentIntent when receiving this event.
How is this possible? because I already provide payment data
Okay
Have you aware about this event in magento?
I don't have details about magento's implementation. This event is documented in public API reference https://stripe.com/docs/api/events/types#event_types-payment_intent.succeeded
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Okay thank you