Closed Lwdthe1 closed 5 years ago
Hmmm.... I just removed the customFields and it worked. But I have the custom field that I want to pass in configured in my sandbox:
Are custom fields not allowed for subscriptions?
Custom fields are not supported for subscriptions.
You can create a subscription object in your own database that correlates with the Braintree one and include any custom fields you need.
Also, no need to use Q
. gateway.subscription.create
will return a promise if no callback is provided.
Thanks for clarifying.
As for the Q()
wrapping, I need to do that because I use Q as my promise library, which uses .fail()
, whereas the gateway uses .catch()
. Mongoose allows for me to set my preferred promise library, but I have not found a way to do that with Briantree. Is that possible?
No, there's no global configuration for what promise library to use. According to the Q documentation, you can use catch
if using a version of node that supports promises.
General information
Issue description
I am trying to test my custom integration of purchasing a subscription. Everything works until I try to run
gateway.subscription.create({})
, which fails with an authorization error. I use thebraintree.Test.Nonces.Transactable
nonce andfake-valid-no-billing-address-nonce
; both succeed to create a payment method and give me a paymentMethodToken.It'd be nice if the authorization error said more about why the error occurred, but all I get is this:
My code:
Thanks in advance for your help.