#fer2055

1 messages · Page 1 of 1 (latest)

hidden pollenBOT
vital summit
#

Do you have a Request ID?

fresh urchin
#

no, i think i dont ,let me look it up

#

this is the last request id req_8PogRYgDXrXhuO

vital summit
#

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']);

fresh urchin
#

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

vital summit
#

Can you try hard-coding the Checkout Session to the request to see if it works?

fresh urchin
#

do you mean basically passing the value directly to the retrieve() ?

vital summit
#

Correct. That's what you should be doing anyway

fresh urchin
#

i did, same thing

vital summit
#

Hard-coded or not, you have to pass in the Checkout Session ID as a string to the parameters

fresh urchin
#

i am

#

i've tried that already copying it directly, inside a variable, and nothing seems to work

vital summit
#

Some request here is still getting NULL

#1 /Applications/XAMPP/xamppfiles/htdocs/success.php(11): Stripe\Service\CustomerService->retrieve(NULL)

fresh urchin
#

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?

vital summit
#

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?

fresh urchin
#

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'

vital summit
#

You're passing a Checkout Session ID to the Customer Retrieve API call. You gotta hard-code a Customer ID instead

fresh urchin
#

O

#

let me try

fresh urchin
#

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
    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?

vital summit
fresh urchin
#

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?

vital summit
#

That would make sense, yes

fresh urchin
#

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?

vital summit
#

You redirect them to whatever page you want, so I don't really understand the question