#smartkiparis

1 messages · Page 1 of 1 (latest)

tribal loomBOT
graceful egret
#

Parameters are generally the fields on the object (i.e. name, email), where as options are generally for specifying an account ID, if using Connect, etc

crimson mural
#

I am digging right now, but generally what could be the reason for customer update failure?

graceful egret
#

A multitude of reasons. Do you have an example?

crimson mural
#

if ($name) {
$params['name'] = $name;
}
if ($data->address) {
$params['address']['line1'] = $data->address;
}
if ($data->additionalAddress) {
$params['address']['line2'] = $data->additionalAddress;
}
if ($data->country) {
$params['address']['country'] = $data->country;
}
if ($data->state) {
$params['address']['state'] = $data->state;
}
if ($data->city) {
$params['address']['city'] = $data->city;
}
if ($data->zipCode) {
$params['address']['postal_code'] = $data->zipCode;
}
if ($data->phone) {
$params['phone'] = $data->phone;
}
if ($data->email) {
$params['email'] = $data->email;
}

    $this->client->customers->update(
        $externalCustomerId,
        $params,
    );
#

I form a params array and then pass them to update method

#

I found, that 'postal_code' was placed outside of address subarray

#

like
[
'address' => [],
'postal_code' => '',
etc.
]

#

here I fixed that

#

could that be a problem?

graceful egret
#

Do you have a req_xxx ID?

crimson mural
#

sadly no. Can I look up in a Dashboard?

graceful egret
crimson mural
#

But generally if I pass wrong param names or non-existent params, could Stripe throw an error?

graceful egret
crimson mural
#

yeah, that was the case

#

postal_code was outside of address scope