===============================================================================
PayGol payments module for osCommerce
===============================================================================

Description:
===============================================================================
To use this module in your osCommerce shopping cart, you first need to register for free on PayGol.com
at "www.paygol.com/register" and create a service as "Integrated" type

This module enables your users to pay by Sofort, IBAN, PayPal, credit card, SMS or Pay per Call, for products and services you offer.

Installation:
===============================================================================
1) Unzip the file.
2) add the next files:
/includes/modules/payment/paygol.php
/includes/languages/english/modules/payment/paygol.php
/includes/languages/spanish/modules/payment/paygol.php

3) Modify the next files:
/includes/functions/html_output.php
Add next function at line 134 aprox:
	function tep_image_submit_paygol($image, $alt = '', $parameters = '') {
		global $language;
		$image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
		if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
		if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
		$image_submit .= '>';
		return $image_submit;
	}

Add next function at line 169 aprox:
	function tep_draw_form_paygol($name, $method = 'post', $parameters = '') {
		$form = '<form action='https://www.paygol.com/pay' name="' . tep_output_string($name) . '" method="' . tep_output_string($method) . '"';
		if (tep_not_null($parameters)) $form .= ' ' . $parameters;
		$form .= '>';
		return $form;
	}
  
/checkout_confirmation.php at line 324 aprox:
Find this:
	echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . "\n";
Or this:
	echo tep_draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'check', null, 'primary');
Replace it by:
	if ($payment=='paygol')
		echo tep_image_submit_paygol('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . "\n";
	else
		echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . "\n";

finally find this:
	echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');

and replace it by:
	if ($payment=='paygol')
		echo tep_draw_form_paygol('pg_frm', 'post');
	else
		echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');


Set up:
===============================================================================
1. Go to administration section of osCommerce 'Modules " -> "Payment"->"PayGol"->"Install'

2. Click on 'Edit' and follow these instructions:
        - In the area 'Do you want to accept these payment methods' switch to "True".
		- In the area 'Default order status' set "Delivered".
		- Then enter the ID service provided by PayGol.com.
		
		To obtain your service ID you must:
			1.Create a PayGol account.
			2.Proceed to login and create a service at https://www.paygol.com/newservice.
			3.Find your service id at Services->My Services.

Support:
===============================================================================
If you have further questions, you can create a ticket support in the control panel PayGol.com, 
at https://www.paygol.com/support click on button "Support Ticket".

