Rank: Advanced Member
Groups: Authorized User, Developers Joined: 7/1/2022(UTC) Posts: 71
Thanks: 5 times Was thanked: 1 time(s) in 1 post(s)
|
Hi, I'm trying to test out braintree integration with their sandbox. This is using 9.0.9. I believe I have the gateway configured correctly with a merchant id and token. When I try using it, InialializeBraintreeJS throws an out of bound exception here: clientToken = braintreeProvider.GenerateClientToken(AbleContext.Current.UserId); which is inside a try/catch, which makes me think this isn't out of the ordinary? This happens before I get to the payment page. On the actual payment page, the "processing" never finishes. This is the full exception: - Exception: Index was outside the bounds of the array. Stack Trace: at Braintree.CredentialsParser.GetEnvironment(String credential) at Braintree.CredentialsParser..ctor(String accessToken) at Braintree.Configuration.set_AccessToken(String value) at Braintree.Configuration..ctor(String accessToken) at Braintree.BraintreeGateway..ctor(String accessToken) at CommerceBuilder.Payments.Providers.PayPalBraintree.BraintreeProvider.get_Gateway() at CommerceBuilder.Payments.Providers.PayPalBraintree.BraintreeProvider.GenerateClientToken(Int32 userId) at AbleCommerce.Controllers.CheckoutController.IntializeBraintreeJS(PaymentGateway braintreeGateway, IEnumerable`1 cardTypes) in Controllers\CheckoutController.cs:line 1537 - EDIT: I get the same error with out of box code, unmodified. Please advise. Thanks, Charles Edited by user Friday, December 6, 2024 5:05:04 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 7/1/2022(UTC) Posts: 71
Thanks: 5 times Was thanked: 1 time(s) in 1 post(s)
|
I dug into Braintree.CredentialsParser.GetEnvironment(String credential) and it appears it's expecting the credential to be delimited with $: - private Environment GetEnvironment(string credential) { char[] chArray = new char[1]{ '$' }; return Environment.ParseEnvironment(credential.Split(chArray)[1]); } - This leads me to believe I don't have the correct token in my sandbox setup? The AC merchant guide isn't very helpful when it says: - Access Token = Your Braintree Access Key - what exactly is Braintree Access Key, and where do I get it? I see all sorts of info in the braintree sandbox API listing, but nothing that says "Access Key". I'm currently trying to use a "tokenization key", which looks to be delimited by underscores. It starts with "sandbox_". Thanks. Edited by user Friday, December 6, 2024 5:43:13 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: System, Administrators, Developers, Registered, HelpDesk Joined: 10/29/2018(UTC) Posts: 472
Thanks: 4 times Was thanked: 34 time(s) in 33 post(s)
|
|
Thanks for your support!
Katie Secure eCommerce Software and Hosting |
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 7/1/2022(UTC) Posts: 71
Thanks: 5 times Was thanked: 1 time(s) in 1 post(s)
|
Hi, I'm not sure what you mean? I'm using the braintree plugin in AC, referenced here: https://help.ablecommerc...Gateways%2FBraintree.htmI'm using a tokenization token, and am getting the above error. There's nothing on the merchant guide that says we're using OAuth??
|
|
|
|
Rank: Advanced Member
Groups: System, Administrators, Developers, Registered, HelpDesk Joined: 10/29/2018(UTC) Posts: 472
Thanks: 4 times Was thanked: 34 time(s) in 33 post(s)
|
When you use the "Connect to Braintree Payment Gateway" instructions, that is using Oauth. Otherwise, there are some links that allow you to bypass and manually enter the Access Token per step. 3 of "Configure Braintree Payment Gateway" instructions. Quote:This leads me to believe I don't have the correct token in my sandbox setup? The links I provided should help you to obtain the correct access token. If not, maybe you can try to connect by using the "Connect with Braintree" button link provided on the setup screen. Have you turned on debug for the gateway and checked inside the log file? |
Thanks for your support!
Katie Secure eCommerce Software and Hosting |
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 7/1/2022(UTC) Posts: 71
Thanks: 5 times Was thanked: 1 time(s) in 1 post(s)
|
Hi, the OAuth automation worked, and I ended with a $ delimited access token, as the code implies it requires.
For future reference, the Access Token is from OAuth in Connected Apps. It is NOT a tokenization key or anything else under the API.
It would be helpful if the merchant guide was updated to properly reflect this? Right now, all the merchant guide says for manual setup is "Access Token = Your Braintree Access Key".
Thanks, Charles
|
|
|
|
Rank: Advanced Member
Groups: System, Administrators, Developers, Registered, HelpDesk Joined: 10/29/2018(UTC) Posts: 472
Thanks: 4 times Was thanked: 34 time(s) in 33 post(s)
|
Hi Charles,
This might be a bug. The manual entry of the key was supposed to allow access if you do not use the Oauth connection. I will need to check with the developers and find out for sure.
Either way, I agree the documentation is too vague and needs to be fixed.
Thanks for providing an update. Really appreciate that. |
Thanks for your support!
Katie Secure eCommerce Software and Hosting |
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 7/1/2022(UTC) Posts: 71
Thanks: 5 times Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: Katie S Hi Charles,
This might be a bug. The manual entry of the key was supposed to allow access if you do not use the Oauth connection. I will need to check with the developers and find out for sure.
Either way, I agree the documentation is too vague and needs to be fixed.
Thanks for providing an update. Really appreciate that. I can manually enter the data. The challenge not knowing what data to enter!
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close