#storm-checkout-features

1 messages ยท Page 1 of 1 (latest)

frank axleBOT
quaint hatch
#

Sure. can't remember how to do code snippets in discord so apologies:

'shipping_options' => [
'shipping_rate_data' => [[
'display_name' => 'First Class',
'type' => 'fixed_amount',
'fixed_amount' => [
'amount' => 1234,
'currency' => 'GBP',
],
],],
],

upper bloom
#

Thank you

quaint hatch
#

would you prefer the whole block?

#

This is the error it's giving:
invalid_request_error - shipping_options
Invalid array

#

I'm using the PHP library if that's relevant too ๐Ÿ™‚

peak fern
#

you need an extra set of [ ] at the top level and one less at the item level

    [ // one shipping option 
      'shipping_rate_data' => [ 'display_name' => ...]
    ],
    [ // another shipping option 
      'shipping_rate_data' => [ 'display_name' => ...]
    ]
]`
quaint hatch
#

okay, so shipping options is an array of shipping rate data objects. I'm with you.

#

let me give that a whirl

#

perfect. you're a star.
Once I get past the silly errors this system is really nice

quaint hatch
#

Not sure if I sound put a second question here or open a new one.

I've set phone number collection to true and the input box is there on the checkout page but when I complete a payment the returned object has phone as null.
Is that a testing issue or do I have something wrong?

I have it set like the guide page code example:

        'enabled' => true,
    ],```
upper bloom
#

Asking here is totally fine. Do you have the ID of the payment (pi_123) or Checkout Session (cs_test_123) that this happened with?

quaint hatch
#

yep, 2 seconds

#

cs_test_b11WQtTg5pb5WdH9ugfZOp88YOHWoqSgYv2y81m9oExYIorT90jjvE2BbM

livid mauve
#

storm-checkout-features

quaint hatch
#

I'm looking in the logs on the dashboard and the /v1/payment_methods post, it shows billing information as follows:

    "address": {
      "city": "Lincoln",
      "country": "GB",
      "line1": "6 Norton Disney Road",
      "line2": "carlton-le-moorland",
      "postal_code": "LN5 9JB",
      "state": null
    },
    "email": "test@stormriderstudios.com",
    "name": "Stewart Leonard",
    "phone": null
  },```

Am I looking in the wrong place?
#

okay, so it shows up in the events. I haven't got to the part where I get the payment confirmation yet (very new to stripe, sorry)

livid mauve
#

Totally fine, lots of separate objects to look at. Right now we set the collected phone number on the Customer object, not the PaymentMethod

quaint hatch
#

okay, so I just searched up the post payment process and there I'll be setting up the webhook to listen for the payment confirmation which will contain all of the information from the event log, not the paymentmethod log, that sound right?

livid mauve
#

yes

quaint hatch
#

thank you so much, you guys are awesome

livid mauve
#

happy to help ๐Ÿ™‚

quaint hatch
#

I'm sure I'll be back later in the week, this is all working towards using MultiParty, but from what I can tell that just means adding a few extra lines to the checkout session request. Loving it ๐Ÿ™‚