Use PayJunction to collect payment and process orders. More...
Enumerations | |
enum | MO_PAYJUNCTION_VERSION |
Define the version of the MO PayJunction module. More... | |
Functions | |
mo_payjunction_perm () | |
Implementation of hook_perm() | |
mo_payjunction_help ($section) | |
The help pages for the MO PayJunction module. | |
mo_payjunction_form_alter (&$form, &$form_state, $form_id) | |
Implementation of hook_form_alter() | |
mo_payjunction_payment_gateway () | |
Implementation of hook_payment_gateway() | |
_mo_payjunction_settings_form () | |
Callback function used by Ubertcard to get the MO PayJunction settings. | |
mo_payjunction_validate ($form, &$form_state) | |
Validate the password. | |
mo_payjunction_recurring_info () | |
Implementation of hook_recurring_info(). | |
mo_payjunction_recurring_fee_process ($order, $fee, $op) | |
Implementation of the processing function for the recurring fee. | |
mo_payjunction_recurring_fee_renew ($order, $fee, $op) | |
Implementation of the processing of a recurring fee. | |
_mo_payjunction_charge ($order_id, $amount, $data) | |
Charge the customer credit card. | |
_mo_payjunction_charge_order ($order, $amount, $data) | |
Charge the customer credit card. |
Implementation of the functions used to handle the MO PayJunction module.
http://www.m2osw.com/mo_payjunction contact@m2osw.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This variable defines the version of the MO PayJunction module. This will always be the same as the version defined in Drupal (throught the .info file.)
_mo_payjunction_charge | ( | $ | order_id, |
$ | amount, | ||
$ | data | ||
) |
This function is called at the time the user clicks on Process (or whatever button used to process the order.)
The $amount
parameter is the total amount of the invoice. The order identifier is used to read the corresponding order and fill in the data for PayJunction.
This function does not manage recurring charges. Since PayJunction generates a unique identifier for each charge processed and that identifier can be reused later to charge the same card, we don't actually have to do anything more.
[in] | $order_id | The identifier of the order being processed |
[in] | $amount | The amount being charged |
[in] | $data | Some additional data defined by the Credit Card system |
References _mo_payjunction_charge_order().
_mo_payjunction_charge_order | ( | $ | order, |
$ | amount, | ||
$ | data | ||
) |
This is a sub-function of _mo_payjunction_charge() that accepts an order object instead of the order identifier. This is useful to avoid loading the order again and called whenever a recurring fee is charged to a customer.
[in] | $order | An order object to process |
[in] | $amount | The amount being charged |
[in] | $data | Some additional data defined by the Credit Card system |
Referenced by _mo_payjunction_charge(), and mo_payjunction_recurring_fee_renew().
The Ubercart module uses this function to request a form of settings for the MO PayJunction module.
This includes the username, the password, and a flag to know whether the module is used in test mode or not. When not in test mode, a valid login and password are required.
mo_payjunction_form_alter | ( | &$ | form, |
&$ | form_state, | ||
$ | form_id | ||
) |
This function is an implementation of the hook_form_alter().
It is used to:
[in,out] | $form | The form to edit |
[in,out] | $form_state | The current state of the form |
[in] | $form_id | The unique identifier of the form. |
mo_payjunction_help | ( | $ | section | ) |
Display some help whenever the user goes to the Drupal help section of the website.
[in] | $section | The section of help the user is interested in |
This function returns one or more gateway supported by this module.
At this time, the MO PayJunction module returns one gateway.
This function returns a list of permissions supported by the MO PayJunction module.
At this time the module supports 'allow PayJunction test charge' to let only a few users use the test mode of the module. This works by assigning a specific role to the few users who will be able to use the test mode of the module. (i.e. Anonymous users should never be allowed to run a test charge.) When in test mode, any user not in that group will get an error message if they try to order using PayJunction (and their information will NOT be sent to PayJunction.)
mo_payjunction_recurring_fee_process | ( | $ | order, |
$ | fee, | ||
$ | op | ||
) |
This function is called by the uc_recurring module whenever a product order has a recurring fee. It is expected to setup the recurring fee with the processor. For PayJunction we already have the Transaction ID saved in our database so we ignore this call and simply return TRUE.
[in] | $order | The order being processed |
[in] | $fee | The fee definition (fee handler object) including the amount to charge |
[in] | $op | The operation (i.e. 'process callback') |
mo_payjunction_recurring_fee_renew | ( | $ | order, |
$ | fee, | ||
$ | op | ||
) |
This function is called by the uc_recurring module whenever a product order has a recurring fee that needs to be processed. The function uses the transaction identifier to process the fee and return TRUE unless the processing fails.
The transaction identifier is taken from the order that was successfully processed.
Note that the $order
parameter is a copy of the original order and not the main order.
[in] | $order | The new order being processed |
[in] | $fee | The fee definition (fee handler object) including the amount to charge |
[in] | $op | The operation (i.e. 'renew callback') |
References _mo_payjunction_charge_order().
This function is called by the uc_recurring module to gather all the different modules that support recurring fees.
The MO PayJunction supports recurring fees using the transaction identifier generated by the very first charge.
Note that you cannot charge a credit card twice in a row. This means you cannot setup a recurring fee to be processed immediately after the main charge on a credit card. For that to happen, you need to increase the cost of your product or service inclusive of the first recurring fee. Another solution, is to charge the recurring fee within 1 or 2 days...
mo_payjunction_validate | ( | $ | form, |
&$ | form_state | ||
) |
This function validates the password, which simply means that it copies the existing password in the password field of the form if the field is empty. This means we won't lose the password if left unchanged.
[in] | $form | The form being validated, i.e. the PayJunction settings |
[in,out] | $form_state | The form state being validated |