Comments (6)
I'm investigating your issue and have two questions.
-
Are you using the gateway model ( SubscriptionGateway) or the new controller model (ARBCreateSubscriptionController)?
-
Can you include the line of code where your are executing the request?
Thanks
from sdk-dotnet.
I am using the SubscriptionGateway. Here's my simple code:
The exception's Data field is empty, there is no way to get the error codes.
from sdk-dotnet.
Thanks. I'm able to repro it now.
from sdk-dotnet.
I have reproed the issue, and you are right, error handling is not ideal for the gateway model.
We are looking at how to handle the issue.
Going forward, the best approach would be to use the new "Controller" model.
Using the new model, your sample would look like this:
[Test]
public void TestSubscription_ExpiredCC()
{
Random rnd = new Random(DateTime.Now.Millisecond);
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = CustomMerchantAuthenticationType;
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = TestEnvironment;
//create a subscription
var subscriptionDef = new ARBSubscriptionType
{
paymentSchedule = new paymentScheduleType
{
interval = new paymentScheduleTypeInterval
{
length = 7,
unit = ARBSubscriptionUnitEnum.days
},
startDate = DateTime.UtcNow,
totalOccurrences = 2,
},
amount = 9.99M,
billTo = new nameAndAddressType
{
address = "1234 Elm St NE",
city = "Bellevue",
state = "WA",
zip = "98007",
firstName = "First",
lastName = "Last"
},
payment = new paymentType
{
Item = new creditCardType
{
cardCode = "655",
cardNumber = "4007000",
expirationDate = "122013",
}
},
customer = new customerType { email = "[email protected]", id = "5", },
order = new orderType { description = string.Format("member monthly {0}", rnd.Next(99999)) },
};
var arbRequest = new ARBCreateSubscriptionRequest { subscription = subscriptionDef };
var arbController = new ARBCreateSubscriptionController(arbRequest);
arbController.Execute();
var arbCreateResponse = arbController.GetApiResponse();
//If request responds with an error, walk the messages and get code and text for each message.
if (arbController.GetResultCode() == messageTypeEnum.Error)
{
foreach(var msg in arbCreateResponse.messages.message)
{
Console.WriteLine("Error Num = {0}, Message = {1}", msg.code, msg.text);
}
}
}
from sdk-dotnet.
I have added a sample to the future branch, that walks through the error messages returned by a failed create subscription request.
Gorgi, does this resolve your issue?
from sdk-dotnet.
We switched to the new Controller model. Thanks!
from sdk-dotnet.
Related Issues (20)
- CustomerProfileId is not returned in createCustomerProfile response HOT 1
- Error: authorize.net dose not contain a defination for environment
- Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.3.0 HOT 2
- Concurrency and multi-thread issues HOT 4
- Net core 3.1
- API DUKPT | Need Help, in person payment with IDTech SRED
- E00003:The element 'order' in namespace 'Anet .. xsd' has invalid child element 'invoiceNumber' in namespace 'Anet .. xsd'. HOT 2
- Updating package from 1.9.4 to 2.0.2 breaks the code HOT 2
- nuget package incompatible with PackageReference
- Issue and Proposed Fix for : the type initializer for 'AuthorizeNet.Util.HttpUtility' error HOT 13
- How do we refund a bank account acquired via Accept.js?
- Support for .net 6 core? HOT 3
- The remote name could not be resolved: 'api2.authorize.net'
- Proxy credentials
- updateCustomerPaymentProfileRequest() in sdk-dotnet does NOT contain excludeFromAccountUpdater
- .net 7 Compile and build HOT 2
- Adding orderType to transactionRequestType failing since version 1.9.7
- Unable to process a transaction in the Sandbox HOT 1
- Setting up InvoiceNumber for authCaptureTransaction using GetAnAcceptPaymentPage is throwing an unexpected error. HOT 1
- Authorize net not giving card type for few Discover testing cards
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk-dotnet.