Subscription Custom Charges
Hi,
Im trying to pass custom amount to the API, but it seems not working, can you please tell me what's wrong with the array below?
Array
(
[code] => TEST_MONTHLY_PRO_1
[subscription] => Array
(
[planCode] => ANNUAL_PRO_1
[charges] => Array
(
[eachAmount] => 34.33
)
[changeBillDate] => 2011-0101
)
)
I want to pass a custom amount '34.33' instead of using the amount for 'TEST_MONTHLY_PRO_1' assigned from CG admin.
Thanks in advance.
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Marvin on 10 Jan, 2011 06:30 AM
pls ignore the typo for changeBillDate value.
2 Posted by Marvin on 10 Jan, 2011 06:34 AM
'ANNUAL_PRO_1'(plan code) is what i meant instead of 'TEST_MONTHLY_PRO_1'(customer code)
Support Staff 3 Posted by Marc Guyer on 11 Jan, 2011 04:23 PM
Hi Marvin -- Sorry for the delay. You're missing a nested array for charges. You'll also need to include the chargeCode and quantity:
4 Posted by marvin on 12 Jan, 2011 02:56 AM
Thanks so much, will try it right away...
5 Posted by marvin on 12 Jan, 2011 10:25 AM
Hi,
Still didn't work, i tried two different sets(tested one at a time). FYI im posting againts the : editCustomer:
function editCustomer($code, $id = null, array $data) {
1 - Array
(
)
2 - Array
(
)
Support Staff 6 Posted by Marc Guyer on 12 Jan, 2011 03:25 PM
Ahh, I assumed you were creating a new customer. The new customer call is the only one where you can provide charges inline. Here's the raw docs on the edit customer call:
https://cheddargetter.com/developers#update-customer-subscription
If you'd like to add a charge to an existing customer's account, just use the add charge call. Here are the raw docs on that:
https://cheddargetter.com/developers#add-charge
Since you appear to be using the official PHP wrapper, you can use CheddarGetter_Client::addCharge()
Dean closed this discussion on 16 Jan, 2013 04:02 PM.