Add payment method for new tenant fails

179 views
Skip to first unread message

keda...@gmail.com

unread,
Aug 18, 2016, 3:26:02 AM8/18/16
to Kill Bill users mailing-list
Hi,

I am getting bad request exception when adding a payment method in brain tree through kill bill for new tenant.

The API that I am calling is 1.0/kb/accounts/{1}/paymentMethods and below is JSON request body

"{\"name\":\"w19 X\",\"firstNameLength\":3,\"email\":\"w...@test.com\",\"externalKey\":\"74472527\",\"currency\":\"GBP\"}"

Things work fine with 'bob' tenant but fails with new tenant that I have created.

I have verified the brain tree plugin config for 'bob' and new tenant account and they are same.

The exception or the documentation of kill bill is not detail.

Any help is appreciated.


thanks,
Kedar.

Pierre-Alexandre Meyer

unread,
Aug 18, 2016, 4:13:22 PM8/18/16
to Kedar Nagella, Kill Bill users mailing-list
Hello Kedar,

Could you share the full cURL command you are sending as well as Kill Bill logs and the response from the server (headers, etc.)?

Thanks,


--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/2f5fb75a-ecd0-4d3b-aa1c-b44d8988b055%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Pierre

keda...@gmail.com

unread,
Aug 19, 2016, 1:36:27 AM8/19/16
to Kill Bill users mailing-list, keda...@gmail.com
Hi,

Could you please let me know how to get the logs. And I am using postman requests to set up the configuration.

thanks,

On Friday, 19 August 2016 01:43:22 UTC+5:30, Pierre-Alexandre Meyer wrote:
> Hello Kedar,
>
>
> Could you share the full cURL command you are sending as well as Kill Bill logs and the response from the server (headers, etc.)?
>
>
> Thanks,
>
>
>
> On Thu, Aug 18, 2016 at 12:26 AM, <keda...@gmail.com> wrote:
> Hi,
>
>
>
> I am getting bad request exception when adding a payment method in brain tree through kill bill for new tenant.
>
>
>
> The API that I am calling is 1.0/kb/accounts/{1}/paymentMethods and below is JSON request body
>
>
>
> "{\"name\":\"w19 X\",\"firstNameLength\":3,\"email\":\"w...@test.com\",\"externalKey\":\"74472527\",\"currency\":\"GBP\"}"
>
>
>
> Things work fine with 'bob' tenant but fails with new tenant that I have created.
>
>
>
> I have verified the brain tree plugin config for 'bob' and new tenant account and they are same.
>
>
>
> The exception or the documentation of kill bill is not detail.
>
>
>
> Any help is appreciated.
>
>
>
>
>
> thanks,
>
> Kedar.
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
>
> To post to this group, send email to killbill...@googlegroups.com.

keda...@gmail.com

unread,
Aug 19, 2016, 3:03:44 AM8/19/16
to Kill Bill users mailing-list, keda...@gmail.com
Hi Pierre,

the log on the server seems to be like below

catalina-exec-12 192.168.42.105 [19/Aug/2016:07:05:34 +0000] "POST /1.0/kb/accounts/d372e7bc-4639-4f21-b6fb-adede63db99e/paymentmethods http/1.1" 400 311 529 525

and the postman request is


POST /payments/paymentMethods HTTP/1.1
Host: localhost:65214
Accept: application/json
Content-Type: application/json
Authorization: bearer xxxxx
Cache-Control: no-cache
Postman-Token: 32be3b32-6b4a-307e-3aa7-edb49c7f5a6e

{
"nonce": "2d01410b-f44c-49ad-85c2-f1a6b635e358"
}


I got this from the Linux box and not sure if there is a better way to get logs with more details. Please point to me documentation on how to get the logs

thanks


On Friday, 19 August 2016 01:43:22 UTC+5:30, Pierre-Alexandre Meyer wrote:
> Hello Kedar,
>
>
> Could you share the full cURL command you are sending as well as Kill Bill logs and the response from the server (headers, etc.)?
>
>
> Thanks,
>
>
>
> On Thu, Aug 18, 2016 at 12:26 AM, <keda...@gmail.com> wrote:
> Hi,
>
>
>
> I am getting bad request exception when adding a payment method in brain tree through kill bill for new tenant.
>
>
>
> The API that I am calling is 1.0/kb/accounts/{1}/paymentMethods and below is JSON request body
>
>
>
> "{\"name\":\"w19 X\",\"firstNameLength\":3,\"email\":\"w...@test.com\",\"externalKey\":\"74472527\",\"currency\":\"GBP\"}"
>
>
>
> Things work fine with 'bob' tenant but fails with new tenant that I have created.
>
>
>
> I have verified the brain tree plugin config for 'bob' and new tenant account and they are same.
>
>
>
> The exception or the documentation of kill bill is not detail.
>
>
>
> Any help is appreciated.
>
>
>
>
>
> thanks,
>
> Kedar.
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
>
> To post to this group, send email to killbill...@googlegroups.com.

Pierre-Alexandre Meyer

unread,
Aug 19, 2016, 12:28:34 PM8/19/16
to Kedar Nagella, Kill Bill users mailing-list
On Fri, Aug 19, 2016 at 12:03 AM, <keda...@gmail.com> wrote:
I got this from the Linux box and not sure if there is a better way to get logs with more details. Please point to me documentation on how to get the logs

How did you install Kill Bill? Tomcat has a logs directory which should contain the log files.

Also, the body { "nonce": "2d01410b-f44c-49ad-85c2-f1a6b635e358" } doesn't match what's expected by Kill Bill. Could you try the cURL commands from https://github.com/killbill/killbill-braintree-blue-plugin to make sure it's not an issue with your Postman setup? 

--
Pierre

keda...@gmail.com

unread,
Aug 22, 2016, 4:07:35 AM8/22/16
to Kill Bill users mailing-list, keda...@gmail.com
Hi Pierre,

I just did another test; I sent similar request for bob tenant account and another tenant account and get different responses, would you be able to help in finding what is wrong, in below request nonce is invalid (expired).

I am suspecting the issue could be with the new tenant setup but not able to find the issue, your help will be appreciated


**** BOB account request: ****

curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Killbill-ApiKey: bob" -H "X-Killbill-ApiSecret: lazar" -H "X-Killbill-CreatedBy: Postman" -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" -H "Cache-Control: no-cache" -H "Postman-Token: fdb1417c-bdac-d7fb-9547-37164140975e" -d '{
"pluginName":"killbill-braintree_blue",
"pluginInfo":{
"properties":[
{
"key":"customer",
"value":"51971342"
},
{
"key":"token",
"value":"53d6fca5-fce5-4efb-8281-66e6b56f6fa0"
}
]
}
}' "http://192.168.44.71:8080/1.0/kb/accounts/32942f20-cded-477d-a01a-f5a708ccf771/paymentMethods"


RESPONSE

{
"className": "org.killbill.billing.payment.api.PaymentApiException",
"code": 7005,
"message": "Failed to add payment method for account 32942f20-cded-477d-a01a-f5a708ccf771 : CVV is required. (81706) Unknown or expired payment_method_nonce. (91732) Postal code is required. (81808)",
"causeClassName": null,
"causeMessage": null,
"stackTrace": []
}


***** OTHER tenant request

curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Killbill-ApiKey: sqhMobile3" -H "X-Killbill-ApiSecret: sqhMobile3" -H "X-Killbill-CreatedBy: Postman" -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" -H "Cache-Control: no-cache" -H "Postman-Token: f7fa5cf3-1bc9-1083-6acd-cc8ecf68043f" -d '{
"pluginName":"killbill-braintree_blue",
"pluginInfo":{
"properties":[
{
"key":"customer",
"value":"32085918"
},
{
"key":"token",
"value":"53d6fca5-fce5-4efb-8281-66e6b56f6fa0"
}
]
}
}' "http://192.168.44.71:8080/1.0/kb/accounts/3c475228-d1d1-4661-a7d6-a6ec0a870e13/paymentMethods"


RESPONSE
{
"className": "org.killbill.billing.payment.api.PaymentApiException",
"code": 7005,
"message": "Failed to add payment method for account 3c475228-d1d1-4661-a7d6-a6ec0a870e13 : can't convert Symbol into Integer",
"causeClassName": null,
"causeMessage": null,
"stackTrace": []
}

thanks,
Kedar

Pierre-Alexandre Meyer

unread,
Aug 22, 2016, 10:58:05 AM8/22/16
to Kedar Nagella, Kill Bill users mailing-list
On Mon, Aug 22, 2016 at 1:07 AM, <keda...@gmail.com> wrote:
I just did another test; I sent similar request for bob tenant account and another tenant account and get different responses, would you be able to help in finding what is wrong, in below request nonce is invalid (expired).

I am suspecting the issue could be with the new tenant setup but not able to find the issue, your help will be appreciated

Did you configure the plugin in the other tenant, as described in the README (https://github.com/killbill/killbill-braintree-blue-plugin)? The cURL configuration command needs to be run for each tenant.

You can verify it by looking at the tenant_kvs table, which should contain one entry like this for each tenant (properly indented):

:braintree_blue:
  :merchant_id: ABC
  :public_key: DEF
  :private_key: GHI

--
Pierre

keda...@gmail.com

unread,
Aug 23, 2016, 4:23:10 AM8/23/16
to Kill Bill users mailing-list, keda...@gmail.com
Hi Pierre,

Looks like the issue was the with the configuration as it had single quote at the beginning.

Below is the command that worked

curl -X POST -H "Accept: application/json" -H "Content-Type: text/plain" -H "X-Killbill-ApiKey: sqhMobile3" -H "X-Killbill-ApiSecret: sqhMobile3" -H "X-Killbill-CreatedBy: Postman" -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" -H "Cache-Control: no-cache" -H "Postman-Token: 892b0718-7db6-93e9-73a4-32c654219813" -d ':braintree_blue:
:merchant_id: yd5tj4y7mxgpynsc
:public_key: w7bf45wc7pdns3jj
:private_key: f03ad35013a910b3e6f8077c3bea402d' "http://192.168.44.71:8080/1.0/kb/tenants/uploadPluginConfig/killbill-braintree_blue"

thanks,
Kedar.

Reply all
Reply to author
Forward
0 new messages