question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transaction.Sale AuthorizationException

See original GitHub issue

General information

  • SDK/Library version: 4.5.0
  • Environment: Sandbox
  • Language, language version, and OS: C# .NET 4.5.2 on Windows 10

Issue description

I’m trying to do a Transaction.Sale to create a new customer with a new payment method but keep getting an authorization exception when I try and pass in the Customer object field.

var gatewayRequest = new TransactionRequest
{
	Amount = 9.99m,
	MerchantAccountId = "merchantId",
	PaymentMethodNonce = "fake-valid-nonce",
	Options = new TransactionOptionsRequest
	{
		StoreInVault = true,
		SubmitForSettlement = false
	},
	Customer = new CustomerRequest
	{
		FirstName = "Joe",
		LastName = "Example"
		Email = "joe@example.com"
	}
};

The call works providing I don’t pass the Customer object.

var gatewayRequest = new TransactionRequest
{
	Amount = 9.99m,
	MerchantAccountId = "merchantId",
	PaymentMethodNonce = "fake-valid-nonce",
	Options = new TransactionOptionsRequest
	{
		StoreInVault = true,
		SubmitForSettlement = false
	}
};

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
elizabeth-youngcommented, Oct 2, 2018

Hi,

I figured it out.

A mapping I had setup from a custom model was defaulting the CustomFields dictionary to an empty dictionary.

Thanks for your help with this.

0reactions
elizabeth-youngcommented, Oct 2, 2018

Hi,

I’d implemented my own model sorry, this was badly pasted. I’ve corrected it now.

I’ve also contacted Braintree support, as I thought the error was a permission issue and they’ve said it’s because of the CustomFields field within the Customer object.

They say this is the error from their logs

[AUTHORIZATION] The following params are unknown (typo, wrong name, improper nesting, etc.): [\"transaction[customer][custom_fields]\"]
Read more comments on GitHub >

github_iconTop Results From Across the Web

AuthorizationException while sending a payment request ...
Options.StoreInVault = true; var result = _gateway.Transaction.Sale(request);. What I'm missing?
Read more >
Braintree: Payment Failed Authorization Exception
Raised when your Braintree API keys used to setup your payment gateway integration are incorrect. Common Causes For This Error. Entering incorrect values...
Read more >
REST Error Codes
Sales and use tax determination and exemption certificate management ... 31, AuthorizationException, Your account is not authorized to call this API.
Read more >
Exceptions | .NET - Braintree Developer Documentation
AuthorizationException. Raised when the API key that you're using is not authorized to perform the attempted action according to the role assigned to...
Read more >
user 'xx##' is not authorized to take action 'inquire' on targets ...
What do I do if I receive the error message, "AuthorizationException: user 'xx##' is ... just close the Incident Report page, and continue...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found