osCommerce Payment Modules Programming

February 18, 2007 by hejian

Check process

1. cart filled with things
goes to checkout_shipping.php

2. Selects shpping method
gose to checkout_payment.php

3. Selects payment method
gose to checkout_confirmation.php

4. confirms or changes payment/shipping methods
goes to checkout_shipping/checkout_payment or checkout_process.php

5. the shop stores user’s cart as an order
redirects to checkout_success.php

6. Finished, Show the final screen

Payment modules functions

checkout_initialization_method()
Called by shopping_cart.
(note: version before v2.2 RC2 does not has this function)

update_status()
Called from checkout_confirmation the first

process_botton()
returns the extra form data in checkout_confirmation
Used to pass data to playing webs as hidden fields in a POST-type form

before_process()
This method is called before storing user’s cart as an order.
You can stop processing in this point with a tep_redirect call.

after_process()
The cart has been saved as an order, and then has been emptied.
Nearly useless, but you may need it for cleanup, notifying or confirmation purposes

javascript_validation()
returns javascript code for validating what has written the user in checkout_payment.php
Used to return the code that checks the user has written his credit card number, and not left empty the form

pre_confirmation_check()
Called in checkout_confirmation.php before the page has ever been beginned writted.
Used to deeply test what the user has written in the checkout_payment form
Credit card number validation may be here.

confirmation()
Called in checkout_confirmation.php
Returns the fields of data to show, in a multi-level array (see ipayment.php or cc.php for example)
Used to show the credit card number

selection()
Returns the fields for the form in checkout_payment in a muti-level array
Used for writting input fields like credit card owner and number in checkout_payment

Leave a Reply

You must be logged in to post a comment.

Wordpress template made by HeJian