Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Payment modules documentation


MechaKaiser

Recommended Posts

Posted

Hello folks!

Well, well, it seems no one made some docs about the payment modules, so, I give you a li'l introduction of what I have discovered reading and re-reading again the code B) . Hope you enjoy it. Admins, please add this documentation to the wifi, so no more people asks about it. Sorry for my English, but I am Spanish. I also append a translation of this doc in Spanish.

 

?Hola gente!

Bueno, bueno, parece que nadie ha escrito nada sobre los m?dulos de pago, as? que ah? va una peque?ita introducci?n acerca de lo que he descubierto leyendo una y otra vez el c?digo B) .Espero que te sirva de algo.

 

This document is referred about OsCommerce 2.2MS2. Use at your own risk. Hope you enjoy reading it!

 

Intro:

People buy at your shops like this:

--cart filled with things

goes to checkout_shipping.php

-- Selects shipping method

goes to checkout_payment.php

-- Selects payment method

goes to checkout_confirmation.php

-- confirms or changes payment/shipping methods

goes to checkout_shipping/checkout_payment OR checkout_process.php (we assume the last case)

-- the shop stores user's cart as an order

redirects to checkout_success.php

-- Finished! Show the final screen

 

// catalog/modules/payment/mypayment.php

class mypayment {

//Constructor

function mypayment() //what-you-know about object constructors

function update_status() //Called from checkout_confirmation the first

function process_button()

//Returns the extra form data in checkout_confirmation

//Used to pass data to paying webs as hidden fields in a POST-type form

string $form_action_url

//The target of the form for the confirmation button in checkout_confirmation.php

//Used to select the address of the paying web

//Leave undefined for not-requiring external confirmation methods so it points to checkout_process

function before_process()

//This method is called before storing user's cart as an order.

// You can test here parameters to ensure no-one stores an order without paying

//You can stop processing in this point with a tep_redirect call.

function 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

function 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

function 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.

function confirmation()

//Returns the fields of data to show from checkout_payment in checkout_confirmation, in a multi-level array (see ipayment.php or cc.php for example)

//Used to show the credit card number

function selection()

//Returns the fields for the form in checkout_payment in a multi-level array

//Used for writing input fields like credit card owner and number in checkout_payment

 

 

 

Well, that were some of the most 'obscure' functions in payment modules. Now it's a nice time to open cc.php or paypal.php and see some examples of what do every function.

 

And now in Spanish:

 

Este documento se refiere a la versi?n 2.2MS2 de OsCommerce. Trata de qu? hace cada una de las 'oscuras' funciones que tienen estos m?dulos y no est?n documentadas. Usalo con cuidado. No me hago responsable de lo que hagas con ?l. ?Espero que te sirva!

 

Introducci?n:

La gente compra en una tienda OsCommerce mas o menos as?:

--carrito lleno de cosillas

Entra en checkout_shipping.php

--Escoje el m?todo de env?o

Entra en checkout_payment.php

--escoje el m?todo de pago

Entra en checkout_confirmation

-- Confirma o vuelve atr?s a cambiar el m?todo de pago o de env?o

Entra en chekout_shipping/checkout_payment O en checkout_process (suponemos que entra en esta ?ltima)

-- La tienda guarda como un pedido el carrito del usuario, y despu?s lo borra

Redirecci?n a checkout_success.php

-- ?Se acab?! Muestra al usuario la pantalla de confirmaci?n del pedido

 

// catalog/modules/payment/mipago.php

class mipago {

//Constructor

function mipago() //Lo que ya sabes de constructores

function update_status() //Llamada en checkout_confirmation la primera de todas

function process_button()

//Devuelve informaci?n extra para ser a?adida en el formulario de checkout_confirmation.php

//Usado para pasar datos a las webs de pago como campos ocultos en el formulario (campos hidden)

 

string $form_action_url

//La direcci?n de destino a donde se dirige el bot?n "confirmar" de checkout_confirmation

//Se usa para indicar la web de pago

//D?jalo sin definir si no necesitas hacer pasar al usuario por una web de pago, para que apunte a checkout_process

 

function before_process()

//Esta funci?n es llamada justo antes de que se guarde el carrito del usuario como un pedido

//Es un buen punto para comprobar que el usuario ha pagado.

//Puedes detener el proceso en este punto con una llamada a tep_redirect

 

function after_process()

//El carrito ha sido guardado como un pedido, y despu?s ha sido vaciado

//Esta funci?n es casi in?til, pero quiz?s la necesites para hacer limpieza en el sistema o confirmar que todo fue bien.

 

function javascript_validation()

//Devuelve el c?digo javascript para comprobar que el usuario ha metido datos en el formulario de checkout_payment

//Por ejemplo, se usa para devolver el c?digo que comprueba que el usuario ha escrito el n?mero de tarjeta de cr?dito y no deja vac?o el formulario

 

function pre_confirmation_check()

//Llamada en checout_confirmation antes de que la p?gina se haya empezado a escribir.

//Se usa para comprobar con profundidad lo que el usuario ha escrito el el formulario de checkout_payment

//?ste es un buen lugar para comprobar el n?mero de la tarjeta de cr?dito o que no est? caducada

 

function confirmation()

 

//Devuelve los campos que se mostrar?n al usuario en checkout_confirmation, procedentes de lo que escribi? en checkout_payment, en un array multinivel. (En ipayment.php o cc.php hay algunos ejemplos)

//Se usa para mostrar el n?mero de tarjeta de cr?dito (por ejemplo)

 

function selection()

//Devuelve los campos que formar?n el formulario de checkout_payment en un array multinivel

//Usado para mostrar campos como el n? de la tarjeta de cr?dito en checkout_payment

Archived

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

×
×
  • Create New...