Skip to content

Hosted payment page error after filling out payment information #99

Open

Description

@sstalder

Steps to reproduce:

  • Run sample for GetAnAcceptPaymentPage
  • Redirect to payment page via the code below
<form action="https://test.authorize.net/payment/payment" method="post">
	<input type="text" name="token" value="token value here" />
	<hr />
	<button type="submit">Pay</button>
</form>
  • Fill out form with test credit card information
Credit Card #: 4111111111111111
Credit Card Exp: 11/21
Credit Card Code: 907

Upon clicking pay you get an error "Unexpected error. Please try again."

I have tried several different ways to generate the token as well as several different types of credit card numbers (all test numbers) and amounts, etc. I cannot get a working sample to go through.

I even tried to do this in a production environment and had the same result. Can someone please let me know what exactly this error is?

You can duplicate the error using the sample codes api login or with any generated one from the sandbox.

Activity

  1. gnongsie commented on Mar 6, 2019

    @gnongsie
    Contributor

    Hi,
    Apologies for the inconvenience caused.
    There seems to be a bug in the way that DateTime values are handled in the C# SDK.

    A fix has been sent and is pending release ( .NET SDK #257 ).

    Your code for doing the payment does not have any issues. I believe the issue is from the GetAnAcceptPaymentPage sample, if you are also using the order information in the request.

    A temporary workaround for this is to include a valid date for order.purchaseOrderDateUTC in the format "YYYY-mm-dd".

    transactionRequest = new transactionRequestType {
            amount = "100.00",
            transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),
            order = new orderType {
                invoiceNumber = invoiceId,
                description = invoiceId,
                purchaseOrderDateUTC = new DateTime(2018, 03, 23, 11, 00, 00, DateTimeKind.Utc)
            }
    }
    
  2. added
    has-prHas a Pull Request in place for SDK
    on Mar 6, 2019
  3. sstalder commented on Mar 6, 2019

    @sstalder
    Author

    In the .NET SDK the purchaseOrderDateUTC is a DateTime type. How are you putting a string for that value?

    Can this fix also be moved to the dotnet core sdk as well?

  4. sstalder commented on Mar 7, 2019

    @sstalder
    Author

    Unfortunately the workaround proposed doesn't appear to work. The only way I can get it to go through is to not include the "order" object.

  5. gnongsie commented on Mar 13, 2019

    @gnongsie
    Contributor

    Hi,
    Apologies for the inconvenience. I initially thought this would fix the issue.

    In any case, I have escalated this to the relevant team and will update this thread with the progress.

  6. added and removed
    has-prHas a Pull Request in place for SDK
    on Apr 5, 2019
  7. sstalder commented on May 16, 2019

    @sstalder
    Author

    Hey Gabriel, has there been any update on this issue? Thanks!

  8. esw0000000 commented on Aug 21, 2019

    @esw0000000

    Yikes. Five months later and this is still not fixed. For anyone trying to resolve this issue, I was able to get the sample code working by reverting to 1.9.6.

  9. SeriaWei commented on Mar 2, 2020

    @SeriaWei

    Is there any plan to fix this issue? I have to return to use 1.9.6 to make it works.

  10. ahawes-clarity commented on Apr 15, 2020

    @ahawes-clarity

    Almost a year later. Any fix for this?

  11. w7tcp commented on Mar 3, 2021

    @w7tcp

    Still an issue as of now. Workarounds are either to leave the 'order' undefined, or to revert to dotnet SDK version 1.9.6. On reviewing the API documentation here, it seems like the orderType object has a lot of new fields in version 1.9.7 and later, that don't seem to be defined in the API as of today.

  12. popisms commented on Apr 29, 2024

    @popisms

    FIVE YEARS LATER, and this bug still has not been fixed.

  13. krunalp-pulse commented on Dec 23, 2024

    @krunalp-pulse

    I had the same problem with the most recent versions, however it was resolved once I used version 1.9.6.
    Does anyone want a demo code for that?

  14. Elizabeth-has commented on Jan 29, 2025

    @Elizabeth-has

    Steps to reproduce:

    • Run sample for GetAnAcceptPaymentPage
    • Redirect to payment page via the code below
    <form action="https://test.authorize.net/payment/payment" method="post">
    	<input type="text" name="token" value="token value here" />
    	<hr />
    	<button type="submit">Pay</button>
    </form>
    
    • Fill out form with test credit card information
    Credit Card #: 4111111111111111
    Credit Card Exp: 11/21
    Credit Card Code: 907
    

    Upon clicking pay you get an error "Unexpected error. Please try again."

    I have tried several different ways to generate the token as well as several different types of credit card numbers (all test numbers) and amounts, etc. I cannot get a working sample to go through.

    I even tried to do this in a production environment and had the same result. Can someone please let me know what exactly this error is?

    You can duplicate the error using the sample codes api login or with any generated one from the sandbox.

  15. devGBG commented on Feb 5, 2025

    @devGBG

    Any update on the issue?

  16. esw0000000 commented on Feb 5, 2025

    @esw0000000

    Any update on the issue?

    There are open issues going back six years. The last functional version appears to be 1.9.6. It's essentially abandonware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions