Closed kriskoch closed 2 years ago
Hmm never mind, I noticed in UtilTest.php you are suppose to configure it this way 'addons' => [['id' => 'test-addon'], ['id' => 'test-addon2']]
Not sure why the configuration is different than the API shows, and especially not documented. But at least that works.
Hi @kriskoch may I know why the 'addons' => [id] is an array and not just a string like others, eg customer id? Is there a particular place in the API document that mentioned or pointed you to use an array for addon id?
Closing this issue.
When data is being seriazled it is losing the prefix.
For example I was using the function HostedPage::checkoutOneTime. My data array looked something like this
as per the documentation - https://apidocs.chargebee.com/docs/api/hosted_pages?prod_cat_ver=1&lang=curl#checkout_one-time_payments
However after Util::serialize is called the data is being transformed like the following'
$serialized = ['customer[email]' => 'example@example.org', 'customer[id]' => '_test12345_', 'id[0]' => 'test-addon']
As you can seem the addons prefix is missing from the serialized data causing addon selection not working.
But I am not even sure why you are calling Util::serialize to begin with?? You are using guzzle, pass in the data array directly into. So skip the whole $ser_params = Util::serialize($params);
pass $params directly into Guzzle::doRequest