#smartkiparis
1 messages · Page 1 of 1 (latest)
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
I am digging right now, but generally what could be the reason for customer update failure?
A multitude of reasons. Do you have an example?
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?
Do you have a req_xxx ID?
sadly no. Can I look up in a Dashboard?
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
But generally if I pass wrong param names or non-existent params, could Stripe throw an error?
Yep, you'd probably get an parameter_unknown error: https://stripe.com/docs/error-codes#parameter-unknown