cancel
Showing results for 
Search instead for 
Did you mean: 

OrderType is causing Unexpected error during Payment withour ordertype payment working successful

I would like to know if there are any dependencies or relationship exists with OrderType while creating CreateAnHostedPaymentPage. 

 

Reason being, when I dont add OrderType with OrderId, payment is successful

When I add OrderType with OrderId, I get unexpected error when I click on Pay button of accept hosted form within IFrame

mvkotekar1983
Contributor
23 REPLIES 23

Any updae on this would be of great help. 

Finally my senior spent a week of time and got it resolved for me :( .

 

New version: 1.9.7 Does not work. [Added more fields to OrderType]

Old Version: 1.9.6 Does work.  [Existing fields were very few]

 

The problem could be rooted in the way how Authorize.net upgraded their version.

 

Authorize.Net might have broken existing API. 

 

For now, we are building our project with an older version of Authorize.Net and releasing to the client. 

CC: @Anurag <Please confirm if our investigation is correct or if we are missing something>

We are having the same exact issue.  We were also using v1.9.7 of the Authorize.Net nuget package and had to roll back to v1.9.6 to get around it.  If we called without setting the order with the orderType the transaction would go through.   When we added that it fails.  The message in the Authorize.Net iframe just says an "unexpected error has occured" in red at the bottom.  We are currently switching over from SIM to Accept.  Something must have broken this in v1.9.7, hopefully a fix is coming.   See our code snippet below.  If we didn't set the order on the transactionRequest it worked.  When we did it broke as described above and in this post.

 

//address information
var billAddress = new customerAddressType
{
firstName = currentBillingRecord.BillingFirstName,
lastName = currentBillingRecord.BillingLastName,
address = currentBillingRecord.BillingAddress.StreetAddress1,
city = currentBillingRecord.BillingAddress.City,
state = currentBillingRecord.BillingAddress.StateProvinceCode,
zip = currentBillingRecord.BillingAddress.PostalCode,
phoneNumber = phoneNumber
};

var order = new orderType
{
invoiceNumber = orderNumber,
};

var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authOnlyTransaction.ToString(), // authorize only
amount = amount,
billTo = billAddress,
order = order
};

 

Regards,
TC

 

Same issue here. 

I am converting from SIM to Accept Hosted. 

Downloaded SKD November 2018 release - 1.9.7. And was receiving "Unexpected Error" message when charging credit card. I was getting the token without any issues from getHostedPaymentPageRequest request.  But was never able to charge the credit card. 

I was able to narrow it down to orderType object, which is very important because it contains invoice number and transaction description; so, I could not afford not to pass it.

Thanks to this thread (specifically to mvkotekar1983 user), the problem was identified to the extra properties that orderType has in 1.9.7 release, which are not supported by API.

I modified 1.9.7 and recompiled and my Accept Hosted page works! I am not done with the migration. I will report back if there is anything that I needed to modify.

 

What I did, I modified orderType class implementation in 1.9.7 SDK and commented out the extra fields. orderType class is located in Api/Contracts/V1/AnetApiSchema.generated.cs file. I commented out everything except:

 

public string invoiceNumber;
public string description;
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

protected void RaisePropertyChanged(string propertyName) {

            System.ComponentModel.PropertyChangedEventHandler propertyChanged =this.PropertyChanged;

            if ((propertyChanged != null)) {

                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));

            }

        }

I also had to modify public static void orderType(orderType argument) method in requestFactoryWithSpecified.cs file. Just comment out everything in this method.

I then recompiled. And my Accept Hosted page worked!

 

schernokov
Member

Disappointed that they put out another update that still seems to have the same issue.  Tested with version 2.0.0 published Saturday, March 2, 2019 and it still has the same issues so we have to stick with version v1.9.6 still.

 

 

How do you putout a 2.0 and a 2.01 and still have this issue?

 

Are we missing something?

 

1.9.6 still works.

@TCCPGrimes01

I was about to make a suggestion but the user a few posts above me beat me to it. You can manually remove or comment out a few lines of code in the class files. Remove the members and methods of the class that are not in the schema and your API call will work. The user above points you to the appropriate lines.

We are still holding on 1.9.6 because of this issue.  We could make code changes suggested and rebuild the binaries but that is not a smooth upgrade process by any means.  I was hoping the next version would fix two versions ago...

 

I am also having the issue as everyone in this thread has experienced in both SANDBOX and PRODUCTION when using OrderType.

 

I am using AuthorizeNet v2.0.1 in a C# environment.

 

 var transactionRequest = new transactionRequestType
            {
                transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),
                amount = modelData.amount * modelData.numberOfPeople,
                customer = new customerDataType() { email = modelData.emailAddress },
                billTo = new customerAddressType() { company = modelData.companyName },

                order = new orderType()
                {
                    invoiceNumber = modelData.invoiceNumer,
                    description = "THIRD PARTY TRAINING INVOICE"
                },
            };

If I comment out the OrderType object, it goes through with no error.

So this issue still persist in 2.0.1 and we are perpetually stuck on 1.9.6 where iit works.  Again the fix being modify your files and build your own binaries seems like very poor version management.  It doesn't appear from Nuget that this package has been updated in a year. It was last updated March 20, 2019 for version 2.0.1

 

Is there a replacement to this SDK that we should be using?   

 

Regards,

TC

Ansira2300
Member