#fer2055
1 messages · Page 1 of 1 (latest)
Do you have a Request ID?
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 center 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.
no, i think i dont ,let me look it up
this is the last request id req_8PogRYgDXrXhuO
It looks like you're attempting to GET a Checkout Session, but aren't passing anything in
You need to make sure you're passing in a Checkout Session ID when calling $stripe->checkout->sessions->retrieve($_GET['session_id']);
i am passing it trough GET method, my actual URL looks like this http://127.0.0.1/success.php?session_id=cs_test_a1MC0pQEk1nM4IDRa8MmqBQLQbB26XXXXXXXXXXXyBPz86vWj3Bnx (i changed some characters wit X for security purposes
indeed, i've copy pasted the code from the stripe examples on the developers documentation, i just added validation to make sure the $_GET['session_id'] was not empty but it was after the error i'm getting
Can you try hard-coding the Checkout Session to the request to see if it works?
do you mean basically passing the value directly to the retrieve() ?
Correct. That's what you should be doing anyway
i did, same thing
Hard-coded or not, you have to pass in the Checkout Session ID as a string to the parameters
i am
i've tried that already copying it directly, inside a variable, and nothing seems to work
Some request here is still getting NULL
#1 /Applications/XAMPP/xamppfiles/htdocs/success.php(11): Stripe\Service\CustomerService->retrieve(NULL)
right, and i can't figure out why
i was just checking that webhooks cannot be used in localhost unless it's used with CLI or an "public" localhost, i know i'm not using webhooks yet, but do you think it has something to do with a connection error? maybe while trying to get the customer information from the server or something?
Are you able to step through each function call to see where the request becomes NULL? It looks like there might be 2 places that your variables are NULL:
#0 /Applications/XAMPP/xamppfiles/htdocs/vendor/stripe/stripe-php/lib/Service/CustomerService.php(275): Stripe\Service\AbstractService->buildPath('/v1/customers/%...', NULL)
#1 /Applications/XAMPP/xamppfiles/htdocs/success.php(11): Stripe\Service\CustomerService->retrieve(NULL)
Have you hard-coded the ID in both places?
i have not tried that, one sec
ok, if i do that, it now gives me this error telling me that the customer doesn't exist
Fatal error: Uncaught (Status 404) (Request req_j0sy1zkWBCRClM) No such customer: 'cs_test_a1MC0pQEk1nM4IDRa8MmqBQLQbB26TUzaZFzZxxxxxxxmyBPz86vWj3Bnx'
You're passing a Checkout Session ID to the Customer Retrieve API call. You gotta hard-code a Customer ID instead
ok, question, if i var_dump the $session the response i get is the following, in which the "customer" is returning null, is this a due to a server "error"?
Session ID: cs_test_a1MC0pQEk1nM4IDRa8MmqBQLQbB26TUzaZFzZ59Bu501myBPz86vWj3Bnx
Object: checkout.session
After expiration: NULL
Allow promotion codes: NULL
Amount subtotal: 4600
Amount total: 4600
Automatic tax:
- Enabled: false
- Status: NULL
Billing address collection: NULL
Cancel URL: http://127.0.0.1/cancel.php
Client reference ID: NULL
Consent: NULL
Consent collection: NULL
Created: 1675792595
Currency: usd
Custom text: - Shipping address: NULL
- Submit: NULL
Customer: NULL
Customer creation: if_required
Customer details: - Address:
- City: NULL
- Country: MX
- Line 1: NULL
- Line 2: NULL
- Postal code: NULL
- State: NULL
- Email: kbkjbkjb@gindoin.com
- Name: obkjdbijb
- Phone: NULL
- Tax exempt: none
- Tax IDs: []
Customer email: NULL
Expires at: 1675878995
Invoice: NULL
Invoice creation: - Enabled: false
- Invoice data:
- Account tax IDs: NULL
- Custom fields: NULL
- Description: NULL
- Footer: NULL
- Metadata: {}
- Rendering options: NULL
Livemode: false
Locale: NULL
Metadata: {}
Mode: payment
Payment intent: pi_3MYvPhHcYzfLajBb0lwyLJ8p
Payment link: NULL
Payment method collection: always
Payment method options:
- Card:
- Installments:
- Enabled: false
Payment method types: [card]
Payment status: paid
Phone number collection:
- Enabled: false
- Installments:
- Enabled: false
Recovered from: NULL
Setup intent: NULL
Shipping address collection: NULL
Shipping cost: NULL
Shipping details: NULL
Shipping options: []
Status: complete
Submit type: NULL
Subscription: NULL
Success URL: http://127.0.0.1/success.php?session_id={CHECKOUT_SESSION_ID}
Total details: - Amount discount: 0
- Amount shipping: 0
- Amount tax: 0
URL: NULL
also, checking on the dashboard, i only got 1 customer, however i've done many tests using different emails, will this be the problem?
You have to explicitely create a Customer if you want one to be available for use, otherwise Checkout Creates a guest Customer: https://stripe.com/docs/payments/checkout/guest-customers#:~:text=Guest customers are automatically grouped,refunds%2C chargebacks%2C or fraud.
I think i know what the error is then, as i'm checking out as a guest, i never get the id, is that right?
That would make sense, yes
ok, so, just to understand this, if someone checks out as a guest, i cannot redirect them to a "custom" success page, is that right?
You redirect them to whatever page you want, so I don't really understand the question