Wednesday, October 23, 2013

Integrating Payment gateway in Phpfox

Phpfox integrated Paypal and 2checkout payment gateways by default. It is very easy to use in our custom pages.
Steps for Integrating payment gateway in a custom page in phpfox.

1-> Take Admincp -> Settings -> PaymentGateways.

make the gateway as active and input the 'id'.

We have successfully enabled the payment gateway in phpfox.

USER SIDE
We have a provision in user "Account Settings" for entering the 'Payment Methods' and "id's".

Functionality:

Module -> template -> default -> controller -> filename.html.php

// Including the Payment form by putting the below module block calling.
{module name='api.gateway.form'}

Then
Module -> include -> component -> controller -> filename.class.php


We  need to set param values for "gateway_data":


$this->setParam('gateway_data', array(
'item_number' => '1',
'currency_code' => 'USD',
'amount' => 10,
'item_name' => Testing,
'return' => $this->url()->makeUrl('modulename.index'),
'recurring' => '',
'recurring_cost' =>'' ,
'alternative_cost' => '',
'alternative_recurring_cost' => '',
)
);

We have successfully implemented the payment gateway in our custom page.
Please check it out...