Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 13 of 13

Thread: Protx/SagePay changes

  1. #1
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default Protx/SagePay changes

    when a customer completes the payment the process via protx/sagepay the customer order number is appended to the ventorTXCode in sagepay.

    Can it be changed so it puts the customer id number instead.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  2. #2
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Yes, this is possible. You will need to modify the Protx.cs from the ASPDNSFGateways project, then modify these lines:
    Code:
    string vendorTxCode = OriginalOrderNumber.ToString() + "-" + System.Guid.NewGuid().ToString("N");
    
    String vendorTxCode = OrderNumber.ToString() + "-" + System.Guid.NewGuid().ToString("N");
    Sample change:
    FROM OrderNumber.ToString() TO CustomerID.ToString()

    I'm not sure how it would affect the transaction over the payment gateway itself, we don't have control over that aspect; hence, I strongly suggest you pay extra careful with this, especially if you're live.
    Last edited by MelanieA; 07-29-2009 at 10:46 AM.

  3. #3
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Jao

    Thank you for your reply...

    Am I right in assuming that all instances of OrderNumber.ToString needs to be changed to CustomerID.ToString in the two lines that you mention above?

    Thanks...
    Last edited by DotNetDevelopments; 07-27-2009 at 05:54 AM.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  4. #4
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Nope, only those instances I presented. Hence, on the definition of the string type vendorTxCode, its initial string value is CustomerID then the succeeding transaction information will be appended to it.

  5. #5
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Jao

    Forgive my ignorance but I need to understand the process of modify the source code...

    I have located the protx.cs file in the ASPDotNetStoreFront V8.0.1.1\ASPDNSFGateways directory and made the changes as you suggest, I have then replaced the original file with the modifed file and tested a transaction, but no change!?!?

    Is there a part of the puzzle that I am missing?

    Regards
    Adam
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  6. #6
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Jao

    Also, I have noticed some code below the lines you suggest to modify

    DB.ExecuteSQL("update orders set RefundTXCommand=" + DB.SQuote(vendorTxCode + "|" + TransID) + " where OrderNumber=" + OriginalOrderNumber.ToString());
    I am concerned that these changes may have an adverse effect when we attempt a refund - am I correct??!

    Regards
    Adam
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  7. #7
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    After making the changes, did you rebuild the project? Please also make sure that the site is correctly referenced to the newly built assembly (AspDotNetStorefrontGateways.dll). Yes, I'm afraid it will have an effect, considering that refund query is actually tied to the Order number, not on the Customer ID.

  8. #8
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Thanks for the reply. However could you please explain what it means to "rebuild the project"? thanks.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  9. #9
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Launch your Visual Studio 2008 and open your solution. Apply the changes on the Protx.cs. Check the Build>Configuration Manager... Set the Active Solution Configuration to Release and Mixed Platform for the Active Solution Platform, Click Close. From the Solution Explorer pane, right-click on the project name: AspDotNetStorefrontGateways and select Rebuild. That's how you rebuild a project.

  10. #10
    Dimmer is offline Member
    Join Date
    May 2008
    Location
    London
    Posts
    40

    Default

    only problem I foresee is that Sagepay requires a totally unique vendor tx code for each attempt at payment, if you use the account the customer may not be able to have 2 payment attempts as the code will be the same. Its worth testing before going live.

    Alan
    Alan
    Version (Code/DB): AspDotNetStorefront ML 7.1.0.0/7.1.1.0 - with modifications
    www.stuff-uk.net

  11. #11
    DanV's Avatar
    DanV is offline Ursus arctos horribilis
    Join Date
    Apr 2006
    Posts
    1,568

    Default

    The code that Jao posted above appends the customer ID to a new GUID, so it should be fine for uniqueness.

  12. #12
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Jao / Dan

    Back to this again I'm afraid...

    Have been churning through the payments and matching them off ans I need to understand this again as I think it can work..

    The VendorTXCode presented is currently as follows:
    OrderNumber-154013127a514f73a569aa4be95ce6ef

    The order number followed by a completely unique string??? If this is the case surely by just changing the OrderNumber to the CustomerID it still keep the uniqueness required by SagePay/Protx ? And surely this then makes refunds possible through ASPDNSF backoffice without any further modifications?

    Thanks in advance...
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  13. #13
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    The CustomerID does not exist in the current context is the error I get is I try and replace the OrderNumber with CustomerID.

    We really need the customer id in the order. This will save us a lot of work in the future.

    We want to change both of the vendorTxCode that use order numbers to use customer id. Then we will change the SQL statment to accept this. These two part are the easy parts.

    The part we need help with is been able to use CustomerID in the Protx.cs

    Thanks in advance.

    Edit:
    We ahve been looking through the Protx.cs code and seen that the changes only affect voiding the order and refunds. Not the data sent to Protx. We need to change the string that is send to Protx at the time of order. I believe the solution to this lays in the Order class. However I can not pin point it.

    Any help with this?
    Last edited by DotNetDevelopments; 11-24-2009 at 08:07 AM.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience