PDA

View Full Version : Payment processors


msjoedin
04-05-2007, 03:36 PM
Hi all!

Is there a way to add another payment processor than the ones specified. I want to use a Swedish payment processor. Can I write some code myself to implement that? What changes do I need to do to make it work? Can you supply me with the necessary details about what files and what tables to change?

Regards
Mats

dimiurg
04-05-2007, 04:08 PM
1) You can create 2 files in "/components/com_joomla_lms/includes/processors/" directory: “ProceccorName.php” and “ProcessorName.xml”.
For example see any existent processor (paypal or 2checkout). In php file you can create 2 functions :
function show_checkout( $subscription, $item_id, $proc ){
[your checkout form here]
}

function validate_callback($proc){
[check data from server];
if (status == "Completed"){ require_once(_JOOMLMS_FRONT_HOME.'/includes/joomla_lms.subscription.lib.php');

jlms_update_payment( $order_id, $txn_id, 'Completed', $payment_date );
jlms_register_new_user( $order_id );
}

}

2) Go to Admin panel->Subscriptions->Payment processors
If you are doing all correctly, your new processor will appear here.
3) Configure, publish and make default (if necessary) your new processor.