#Khalil-Orders

1 messages · Page 1 of 1 (latest)

young dock
#

Hi there, not all properties can be retrieved with a publishable key. Can you try retrieve the order object from backend instead?

scarlet sluice
#

Hi, I could but I will have to pass around the information to the client, which seems unnecessary (but not a blocker) - is that the only way?

young dock
#

I just checked in my integration, the order object returned from stripe.retrieveOrder includes total_details hash.

#

Are you check if you are passing a valid clientSecret?

scarlet sluice
#

hmmm interesting...

#

my code doesn't even compile

young dock
#
          betas: ['process_order_beta_1'],
          apiVersion: '2020-08-27; orders_beta=v4',
        },```
#

Did you pass this in when initializing Stripe.js?

scarlet sluice
#
betas: ["process_order_beta_1"],
  apiVersion: "2020-08-27; orders_beta=v4"
#

Yep

young dock
#

Also update stripe-js in your package.json ,i.e. "@stripe/stripe-js": "^1.31.0",

scarlet sluice
#

ok - so when I log the order object I receive, I do indeed have 'total_details' in the response:

'order', amount_subtotal: 10000, amount_total: 20000, billing_details: null, …}
amount_subtotal: 10000
amount_total: 20000
billing_details: null
created: 1659666538
currency: "usd"
id: "order_1LTGHWLEkeoA9qs7WKvMoSNP"
livemode: false
object: "order"
payment: {payment_intent: {…}, payment_intent_client_secret: 'pi_3LTGg9LEkeoA9qs71rKhtzuJ_secret_Oc7z3Au6QM4RcNPvPI4C6Uv4D', settings: {…}, status: 'complete'}
shipping_details: {address: {…}, name: 'Khalil Hajji', phone: null}
status: "complete"
total_details: {amount_discount: 0, amount_shipping: 10000, amount_tax: 0}
[[Prototype]]: Object
young dock
#

Great!

scarlet sluice
#

but I don't seem to be able to call it - just give me a sec, I am trying

#

re on stripe version, my stripe-js is "^1.32.0" so that should be good

young dock
#

clean the node_modules folder and npm i again.

scarlet sluice
#

That fixed it - thanks for the help!

#

Should have thought about cleaning and installing stuff from scratch 🙂

young dock
#

That's great! Good to hear that.