Results 1 to 7 of 7

Threaded View

  1. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: path through payment process

    Kobra's information is not fully correct.

    The authorizenet.php module (not the authorizenet_aim.php module) is the one you could use as an example. Model yours after the "offsite" mode used in that module. (Ignore/skip anything used by "onsite" mode, as you should not be collecting card data on your site using a module based after this one.)

    In the module you supply the $this->form_action_url as the URL where the POST data is to be sent.
    Then in the module you also supply all the POST data in the process_button() function.
    That will cause the "Submit" button on the payment confirmation screen to be a direct POST to the URL you supplied.

    You will then want the gateway to POST its reply back to the index.php?main_page=checkout_process URL of your store (often you accomplish this by passing that return URL as part of your POST data).

    Then the before_process() function will read the data posted back to the checkout_process URL and validate the data. If anything in the response suggests payment ought to be or is declined, then you do a zen_redirect() back to the payment page after setting an error via the $messageStack.
    Else if the POST indicates payment is successful then before_process() should do a return (or end without redirect).

    Then the normal checkout flow will generate an order number and store the order.

    Then the module's after_process() function will fire. In some modules (authorizenet does, but not all do) this is used to save extra information about the transaction to the database using the issued order number.

    Then confirmation emails are sent out by the order class.
    Last edited by DrByte; 25 Sep 2015 at 04:33 AM. Reason: added note about basing it after the offsite mode
    .

    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. Checkout failing to process through. server 500 type errors
    By oleancomputers in forum General Questions
    Replies: 3
    Last Post: 5 Mar 2016, 05:24 PM
  2. Customer Address not showing on order (or through the checkout process)
    By scamp in forum Managing Customers and Orders
    Replies: 8
    Last Post: 7 Feb 2010, 12:59 AM
  3. Force USD through one payment processor and MXN through another?
    By tigrecanela in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 27 Jul 2009, 09:15 PM
  4. Order process doesn't go all the way through because of tax file?
    By mohinder in forum Managing Customers and Orders
    Replies: 0
    Last Post: 10 Apr 2007, 06:38 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