Braintree service plans manual billing run

401 views
Skip to first unread message

Lucas

unread,
May 21, 2015, 8:10:44 PM5/21/15
to 2600h...@googlegroups.com
I've set up a sandbox Braintree account and a service plan according to the instructions provided in a previous post in this Google Group and the related Confluence article. Adding credit to an account posts a transaction to Braintree so it appears that part is set up correctly.

When I do a manual reconciliation (sup whistle_services_maintenance reconcile) I see in the kazoo logs that the accounts are being queried and that the DIDs, devices, etc are found and costs are calculated according to the service plan.

How do I manually run billing and post the charges to Braintree? I've tried the "sup whistle_services_maintenance sync <account_id>" and appears to determine which credit card to charge based on the reseller status of the account, however, nothing shows up in Braintree.

Is there something obvious that I'm missing here?

Thanks,
Lucas


Lucas

unread,
May 22, 2015, 7:15:02 PM5/22/15
to 2600h...@googlegroups.com
I believe I'm starting to narrow down on the problem. It appears that the sup...sync command is attempting to post a subscription to Braintree but I'm getting the error:

May 22 23:05:49 awe01 2600hz[21158]: |977aac8c124ae164f1d9c861f9c3d887-sync|wh_bookkeeper_braintree:575 (<0.21438.3>) requesting braintree customer 977aac8c124ae164f1d9c861f9c3d887
May 22 23:05:49 awe01 2600hz[21158]: |977aac8c124ae164f1d9c861f9c3d887-sync|braintree_request:69 (<0.21438.3>) making get request to braintree /customers/977aac8c124ae164f1d9c861f9c3d887
May 22 23:05:50 awe01 2600hz[21158]: |977aac8c124ae164f1d9c861f9c3d887-sync|braintree_request:112 (<0.21438.3>) braintree xml response(521ms)
May 22 23:05:50 awe01 2600hz[21158]: |977aac8c124ae164f1d9c861f9c3d887-sync|braintree_util:169 (<0.21438.3>) Subscription not found
May 22 23:05:50 awe01 2600hz[21158]: |977aac8c124ae164f1d9c861f9c3d887-sync|wh_bookkeeper_braintree:617 (<0.21438.3>) creating new subscription for plan id SIP_Services
May 22 23:05:50 awe01 2600hz[21158]: |977aac8c124ae164f1d9c861f9c3d887-sync|braintree_request:69 (<0.21438.3>) making post request to braintree /subscriptions/
May 22 23:05:50 awe01 2600hz[21158]: |977aac8c124ae164f1d9c861f9c3d887-sync|braintree_request:112 (<0.21438.3>) braintree xml response(613ms)
May 22 23:05:50 awe01 2600hz[21158]: |977aac8c124ae164f1d9c861f9c3d887-sync|braintree_request:165 (<0.21438.3>) braintree api error response
May 22 23:05:50 awe01 2600hz[21158]: |977aac8c124ae164f1d9c861f9c3d887-sync|braintree_util:217 (<0.21438.3>) {"errors":[{"code":"92013","message":"Inherited From ID is invalid.","attribute":"inherited_from_id"},{"code":"92013","message":"Inherited From ID is invalid.","attribute":"inherited_from_id"},{"code":"92013","message":"Inherited From ID is invalid.","attribute":"inherited_from_id"}],"verification":{},"message":"Inherited From ID is invalid.\nInherited From ID is invalid.\nInherited From ID is invalid."}
May 22 23:05:50 awe01 2600hz[21158]: |977aac8c124ae164f1d9c861f9c3d887-sync|wh_service_sync:251 (<0.21438.3>) bookkeeper error: {api_error,{[{<<"api_error">>,{[{<<"errors">>,[{[{<<"code">>,<<"92013">>},{<<"message">>,<<"Inherited From ID is invalid.">>},{<<"attribute">>,<<"inherited_from_id">>}]},{[{<<"code">>,<<"92013">>},{<<"message">>,<<"Inherited From ID is invalid.">>},{<<"attribute">>,<<"inherited_from_id">>}]},{[{<<"code">>,<<"92013">>},{<<"message">>,<<"Inherited From ID is invalid.">>},{<<"attribute">>,<<"inherited_from_id">>}]}]},{<<"verification">>,{[]}},{<<"message">>,<<"Inherited From ID is invalid.\nInherited From ID is invalid.\nInherited From ID is invalid.">>}]}}]}}

Notably, Kazoo is attempting to create a new subscription for the defined "SIP_Services" in the service plan and it's failing. I've created a new recurring billing plan in Braintree and set the Plan ID to match the service plan name "SIP_Services" but there's no effect.

Regards,
Lucas

Lucas

unread,
May 25, 2015, 4:10:53 PM5/25/15
to 2600h...@googlegroups.com
I've managed to figure this out with the help of https://github.com/stormqloud/kazoo-tgbbok/blob/master/service_plans.md.

Essentially, the piece I was missing (somewhat indicated in the error message) were the add-on's that need to be manually created in the Braintree subscription that match the id's set in the Kazoo service plan doc.

This can be considered resolved!

Regards,
Lucas


On Thursday, May 21, 2015 at 5:10:44 PM UTC-7, Lucas wrote:
Reply all
Reply to author
Forward
0 new messages