Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

class initialization order in checkout_confirmation.php


Recommended Posts



Maybe I am not right, but hope some people has comments about the following proposal.


I am about developing a payment module for online credit card payment by a local Bank. The steps of the payment are the follows:


1. register the transaction with a unique ID, amount, currency, date/time, return URL etc.

2. send the customer to the Bank's payment page with the same data

3. the customer pays, the Bank sends back the user to the shop with the authorization code and error code if any


So, the step 1 (registering) is handled in the payment module class' pre_confirmation_check() function, because if the registration fails, the program should send back the user to the checkout_payment.php pages with the error data before any output. This function needs the amount of the order, so the ORDER_TOTAL class should be initialized in the checkout_confirmation.php before calling the payment->pre_confirmation_check() function. So I moved this function call under ORDER_TOTAL initialization.


But this is not enough, because the ORDER_TOTAL class still does not contain amounts, for this I have to call the order_total_modules->process() function. This function is already called in the checkout_confirmation.php later, after several output to the browser. So I moved up this function call between the ORDER_TOTAL initialization and the payment->pre_confirmation_check() function call.


My question: is the above hack could be a candidate for integration into the final code, or this situation is so rare or unique that it should be handled only as a contribution along with the payment module's file?




Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...