Trouble with subscription add_ons
mpranjic opened this issue · comments
I am getting "Invalid request format."
when trying to create a subscription with :add_ons
.
add_ons = %{add: [%{inherited_from_id: "myaddon"}]}
Braintree.Subscription.create(%{plan_id: "myplan", payment_method_token: "token", add_ons: add_ons})
Am I using it right?
If I omit add_ons
, subscription is created.
I am assuming the problem is in XML Encoder, but...
So I traced it down to two issues:
- array items need to be in
<item>...</item>
- arrays need to be marked as
type="array"