Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2012
    Posts
    1
    Plugin Contributions
    0

    Default Flo2Cash Payments (duplicate charge problem)

    Dear all,
    I am currently (and since not much long ago) working on a project that uses Zen Cart with integrated Flo2Cash direct credit card payments. We are experiencing a very unpleasant problem that causes us to charge our users twice if they hit the refresh button in the middle of the payment process (checkout_process.php makes a CURL call to Flo2Cash transperently for the user in the backend). This CURL call lasts a bit more than 5 seconds where I am testing and some eager users are likely to hit the refresh.

    The first approach I have tried is to implement the PRG (Post-Redirect-Get a.k.a. Redirect After Post) design pattern for this solution in order to diminish the double-form-submission (and this very ugly browser dialogue that asks you if you wanted to resend the form data to the server), but it didn't really help us so far. The problem is with the CURL call.

    The Flo2Cash module currently relies on the output from the CURL request and if it has been successful, it stores the order object (array) in the database. We also thought of checking for a previous order within a short timeframe from the same customers_id and with the same order_total, but we can't really tell this way if the user really wanted to buy another piece of the same item. We also don't know if his connection was not really bad and if that caused him to refresh.

    Another idea that we worked on is to introduce another object - payments, and store a payment ID with different statuses = initated, processing, paid, failed. The problem with that is again the CURL request. If you hit F5 after having been charged (after Flo2Cash have received our request), but before saving the data in our database, we don't really know if the payment has been successful or not. Thus, we cannot update the status.

    So currently I am thinking of 2 other solutions:
    1) multithreading deamon that starts another php process on the server, responsible for a single payment and storing the status in the database on its own. In the same time I can keep the process ID with the payment ID in the session and just ask if the database has been updated, and if not - if the process is still running. This way I can also refresh the page so that the enduser knows we are still processing his payment and doesn't spam the refresh button in that period of time. This seems to be ok, but our client is getting nervous already and it seems like a too much a do for this "simple job".
    2) a cronjob that runs every minute and checks for the payments database. If it finds a payment that has been processed (CURL call started) a minute ago, but has no reply it pays on its own (the cronjob script I mean) or informs the customer service that there has been some problem with the payment. In the same time, the checkout_process.php doesn't let you make any other CURL call for the same payment_ID and let's you know there has been a problem with your payment and you will be contacted in a while from our customer service. Unfortunately, this also seems to be too much for our client.

    Could you please consider the problem and let me know if you have any other ideas that could be done more quickly or if you think I should do what I know is to be done. Has anyone else from you used this payment processor (Flo2Cash) and do you have the same problem. What kind of Zen Cart version are you running and what is the version of the Flo2Cash module.

    Thank you very much for your time, I appreciate your assistance. Trolls will be fed after I am done with the task, so please come back after I say "I have fixed it" if you wish to troll.

    Thank you once again.

    Best Regards,
    Georgi

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Flo2Cash Payments (duplicate charge problem)

    Have you considered displaying a small modal dialog which says "please wait while we process your request"?
    Have you talked to the gateway's tech department to determine why their processing is taking so long?
    Have you tested on servers which have a faster speed internet backbone connection?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Double-Order, One Charge (a bug in the PayPal IPN - Website Payments Standard?)
    By ilikemike in forum Built-in Shipping and Payment Modules
    Replies: 20
    Last Post: 30 Dec 2011, 04:40 PM
  2. Can I charge payments at a later date?
    By CharlesMohr in forum General Questions
    Replies: 0
    Last Post: 29 Aug 2011, 04:05 AM
  3. Duplicate Shipping Charge(s)
    By skaboot in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 17 Dec 2009, 05:36 PM
  4. Flo2Cash corrupted
    By gh0st in forum Addon Payment Modules
    Replies: 3
    Last Post: 13 Mar 2009, 07:12 AM
  5. Duplicate payments with Paypal
    By DaveS in forum General Questions
    Replies: 1
    Last Post: 23 Feb 2009, 05:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg