#andreas-checoutsession-py_
1 messages ยท Page 1 of 1 (latest)
py charge objects when using any other payment method
That's not true at all
Where did you hear that
stripe support online chat
AFAIK that's not true
Could be wrong
However, you should be using Payment Intents not Charges
Charges are a legacy flow
Payment Intents are built on top of Charges, but have more functionality and are more powerful
Yes I know I use payment intents
Chat from Chat started: 2024-01-02 18:28:58 UTC ...
(06:42:42 PM) Andreas T: so could you help me with my problem then?
(06:42:44 PM) Monica: Yes, while the channel is still close.
(06:42:53 PM) Monica: Sure, let me see what we can about it.
(06:43:04 PM) Monica: Could you please give me more information about the issue?
(06:43:18 PM) Monica: * what we can do
(06:43:28 PM) Andreas T: unified_payments (12).csv
(06:43:29 PM) Andreas T: When I run exports I get this
(06:44:03 PM) Monica: The file won't open on my end.
(06:44:10 PM) Monica: Could you please share it again?
(06:45:09 PM) Andreas T: you see I get some ids with py_ and some with ch_ which are both charges. What is the difference? Our book keeping department gets confused and want's clarification on that
(06:45:29 PM) Andreas T: unified_payments (12).csv
(06:46:43 PM) Andreas T: charges.csv
(06:47:08 PM) Monica: It still won't open but I get the idea. Thank you.
(06:48:21 PM) Monica: ch_ are for those that are created under charges. py_ is for those that are paid through bank or anything that is not paid under card method.
(06:48:32 PM) Andreas T: From what I'm seeing ch_ ids have a pm_ (card) attached while py_ charges do not
(06:48:52 PM) Monica: That is correct.
Yeah my understanding is sometimes py_ is used and other times ch_ is used
But your code/integration should treat them the same
They're both charges
And if you're already using payment intents, you should be fine
the problem is i need to debug this as py charges are not recorded by my system and I need to find out why
I try to treat them as the same
uploaded a csv
this is an export from the stripe portal py_ charges don't have card details
therefor I needd to treat them somewhat different
You can still retrieve py_ id's via the retrieve a charge endpoint
From there you can look at the details
this process is all done by a webhook event payment_intent.succeeded
What's the issue?
If you're listening to payment_intent.succeeded you should have access to all the data there
I guess I don't understand the problem
There will be a payment method associated with the payment intent
the problem is on my side "charge" goes into transaction table. ch_ land in the table and py_ does not
so I need to get a payment intent that has a py_... id in latest_charges property
in dev to see what's wrong
Ah I see
I'm actually not completely familiar with when py vs ch is used
Let me check to see the easiest way to replicate this
AH so the support agent was right
I'm wrong
py is for all non-card objects
So you can just make a non-card payment in test mode to replicate
that was my initial question how to do this
I only see "link" or cc details
when I use both of these I only get payment intents with ch_ charges
You need to enable another payment method
in the stripe portal?
Yeah
Well depends how you create the checkout session
Are you using automatic payment methods?
I think I have it locked down in code only to use "card" when I create the checkout session
But in production the business might allow others as well I don't know which takes precedence
Currently prod produces the py_ charges and I need to mimic that in dev
Ok in test mode you just need to make a payment with any other payment method other than card
So if you already have other payment methods enabled on your dashboard, just pass one when creating the session
That's all you need to do
ok so I have to enable other in the dashboard first right?
Only if you haven't already
And you should be able to do it just for test mode
to not affect live mode settings
Ok so how do you create a checkout session
that is dev
Are you forcing only card
I think so
then that's your problem
ok but same code base in prod how is it possible then to create payments that allow other methods there
You haven't sent me a code snippet so I have no idea what you're doing still
How do you create a checkout session
did not know that I can send you code
This is more complex might take a while
It's all in file
ok it look I don't restrict it just to 'card'
so that clarifies prod behaviour
I might have had in previous implementation
Just send the code snippet for creating a session
Should only be a couple lines of code
I don't need everything
that is creating the session try { $stripe_client_config = [ 'api_key' => $gateway->getSecretKey(), 'stripe_version' => self::STRIPE_API_VERSION, ]; $stripe = new StripeClient($stripe_client_config); $data = $session_data->toArray(); $session = $stripe->checkout->sessions->create($data); which does not help much
this 1$session_data = $this->buildSessionData($purchase_details, $order, $data); builds the data
Yeah I need to see the params you're passing
Likely you're explicitly passing: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_method_types
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yeah I think I don't pass this prop right now.
so it should be determined by the setup in the dashboard right?
yep
can't find it
just send me a request id then
a request id of you creating a checkout session in test mode
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.
"id": "cs_test_b1x2E59NmFTtnrF0915vem2KbJAwnhr7BXRVAAX5kudjAWtqf09YlemAuy"
is this what you need?
That works
it looks like I'm not sending the type
so it should be open
but the payment intent shows "payment_method_types": [ "card" ],
You only have card, google pay, apple pay, and link enabled in your account
For acct_1NXSfYCffGirjBVI anyway
Which is what the session was created on
Shouldn't I see any of those then in dev mode as well when I do a test purchase
card, google pay, apple pay, and link technically are all cards
ok but they are not captured by you or are they?
however I can't see any other options on the interface
That depends on your browser
google pay only shows in chrome if you're signed in to google and have a card added to wallet
apple pay same thing except safari
yes on chrome
ok I only need py_
enable any non card pm in your dashboard
will do right now
Hi ๐
I'm stepping in and trying to catch up, give me a minute to read through while you test out using non-card payment methods
ok
enabled a couple more
And just so I'm clear, currently you are simply trying to generate a non-card charge (py_) with a Checkout Session, correct?
That should be easily achieved using some non-card payment method (like us_bank_account or sepa_debit).
But you can also try mocking the payload response.
Okay, those other options would work as well
will try alipay right now
ok payment went trough
let's see
payment_intent "id": "pi_3OXoQfCffGirjBVI1J5iyxlG",
ok is see "latest_charge": "py_3OXoQfCffGirjBVI1t6Yk9fo",
I guess that's all I needed. now I can start debugging
Thanks for your help
Great ๐ I'm happy you were able to resolve the issue
Ok thanks have a nice day
You too