sorentwo / braintree-elixir

:credit_card: Native elixir client for Braintree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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: