#dansteryoo-typescript-error
1 messages · Page 1 of 1 (latest)
hello, not a Typescript expert but looking
can you log out the CheckoutSession's ID that you are retrieving there?
cs_test_c1wgdtAcAumm0bJgDd9zclm12bi73zE5c2zbvx8Rv3MHIxvGqKTUQe3qtW
and also, what do you mean by
and it's giving me the following type: session.setup_intent = string | Stripe.SetupIntent | null
like, there isn't a SetupIntent returned? or it isn't casting a SetupIntent object into the full Stripe.SetupIntent type?
it's logging through .. the setup_intent object.. but typescript isn't recognizing it
session: {
id: 'cs_test_c1wgdtAcAumm0bJgDd9zclm12bi73zE5c2zbvx8Rv3MHIxvGqKTUQe3qtW',
object: 'checkout.session',
customer_email: null,
expires_at: 1661883590,
livemode: false,
locale: null,
metadata: {},
mode: 'setup',
payment_intent: null,
payment_link: null,
payment_method_collection: 'always',
payment_method_options: {},
payment_method_types: [ 'card' ],
payment_status: 'no_payment_required',
phone_number_collection: { enabled: false },
recovered_from: null,
setup_intent: {
id: 'seti_1LcCYsH4iYlAOK3oZYFCIWtD',
object: 'setup_intent',
application: null,
cancellation_reason: null,
client_secret: 'seti_1LcCYsH4iYlAOK3oZYFCIWtD_secret_MKsJpT6A2OtFyKSgxLJOXVmJQFDqLDw',
created: 1661797190,
customer: 'cus_MKsJ89QQTXLNNu',
description: null,
flow_directions: null,
last_setup_error: null,
latest_attempt: 'setatt_1LcCZaH4iYlAOK3oTxWRuBpG',
livemode: false,
mandate: null,
metadata: {},
next_action: null,
on_behalf_of: null,
payment_method: 'pm_1LcCZaH4iYlAOK3oQUy5VPqz',
payment_method_options: {
card: {
mandate_options: null,
network: null,
request_three_d_secure: 'automatic'
}
},
payment_method_types: [ 'card' ],
single_use_mandate: null,
status: 'succeeded',
usage: 'off_session'
},
},
after your const setupIntent = ... line
can you log out setupIntent and show what is logged?
setupIntent: {
id: 'seti_1LcCYsH4iYlAOK3oZYFCIWtD',
object: 'setup_intent',
application: null,
cancellation_reason: null,
client_secret: 'seti_1LcCYsH4iYlAOK3oZYFCIWtD_secret_MKsJpT6A2OtFyKSgxLJOXVmJQFDqLDw',
created: 1661797190,
customer: 'cus_MKsJ89QQTXLNNu',
description: null,
flow_directions: null,
last_setup_error: null,
latest_attempt: 'setatt_1LcCZaH4iYlAOK3oTxWRuBpG',
livemode: false,
mandate: null,
metadata: {},
next_action: null,
on_behalf_of: null,
payment_method: 'pm_1LcCZaH4iYlAOK3oQUy5VPqz',
payment_method_options: {
card: {
mandate_options: null,
network: null,
request_three_d_secure: 'automatic'
}
},
payment_method_types: [ 'card' ],
single_use_mandate: null,
status: 'succeeded',
usage: 'off_session'
},
actually this fixed it lol
i guess i have to be explicit
yeah cause setupIntent.payment_method can be a String or a Stripe.PaymentMethod type
since it too can be expanded
thanks!
np glad you figured it out!
i actually have another question if you don't 'mind?
sure
is there a way i can get in touch with someone to talk about my payments flow
it's kinda of confusing with the new intents .. because the way i knew how to do it was through invoicing line items
but invoicing might not be the best solution for me because i want to charge automatically
sure, you can ask here, our team helps users integrate Stripe really, so shoot
we don't do calls but right here on chat works
ok so .. i have a website that's like a job board..
organizations create jobs and then get charged per application for the job..
however i'm planning to charge their accounts on a monthly bases (1st of the month)
i also need to split up the jobs by line items (if this is possible?) or i guess i can just create that in the frontend ui without stripe having to keep that data?
the reason for the invoicing was because i can show my users by line what they were charged for..
what would be the best way to implement this flow?
oh I missed this, reading now