Ukończone

76671 Bramka płatnicza

Posiadam serwis oparty na skrypcie Joomla 1.5 z komponentem społecznościowym. Komponent ten zawiera bramkę do obsługi płatności. W chwili obecnej obsługuje paypal, moneybookers, segapay. W skrypcie do każdego z nich jest jeden plik [url removed, login to view] itd...

Potrzebuje stworzyć dodatkową bramkę płatniczą z serwisu DotPay (plik [url removed, login to view]).

Byłoby dobrze gdyby obeszło się bez podawania namiarów na serwer.

Poniżej cała zawartość bramki dla PayPal - plik [url removed, login to view] (jako wzór):

<?php

defined(\'_JEXEC\') or die(\'Restricted access\');

require_once(JPATH_COMPONENT_ADMINISTRATOR.DS.\'plugins\'.DS.\'[url removed, login to view]\');

class Paypal extends factoryPaymentPlugin

{

/**

* Configure the plugin (required)

*

*/

function configure()

{

parent::configure();

$this->description = \'Paypal Payment\';

$this->params = array(\'email\', \'use_sandbox\');

$this->action = $this->_params->get(\'use_sandbox\', 0) ? \'[url removed, login to view]\' : \'[url removed, login to view]\';

$this->button_src = \'[url removed, login to view]\';

$this->logo = \'[url removed, login to view]\';

}

/**

* Form used in the backend to edit the pluing settings (required)

*

*/

function showAdminConfig()

{

?>

<table width=\"100%\" class=\"admintable\">

<tr>

<td class=\"key\" align=\"right\"><label for=\"email\"><?php echo JText::_(\'Email\'); ?>:</label></td>

<td><input size=\"40\" name=\"email\" id=\"email\" class=\"inputbox\" value=\"<?php echo $this->_params->get(\'email\', \'test@[url removed, login to view]\'); ?>\"></td>

</tr>

<tr>

<td class=\"key\" align=\"right\"><label for=\"enable\"><?php echo JText::_(\'Enable\'); ?>:</label></td>

<td><?php echo JHTML::_(\'[url removed, login to view]\', \'enable\', \'class=\"inputbox\"\', $this->enabled); ?></td>

</tr>

<tr>

<td class=\"key\" align=\"right\"><label for=\"use_sandbox\"><?php echo JText::_(\'Use sandbox\'); ?>:</label></td>

<td><?php echo JHTML::_(\'[url removed, login to view]\', \'use_sandbox\', \'class=\"inputbox\"\', $this->_params->get(\'use_sandbox\', 0)); ?></td>

</tr>

</table>

<?php

}

/**

* Step 1 of the payment procces (required)

*

* @param Table $order Current order

*/

function step1()

{

// Create a new order

$order = $this->createOrder();

// Show the confirmation form

?>

<h1><?php echo JText::_(\'Confirm\'); ?></h1>

<p><?php echo JText::_(\'Are you sure you want to buy\'); ?> <b><?php echo $order->title; ?></b> <?php echo JText::_(\'using Paypal?\'); ?></p>

<br />

<form action=\"<?php echo $this->action; ?>\" method=\"post\">

<input type=\"hidden\" name=\"item_number\" value=\"<?php echo $order->id; ?>\" />

<input type=\"hidden\" name=\"on0\" value=\"userid\" />

<input type=\"hidden\" name=\"os0\" value=\"<?php echo $this->user->id; ?>\" />

<input type=\"hidden\" name=\"amount\" value=\"<?php echo $order->amount; ?>\" />

<input type=\"hidden\" name=\"currency_code\" value=\"<?php echo $order->currency; ?>\" />

<input type=\"hidden\" name=\"cmd\" value=\"_xclick\" />

<input type=\"hidden\" name=\"business\" value=\"<?php echo $this->_params->get(\'email\', \'\'); ?>\" />

<input type=\"hidden\" name=\"item_name\" value=\"<?php echo $order->title; ?>\" />

<input type=\"hidden\" name=\"quantity\" value=\"1\" />

<input type=\"hidden\" name=\"return\" value=\"<?php echo $this->return_url; ?>\" />

<input type=\"hidden\" name=\"cancel_return\" value=\"<?php echo $this->cancel_return; ?>\" />

<input type=\"hidden\" name=\"notify_url\" value=\"<?php echo $this->notify_url; ?>\" />

<input type=\"hidden\" name=\"tax\" value=\"0\" />

<input type=\"hidden\" name=\"no_note\" value=\"1\" />

<input type=\"hidden\" name=\"no_shipping\" value=\"1\" />

<input type=\"image\" src=\"<?php echo $this->button_src; ?>\" name=\"submit\" style=\"margin-left: 30px;\">

</form>

<?php

}

/**

* Processes the IPN, creates a new payment and stores the payment (required)

*

*/

function processIpn()

{

// Get values from request

$this->refnumber = trim(stripslashes($_POST[\'txn_id\']));

$this->order_title = trim(stripslashes($_POST[\'item_name\']));

$this->order_id = trim(stripslashes($_POST[\'item_number\']));

$this->status = trim(stripslashes($_POST[\'payment_status\']));

$this->amount = trim(stripslashes($_POST[\'mc_gross\']));

$this->currency = trim(stripslashes($_POST[\'mc_currency\']));

$this->receiver_email = trim(stripslashes($_POST[\'receiver_email\']));

$this->payer_email = trim(stripslashes($_POST[\'payer_email\']));

$this->test_ipn = trim(stripslashes($_POST[\'test_ipn\']));

$this->first_name = trim(stripslashes($_POST[\'first_name\']));

$this->last_name = trim(stripslashes($_POST[\'last_name\']));

$this->user_id = trim(stripslashes($_POST[\'option_selection1\']));

$this->date = trim(stripslashes($_POST[\'payment_date\']));

$payment = $this->getNewPayment();

$payment->payment_date = $this->date;

$payment->user_id = $this->user_id;

$payment->amount = $this->amount;

$payment->currency = $this->currency;

$payment->order_id = $this->order_id;

$payment->refnumber = $this->refnumber;

// Check for errors

$this->errors = $this->validatePayment();

switch ($this->status)

{

case \'Completed\':

case \'Processed\':

$payment->status = count($this->errors) ? \'manual-check\' : \'ok\';

break;

case \'Failed\':

case \'Denied\':

case \'Canceled-Reversal\':

case \'Expired\':

case \'Voided\':

case \'Reversed\':

case \'Refunded\':

$payment->status = \'error\';

break;

case \'In-Progress\':

case \'Pending\':

default:

$payment->status = \'manual-check\';

break;

}

$this->savePayment($payment);

}

/**

* Used to validate the payment (add your own validators)

*

* @return array An array of errors (if any)

*/

function validatePayment()

{

$errors = array();

// Validate IPN

if (true !== $this->validateIpn())

{

$errors[] = JText::_(\'IPN not verified\');

}

// Validate paypal email

if ($this->receiver_email != $this->_params->get(\'email\', \'\'))

{

$errors[] = JText::_(\'Receiver email is different from expected\');

}

// Validate user

if (!$this->validateUser())

{

$errors[] = JText::_(\'User doesn\\\'t exist or is not validated!\');

}

// Validate Order

$order = $this->getOrder($this->order_id);

if ($order)

{

if (\'pending\' == $order->status)

{

// Validate amount

if ($order->amount != $this->amount)

{

$errors[] = JText::_(\'Payment amount received is different from expected\');

}

// Validate currency

if ($order->currency != $this->currency)

{

$errors[] = JText::_(\'Payment currency is different from expected\');

}

}

else

{

$errors[] = JText::_(\'Order already processed\');

}

}

else

{

$errors[] = JText::_(\'Order not found\');

}

return $errors;

}

/**

* Validates the IPN

*

* @return bool

*/

function validateIpn()

{

// parse the paypal URL

$url_parsed = parse_url($this->action);

$post_string = \'\';

foreach ($_POST as $field => $value)

{

$post_string .= $field . \'=\' . urlencode($value) . \'&\';

}

$post_string .= \"cmd=_notify-validate\";

$fp = fsockopen($url_parsed[\'host\'], \'80\', $err_num, $err_str, 20);

if (!$fp)

{

return \'Fsockopen error no. \' . $errnum . \': \' . $errstr . \'. IPN not verified\';

}

else

{

fputs($fp, \"POST \" . $url_parsed[\'path\'] . \" HTTP/1.1\\r\\n\");

fputs($fp, \"Host: \" . $url_parsed[\'host\'] . \"\\r\\n\");

fputs($fp, \"Content-type: application/x-www-form-urlencoded\\r\\n\");

fputs($fp, \"Content-length: \".strlen($post_string).\"\\r\\n\");

fputs($fp, \"Connection: close\\r\\n\\r\\n\");

fputs($fp, $post_string . \"\\r\\n\\r\\n\");

$response = \'\';

while(!feof($fp))

{

$response .= fgets($fp, 1024);

}

fclose($fp);

}

if (eregi(\"VERIFIED\", $response))

{

return true;

}

return false;

}

}

Umiejętności: CSS, Projekty graficzne, HTML, PHP, Projektowanie stron www

Zobacz więcej: www jako o com, w&p design, want to buy name and logo, use case extends, tr logo design, ten key test, td logo design, select your payment method, potrzebuje logo, p.o.p. design, p.c. connection, paypal payment status pending, paypal payment request pending, paypal email confirmation not received, paypal confirmation email not received, manual logo design, logo design manual, logo design ka, logo design image input, jako o com

O pracodawcy:
( 4 ocen ) Poland

Numer ID Projektu: #5649489

Przyznany użytkownikowi:

isecross

A proposal has not yet been provided

zł50 PLN w ciągu 0 dni
(1 Ocena)
0.4