#aimer8978
1 messages · Page 1 of 1 (latest)
hi there!
the PaymentIntent has a payment_method property that contains all the information about the card, including `last4``
hii
{
"id": "pi_3OcOsRDMSE5JJPrt1lR8abjn",
"object": "payment_intent",
"amount": 92250,
"amount_capturable": 0,
"amount_details": {
"tip": []
},
"amount_received": 92250,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": {
"allow_redirects": "always",
"enabled": true
},
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "pi_3OcOsRDMSE5JJPrt1lR8abjn_secret_sAjDyS1YqtP8VCMiT4PxywZNh",
"confirmation_method": "automatic",
"created": 1706173539,
"currency": "eur",
"customer": null,
"description": "apartment name : Budapest Kazinczy 7, Apartment Id : 71, Rent Payment :- 900 and email :- emooboyz@gmail.com, Paid via mobile app + 2.5 % transaction fee (\u20ac22.50)",
"invoice": null,
"last_payment_error": null,
"latest_charge": "ch_3OcOsRDMSE5JJPrt11fG09Q0",
"livemode": false,
"metadata": [],
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1OcOsZDMSE5JJPrtMVXVOgTJ",
"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": "off_session",
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
i retrieved it
dont worry this is testing
i cannot find the last_4
i did this in my php app
$res = $stripe->paymentIntents->retrieve($booking->transaction_id,[]);
im using this api
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
here:
"payment_method": "pm_1OcOsZDMSE5JJPrtMVXVOgTJ",
you need to retrieve the PaymentMEthod object now
either make a new API call, or use expand: https://stripe.com/docs/expand
so i need to use
$res = $stripe->paymentIntents->retrieve($booking->transaction_id,[
'expand' => ['payment_method']]);
is this correct?
something like this yes. does it work?