#sougata_api

1 messages · Page 1 of 1 (latest)

timber dewBOT
#

👋 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/1228270867952177224

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

distant thicket
#

Getting details by - $payment = StripeSession::retrieve($request->get('session_id'));

neon sundialBOT
dire sleet
#

hi there!

distant thicket
#

Hi

dire sleet
#

the Checkout Session contains a PaymentIntent object. and the PaymentIntent object contains a PaymentMethod object with all the information about the card.

distant thicket
#

I was previously able to fect all data by customer ID

#

I am not creting payment intent

#

Stripe::setApiKey(config('services.stripe.secret'));
$subscriptionPriceId = getCacheOrNonCacheKey('company_pricing_subscription');
$options = [
'payment_method_types' => ['card'],

        'mode' => 'subscription',
        'success_url' => url('/stripe-success?session_id={CHECKOUT_SESSION_ID}'),
        'cancel_url' => url('/stripe-cancel?session_id={CHECKOUT_SESSION_ID}'),
    ];
dire sleet
#

I was previously able to fect all data by customer ID
not sure what you mean
I am not creting payment intent
correct, the PaymentIntent is automatically created by the Checkout Session

distant thicket
#

Bu Ima not able to get the payment intent. Let me share what I am getting

#

Got it now. Let me check

dire sleet
#

note that the PaymentIntent is only available after the payment is successful

distant thicket
#

Ok

#

Got ->

#

id: "pi_3P4cLGFR7e1DFwTs1xx36oWz"
object: "payment_intent"
amount: 50000
amount_capturable: 0
amount_details:
Stripe

StripeObject {#2485 ▶}
amount_received: 50000
application: null
application_fee_amount: null
automatic_payment_methods: null
canceled_at: null
cancellation_reason: null
capture_method: "automatic"
client_secret: "pi_3P4cLGFR7e1DFwTs1xx36oWz_secret_YcJc5N9ouyUmYuFuKijt59yqW"
confirmation_method: "automatic"
created: 1712898482
currency: "usd"
customer: "cus_PuRDa97snbtefu"
description: null
invoice: "in_1P4cLKFR7e1DFwTsSVQ2iGnd"
last_payment_error: null
latest_charge: "ch_3P4cLGFR7e1DFwTs1F3QN7YH"
livemode: false
metadata:
Stripe

StripeObject {#2484 ▶}
next_action: null
on_behalf_of: null
payment_method: "pm_1P4cLGFR7e1DFwTsEB1Jb7Qw"
payment_method_configuration_details: null
payment_method_options:
Stripe

StripeObject {#2480 ▶}
payment_method_types: array:1 [▼
0 => "card"
]
processing: null
receipt_email: null
review: null
setup_future_usage: null
shipping: null
source: null
statement_descriptor: null
statement_descriptor_suffix: null
status: "succeeded"
transfer_data: null
transfer_group: null

#

No card details

dire sleet
#

there is this: payment_method: "pm_1P4cLGFR7e1DFwTsEB1Jb7Qw"

#

so now you retrieve the PaymentMethod object to get the card info