#cyber_s
1 messages · Page 1 of 1 (latest)
Hello! Try stripe trigger checkout.session.completed
hey thats what im using :). getting this js { id: 'cs_test_a1tWbGCEDdZWxj20iYuGw5qDKWDw600sSZFp9yWnqfmUEGDFSBQ13xlI5s', object: 'checkout.session', after_expiration: null, allow_promotion_codes: null, amount_subtotal: 3000, amount_total: 3000, automatic_tax: { enabled: false, status: null }, billing_address_collection: null, cancel_url: 'https://httpbin.org/post', client_reference_id: null, consent: null, consent_collection: null, created: 1686698561, currency: 'usd', currency_conversion: null, custom_fields: [], custom_text: { shipping_address: null, submit: null }, customer: 'cus_O4qEXwEVrBcNG2', customer_creation: 'always', customer_details: { address: { city: null, country: null, line1: null, line2: null, postal_code: null, state: null }, email: 'stripe@example.com', name: null, phone: null, tax_exempt: 'none', tax_ids: [] }, customer_email: null, expires_at: 1686784961, 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_3NIgXtLsXA6jjeQ004gJL5IW', payment_link: null, payment_method_collection: 'always', payment_method_options: {}, payment_method_types: [ 'card', 'alipay', 'us_bank_account', 'wechat_pay' ], payment_status: 'paid', phone_number_collection: { enabled: false }, recovered_from: null, setup_intent: null, shipping: null, shipping_address_collection: null, shipping_options: [], shipping_rate: null, status: 'complete', submit_type: null, subscription: null, success_url: 'https://httpbin.org/post', total_details: { amount_discount: 0, amount_shipping: 0, amount_tax: 0 }, url: null }
doesnt have line items
That's expected. The line_items property is not included by default. You need to fetch the Checkout Session from the API and expand that property: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
ahhhh i see
let me try that
ok got it!!!! what are the ids i should be looking for to know what the product is?
price id?
Under each line item there should be a price property which contains the product ID.
Happy to help!
is there a way to trigger the checkout session complete cli with a specific product ?
You can create a custom fixture to do that: https://stripe.com/docs/cli/fixtures
You can also use the --edit flag on the trigger command to edit the existing fixtures.
ok cause the fixtures looks kinda confusing to do XD
There's also the ability to override certain things, but I don't know if that will suffice for what you want to do: https://stripe.com/docs/cli/trigger#trigger-override
im just trying to get it to do it with this product idprod_O4qWNdNjQFytnS so i can test if my code is reading the meta data correctly
You would need to override the Price ID to a Price belonging to that Product.
gotcha ok thank you
