PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 9/22/2020 2:53 PM by  Will Strohl
Having issues on post backs from payment processor with custom payment method
 1 Replies
 1 Subscribed to this topic
 1 Subscribed to this forum
Sort:
You are not authorized to post a reply.
Author Messages





New Member






--
9/20/2020 10:18 PM
    Hello,
    Below is some odd behavior I’ve been running into while developing a Custom Payment Method following the scaffolding described here (https://hotcakescommerce....ent-Method-Example).

    In a nutshell the payment processor that I am integrating with works similar to the way a Paypal redirect payment would. The user clicks the “Place Order” button and is redirected to the payment processor where they make the payment and then are redirected back to the HotCakes store where the payment info is logged and the receipt is displayed.

    Here is the odd behavior that has been occurring:

    1. When I complete a checkout with an admin account the beginning of the checkout process behaves correctly. When completing the checkout and getting redirected to the HotCakes store (url being something like www.OurTestServer.com/HotCakes/Checkout/ctl/ThirdPartyPayment/mid/434) there are sometimes when the order is processed correctly. In these cases the Receipt page is displayed and the order is processed correctly. On many of the successful transactions the receipt page is displayed but I find that I am automatically signed in as the test user that I checked out as. So while I originally signed in with ,for example, “AdminUser Test” after the transaction is completed I find that I am now signed in as , say, John Test if that was the billing/shipping info that I provided (for testing I have been populating this by selecting a test address in the address book dropdown).

    2. There are times when I am redirected back to the HotCakes portal after completing a payment but there is a vague error message being displayed on the page. In these cases the site suggests that I am not logged in even though I am on the same browser and browser tab. If I look in the top right corner of the webpage I see the links that say “Login” where I would normally expect to see the profile info that I checked out with. When this happens if I copy and paste the base url into another tab (ex www.OurTestServer.com) I can see that I am still logged in as the correct/original user. For testing, In the method that processes the order I turned off the code that verifies if the payment was valid from the payment processor and instead just complete the order by hardcoding a bool variable to true. With that being said, after being shown an error message where I should seeing the receipt I am able to copy the third party payment url (something like www.OurTestServer.com/HotCakes/Checkout/ctl/ThirdPartyPayment/mid/434) into a new tab and am able get the payment to be completed successfully. It’s odd because it is the same browse and session but initially it displays the page as if I am logged out until I copy and paste the same url into a different tab. Odd….

    3. Haphazardly some redirects to the HotCakes site will process the order and display the receipt correctly while other times there will be an error displayed even though the payment was successful despite the same setup and codebase during the tests.

    4. The payment don’t ever complete successfully when doing a “Checkout as Guest”. The redirect occurs and the payment can be successful but on the return to the site I am not able to process the order or display a receipt when redirected there. (I assume perhaps this issue is tied loosely to some of the same issues going on with the other things I am encountering).

    For these example I process the callback function coming from the payment processor in my MyPaymentMethodCheckoutController controller in my Index() method. Currently the method has been stripped down to the minimum amount of code to successfully completed the order. At this time there is mainly logging, the ProcessOrder(CheckoutViewModel model) method, and the SavePaymentInfo(CheckoutViewModel model) method being run.

    I am not sure what is going on and I’d be grateful for any assistance, thoughts, or resources that may help nail down what the issue is.

    I know this question is somewhat “all over the place” but I suspect that they have a common source. Let me know if there is any other information that I can provide for clarification.

    Thanks





    Veteran Member






    --
    9/22/2020 2:53 PM
    For anyone that may be reading this, I just had a support call with Alex and Rashid. The issue here appears that is might be a deviation from the development pattern. The payment processing code was not in the order workflow, but in the MVC controller instead.
    Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes
    You are not authorized to post a reply.


    Loading
    • Sign-up for the Hotcakes Community Newsletter: