Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/joomla4/ |
| [Home] [System Details] [Kill Me] |
PKi��[Ay{L1%1%helpers/api_cert_chain.crtnu�[���-----BEGIN
CERTIFICATE-----
MIIDgzCCAuygAwIBAgIQJUuKhThCzONY+MXdriJupDANBgkqhkiG9w0BAQUFADBf
MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xNzA1BgNVBAsT
LkNsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw
HhcNOTcwNDE3MDAwMDAwWhcNMTExMDI0MjM1OTU5WjCBujEfMB0GA1UEChMWVmVy
aVNpZ24gVHJ1c3QgTmV0d29yazEXMBUGA1UECxMOVmVyaVNpZ24sIEluYy4xMzAx
BgNVBAsTKlZlcmlTaWduIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gQ2xhc3Mg
MzFJMEcGA1UECxNAd3d3LnZlcmlzaWduLmNvbS9DUFMgSW5jb3JwLmJ5IFJlZi4g
TElBQklMSVRZIExURC4oYyk5NyBWZXJpU2lnbjCBnzANBgkqhkiG9w0BAQEFAAOB
jQAwgYkCgYEA2IKA6NYZAn0fhRg5JaJlK+G/1AXTvOY2O6rwTGxbtueqPHNFVbLx
veqXQu2aNAoV1Klc9UAl3dkHwTKydWzEyruj/lYncUOqY/UwPpMo5frxCTvzt01O
OfdcSVq4wR3Tsor+cDCVQsv+K1GLWjw6+SJPkLICp1OcTzTnqwSye28CAwEAAaOB
4zCB4DAPBgNVHRMECDAGAQH/AgEAMEQGA1UdIAQ9MDswOQYLYIZIAYb4RQEHAQEw
KjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQUzA0BgNV
HSUELTArBggrBgEFBQcDAQYIKwYBBQUHAwIGCWCGSAGG+EIEAQYKYIZIAYb4RQEI
ATALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgEGMDEGA1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/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUF
BwMBBggrBgEFBQcDAjBlBgNVHSAEXjBcMFoGCmCGSAGG+EUBBzYwTDAjBggrBgEF
BQcCARYXaHR0cHM6Ly9kLnN5bWNiLmNvbS9jcHMwJQYIKwYBBQUHAgIwGRoXaHR0
cHM6Ly9kLnN5bWNiLmNvbS9ycGEwHwYDVR0jBBgwFoAUDURcFlNEwYJ+HSCrJfQB
Y9i+eaUwKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3NkLnN5bWNiLmNvbS9zZC5j
cmwwVwYIKwYBBQUHAQEESzBJMB8GCCsGAQUFBzABhhNodHRwOi8vc2Quc3ltY2Qu
Y29tMCYGCCsGAQUFBzAChhpodHRwOi8vc2Quc3ltY2IuY29tL3NkLmNydDANBgkq
hkiG9w0BAQUFAAOCAQEAXFGDySlKXOx6nZNRnC764rYMm20C1neLh8XxCEEl9UP5
mGSgOY0ZFH4mbfLIEstZcj4tlBEJvc+s9bzWIli1d2ouSoZ8oEd73hL3elREc3BD
Tm8xvrJdAOmcu5YKd4BP6RGBlUzlirXcgmi2jxfr1vbIh2wUUkVG9GNVNvj7uhHu
d1V4cVpnZ30caTB9YYlPVo5qG5Cbzkuw76oZmxinr7ppFck3v3GkRchl77TL2w4I
X9nL7mbui2drNpsiCGjlc4wea2kXdXAj1w5LwHqkxFfjQyHvUCJFpx0hnRzEeVgT
x5DsDzb8RYgFgC3M+ZgV7SQh+Bjr+LTEAkFRogGFMA==
-----END CERTIFICATE-----
PKi��[�#o,,helpers/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PKi��[�+Ւt-t-helpers/ipnlistener.phpnu�[���<?php
/**
* PayPal IPN Listener
*
* A class to listen for and handle Instant Payment Notifications (IPN)
from
* the PayPal server.
*
* https://github.com/Quixotix/PHP-PayPal-IPN
*
* @package PHP-PayPal-IPN
* @author Micah Carrick
* @copyright (c) 2012 - Micah Carrick
* @version 2.1.0
*/
defined('_JEXEC') or die;
//jimport('joomla.log.log');
//JLog::addLogger( array('text_file' =>
'com_phocacart_error_log.php'), JLog::ALL,
array('com_phocacart'));
if (! class_exists('PhocacartLoader')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/loader.php');
}
phocacartimport('phocacart.utils.log');
class PhocacartPaypalStandardIpnListener {
/**
* If true, the recommended cURL PHP library is used to send the post
back
* to PayPal. If flase then fsockopen() is used. Default true.
*
* @var boolean
*/
public $use_curl = true;
/**
* If true, explicitly sets cURL to use SSL version 3. Use this if
cURL
* is compiled with GnuTLS SSL.
*
* @var boolean
*/
public $force_ssl_v3 = false;
/**
* If true, cURL will use the CURLOPT_FOLLOWLOCATION to follow any
* "Location: ..." headers in the response.
*
* @var boolean
*/
public $follow_location = false;
/**
* If true, an SSL secure connection (port 443) is used for the post
back
* as recommended by PayPal. If false, a standard HTTP (port 80)
connection
* is used. Default true.
*
* @var boolean
*/
public $use_ssl = true;
/**
* If true, the paypal sandbox URI www.sandbox.paypal.com is used for
the
* post back. If false, the live URI www.paypal.com is used. Default
false.
*
* @var boolean
*/
public $use_sandbox = false;
/**
* The amount of time, in seconds, to wait for the PayPal server to
respond
* before timing out. Default 30 seconds.
*
* @var int
*/
public $timeout = 30;
private $post_data = array();
private $post_uri = '';
private $response_status = '';
private $response = '';
const PAYPAL_HOST = 'www.paypal.com';
const SANDBOX_HOST = 'www.sandbox.paypal.com';
private $params = array();
public function setParams($p) {
$this->params = $p;
}
/**
* Post Back Using cURL
*
* Sends the post back to PayPal using the cURL library. Called by
* the processIpn() method if the use_curl property is true. Throws an
* exception if the post fails. Populates the response,
response_status,
* and post_uri properties on success.
*
* @param string The post data as a URL encoded string
*/
protected function curlPost($encoded_data) {
if ($this->use_ssl) {
$uri =
'https://'.$this->getPaypalHost().'/cgi-bin/webscr';
$this->post_uri = $uri;
} else {
$uri =
'http://'.$this->getPaypalHost().'/cgi-bin/webscr';
$this->post_uri = $uri;
}
$ch = curl_init();
if ($this->params['verify_ssl'] == 1) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
} else {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO,
dirname(__FILE__)."/api_cert_chain.crt");
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded_data);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,
$this->follow_location);
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
if ($this->force_ssl_v3) {
curl_setopt($ch, CURLOPT_SSLVERSION, 4); //Modified from 3 to 4
} else {
curl_setopt($ch, CURLOPT_SSLVERSION, 0);
}
$this->response = curl_exec($ch);
$this->response_status = strval(curl_getinfo($ch,
CURLINFO_HTTP_CODE));
if ($this->response === false || $this->response_status ==
'0') {
$errno = curl_errno($ch);
$errstr = curl_error($ch);
//JLog::add('Paypal Standard: '."cURL error: [$errno]
$errstr", JLog::WARNING, 'com_phocacart');
PhocacartLog::add(1, 'Payment - PayPal Standard - ERROR', 0,
"cURL error: [$errno] $errstr");
throw new Exception("cURL error: [$errno] $errstr");
}
}
/**
* Post Back Using fsockopen()
*
* Sends the post back to PayPal using the fsockopen() function.
Called by
* the processIpn() method if the use_curl property is false. Throws
an
* exception if the post fails. Populates the response,
response_status,
* and post_uri properties on success.
*
* @param string The post data as a URL encoded string
*/
protected function fsockPost($encoded_data) {
if ($this->use_ssl) {
$uri = 'ssl://'.$this->getPaypalHost();
$port = '443';
$this->post_uri = $uri.'/cgi-bin/webscr';
} else {
$uri = $this->getPaypalHost(); // no "http://" in
call to fsockopen()
$port = '80';
$this->post_uri =
'http://'.$uri.'/cgi-bin/webscr';
}
$fp = fsockopen($uri, $port, $errno, $errstr, $this->timeout);
if (!$fp) {
// fsockopen error
//JLog::add('Paypal Standard: '."fsockopen error:
[$errno] $errstr", JLog::WARNING, 'com_phocacart');
PhocacartLog::add(1, 'Payment - PayPal Standard - ERROR', 0,
"fsockopen error: [$errno] $errstr");
throw new Exception("fsockopen error: [$errno]
$errstr");
}
$header = "POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .= "Host:
".$this->getPaypalHost()."\r\n";
$header .= "Content-Type:
application/x-www-form-urlencoded\r\n";
$header .= "Content-Length:
".strlen($encoded_data)."\r\n";
$header .= "Connection: Close\r\n\r\n";
fputs($fp, $header.$encoded_data."\r\n\r\n");
while(!feof($fp)) {
if (empty($this->response)) {
// extract HTTP status from first line
$this->response .= $status = fgets($fp, 1024);
$this->response_status = trim(substr($status, 9, 4));
} else {
$this->response .= fgets($fp, 1024);
}
}
fclose($fp);
}
private function getPaypalHost() {
if ($this->use_sandbox) return self::SANDBOX_HOST;
else return self::PAYPAL_HOST;
}
/**
* Get POST URI
*
* Returns the URI that was used to send the post back to PayPal. This
can
* be useful for troubleshooting connection problems. The default URI
* would be
"ssl://www.sandbox.paypal.com:443/cgi-bin/webscr"
*
* @return string
*/
public function getPostUri() {
return $this->post_uri;
}
/**
* Get Response
*
* Returns the entire response from PayPal as a string including all
the
* HTTP headers.
*
* @return string
*/
public function getResponse() {
return $this->response;
}
/**
* Get Response Status
*
* Returns the HTTP response status code from PayPal. This should be
"200"
* if the post back was successful.
*
* @return string
*/
public function getResponseStatus() {
return $this->response_status;
}
/**
* Get Text Report
*
* Returns a report of the IPN transaction in plain text format. This
is
* useful in emails to order processors and system administrators.
Override
* this method in your own class to customize the report.
*
* @return string
*/
public function getTextReport() {
$r = '';
// date and POST url
for ($i=0; $i<80; $i++) { $r .= '-'; }
$r .= "\n[".date('m/d/Y g:i A').'] -
'.$this->getPostUri();
if ($this->use_curl) $r .= " (curl)\n";
else $r .= " (fsockopen)\n";
// HTTP Response
for ($i=0; $i<80; $i++) { $r .= '-'; }
$r .= "\n{$this->getResponse()}\n";
// POST vars
for ($i=0; $i<80; $i++) { $r .= '-'; }
$r .= "\n";
foreach ($this->post_data as $key => $value) {
$r .= str_pad($key, 25)."$value\n";
}
$r .= "\n\n";
return $r;
}
/**
* Process IPN
*
* Handles the IPN post back to PayPal and parsing the response. Call
this
* method from your IPN listener script. Returns true if the response
came
* back as "VERIFIED", false if the response came back
"INVALID", and
* throws an exception if there is an error.
*
* @param array
*
* @return boolean
*/
public function processIpn($post_data=null) {
$encoded_data = 'cmd=_notify-validate';
if ($post_data === null) {
// use raw POST data
if (!empty($_POST)) {// FOR JED CHECKERS: POST IS NEEDED HERE
$this->post_data = $_POST;// FOR JED CHECKERS: POST IS
NEEDED HERE
$encoded_data .=
'&'.file_get_contents('php://input');
} else {
//JLog::add('Paypal Standard: '."No POST data
found.", JLog::WARNING, 'com_phocacart');
PhocacartLog::add(1, 'Payment - PayPal Standard - ERROR', 0,
"No POST data found.");
throw new Exception("No POST data found.");
}
} else {
// use provided data array
$this->post_data = $post_data;
foreach ($this->post_data as $key => $value) {
$encoded_data .= "&$key=".urlencode($value);
}
}
if ($this->use_curl) $this->curlPost($encoded_data);
else $this->fsockPost($encoded_data);
if (strpos($this->response_status, '200') === false) {
//JLog::add('Paypal Standard: '."Invalid response status:
".$this->response_status, JLog::WARNING,
'com_phocacart');
PhocacartLog::add(1, 'Payment - PayPal Standard - ERROR', 0,
"Invalid response status: ".$this->response_status);
throw new Exception("Invalid response status:
".$this->response_status);
}
if (strpos($this->response, "VERIFIED") !== false) {
return true;
} elseif (strpos($this->response, "INVALID") !==
false) {
return false;
} else {
//JLog::add('Paypal Standard: '."Unexpected response from
PayPal.", 'com_phocacart');
PhocacartLog::add(1, 'Payment - PayPal Standard - ERROR', 0,
"Unexpected response from PayPal.");
throw new Exception("Unexpected response from
PayPal.");
}
}
/**
* Require Post Method
*
* Throws an exception and sets a HTTP 405 response header if the
request
* method was not POST.
*/
public function requirePostMethod() {
// require POST requests
if ($_SERVER['REQUEST_METHOD'] &&
$_SERVER['REQUEST_METHOD'] != 'POST') {
//JLog::add('Paypal Standard: '."Invalid HTTP request
method.", 'com_phocacart');
//PhocacartLog::add(1, 'Payment - PayPal Standard - ERROR', 0,
"Invalid HTTP request method.");
header('Allow: POST', true, 405);
throw new Exception("Invalid HTTP request method.");
}
}
}
?>
PKi��[��ؙWWhelpers/main.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
?>PKi��[�#o,,
index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PKi��[X �
�g�gpaypal_standard.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport( 'joomla.plugin.plugin' );
jimport( 'joomla.filesystem.file');
jimport( 'joomla.html.parameter' );
//jimport('joomla.log.log');
//JLog::addLogger( array('text_file' =>
'com_phocacart_error_log.php'), JLog::ALL,
array('com_phocacart'));
//phocacartimport('phocacart.utils.log');
JLoader::registerPrefix('Phocacart', JPATH_ADMINISTRATOR .
'/components/com_phocacart/libraries/phocacart');
class plgPCPPaypal_Standard extends JPlugin
{
protected $name = 'paypal_standard';
function __construct(& $subject, $config) {
parent :: __construct($subject, $config);
$this->loadLanguage();
}
/**
* Proceed to payment - some method do not have proceed to payment gateway
like e.g. cash on delivery
*
* @param integer $proceed Proceed or not proceed to payment gateway
* @param string $message Custom message array set by plugin to
override standard messages made by component
*
* @return boolean True
*/
function PCPbeforeProceedToPayment(&$proceed, &$message,
$eventData) {
echo '<pre>';
var_dump('yek');
echo '</pre>';
//exit();
if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
return false;
}
// THERE ARE 3 PLACES WHERE THE MESSAGE CAN BE CREATED:
// 1) COMPONENT - components/com_phocacart/views/info/tmpl/ ...
// 2) LANGUAGE FILE - there is specific string in language file which can
be customized for each e-shop (see top of ini file)
// 3) PAYMENT PLUGIN - means that payment plugin can override the
component (1) and language file (2) message
// See examples:
$proceed = 1;
$message = array();
/*
// Order processed successfully made - no downloadable items
$message['order_nodownload'] =
JText::_('COM_PHOCACART_ORDER_SUCCESSFULLY_PROCESSED')
.'</br>' .
JText::_('COM_PHOCACART_ORDER_PROCESSED_ADDITIONAL_INFO');
// Order processed successfully made - downloadable items
$message['order_download'] =
JText::_('COM_PHOCACART_ORDER_SUCCESSFULLY_PROCESSED')
.'</br>' .
JText::_('COM_PHOCACART_ORDER_PROCESSED_DOWNLOADABLE_ITEMS_ADDITIONAL_INFO');
// Order and payment successfully made - no downloadable items
$message['payment_nodownload'] =
JText::_('COM_PHOCACART_ORDER_AND_PAYMENT_SUCCESSFULLY_PROCESSED')
.'</br>' .
JText::_('COM_PHOCACART_ORDER_PAYMENT_PROCESSED_ADDITIONAL_INFO');
// Order and payment successfully made - downloadable items
$message['payment_download'] =
JText::_('COM_PHOCACART_ORDER_AND_PAYMENT_SUCCESSFULLY_PROCESSED')
.'</br>' .
JText::_('COM_PHOCACART_ORDER_PAYMENT_PROCESSED_DOWNLOADABLE_ITEMS_ADDITIONAL_INFO');
*/
return true;
}
/**
* Payment Canceled
*
* @param integer $mid ID of message - can be set in
PCPbeforeSetPaymentForm
* @param string $message Custom message array set by plugin to
override standard messages made by component
*
* @return boolean True
*/
function PCPafterCancelPayment($mid, &$message, $eventData){
echo '<pre>';
var_dump('do');
echo '</pre>';
exit();
if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
return false;
}
$message = array();
/*
switch($mid) {
case 1:
$message['payment_canceled'] =
JText::_('COM_PHOCACART_PAYMENT_CANCELED')
.'</br>' .
JText::_('COM_PHOCACART_ORDER_PAYMENT_CANCELED_ADDITIONAL_INFO');
break;
default:
$message['payment_canceled'] =
JText::_('COM_PHOCACART_PAYMENT_CANCELED')
.'</br>' .
JText::_('COM_PHOCACART_ORDER_PAYMENT_CANCELED_ADDITIONAL_INFO');
break;
}
*/
return true;
}
function PCPbeforeSetPaymentForm(&$form, $paramsC, $params, $order,
$eventData) {
echo '<pre>';
var_dump('se');
echo '</pre>';
exit();
if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
return false;
}
$document = JFactory::getDocument();
$sandbox = $params->get('sandbox', 0);
$merchant_email = $params->get('merchant_email',
'');
$address_override = $params->get('address_override',
'');
$country_type = $params->get('country_type', 1);
$paramsC = PhocacartUtils::getComponentParameters();
$rounding_calculation = $paramsC->get(
'rounding_calculation', 1 );
$price = new PhocacartPrice();
// !IMPORTANT
=================================================================================
// Items price * Quantities = Subotal
// - Discounts (Product, Cart, Reward Points) and Coupons
// + Shipping Costs
// + Payment Costs
// -+ Currency Rounding (in PayPal the plus is new item, the minus is
discount)
// -+ Total Amount Rounding (in PayPal the plus is new item, the minus is
discount)
//
============================================================================================
/* $orderView = new PhocacartOrderView();
$productDiscounts =
$orderView->getItemProductDiscounts($order['common']->id);
$products =
$orderView->getItemProducts($order['common']->id);
print r($order);
print r($products);
print r($productDiscounts);
// $order['products'] = $products ($order['products']
is the same link $products)
*/
//$invoice_prefix = $paramsC->get( 'invoice_prefix',
'');
//$invoice_number_format = $paramsC->get(
'invoice_number_format', '');
//$invoice_number_chars = $paramsC->get(
'invoice_number_chars', 12);
$invoiceNr =
PhocacartOrder::getInvoiceNumber($order['common']->id,
$order['common']->date,
$order['common']->invoice_number);
$orderNr =
PhocacartOrder::getOrderNumber($order['common']->id,
$order['common']->date,
$order['common']->order_number);
$itemName = JText::_('COM_PHOCACART_ORDER') . ': '
. $orderNr;
$actionLink = 'https://www.paypal.com/cgi-bin/webscr';
if ($sandbox == 1) {
$actionLink =
'https://www.sandbox.paypal.com/cgi-bin/webscr';
}
// Other currency in order - r = rate
$r = 1;
if (isset($order['common']->currency_exchange_rate)) {
$r = $order['common']->currency_exchange_rate;
}
if (isset($order['common']->payment_id) &&
(int)$order['common']->payment_id > 0) {
$paymentId = (int)$order['common']->payment_id;
} else {
$paymentId = 0;
}
$return = JURI::root(false).
'index.php?option=com_phocacart&view=response&task=response.paymentrecieve&type=paypal_standard&mid=1';
$cancel_return = JURI::root(false).
'index.php?option=com_phocacart&view=response&task=response.paymentcancel&type=paypal_standard&mid=1';
$notify_url = JURI::root(false).
'index.php?option=com_phocacart&view=response&task=response.paymentnotify&type=paypal_standard&pid='.(int)$paymentId.'&tmpl=component';
//$payment_action = '';
$f = array();
$f[] = '<form action="'.$actionLink.'"
name="phCartPayment" id="phCartPayment"
method="post">';
$f[] = '<input type="hidden" name="cmd"
value="_cart" />';
$f[] = '<input type="hidden" name="upload"
value="1" />';
$f[] = '<input type="hidden" name="business"
value="'.$merchant_email.'" />';
$f[] = '<input type="hidden" name="item_name"
value="'.$itemName.'" />';
$i = 1;
// There can be difference between cart total amount and payment total
amount (because of currency and its rounding)
// cart total amount (brutto) = (item * quantity) * currency rate
// payment total amount = (item * currency rate) * quantity
$cartBrutto = 0;// Total amount (brutto) calculated by cart
$paymentBrutto = 0;// Total amount (brutto) calculated by payment
method
$discountAmount = 0;// Sum of all discount values - all MINUS values
$currencyAmount = 0;// Sum of all currency rounding amounts - all PLUS
values
foreach ($order['products'] as $k => $v) {
$paymentBrutto = $paymentBrutto + (($price->roundPrice($v->netto *
$r)) * (int)$v->quantity);
$f[] = '<input type="hidden"
name="item_name_'.$i.'"
value="'.$v->title.'" />';
$f[] = '<input type="hidden"
name="item_number_'.$i.'"
value="'.$v->sku.'" />';
$f[] = '<input type="hidden"
name="amount_'.$i.'"
value="'.$price->roundPrice($v->netto * $r).'"
/>';
$f[] = '<input type="hidden"
name="quantity_'.$i.'"
value="'.$v->quantity.'" />';
$f[] = '<input type="hidden"
name="weight_'.$i.'"
value="'.$v->weight.'" />';
if (isset($v->attributes)) {
$j = 0;
foreach ($v->attributes as $k2 => $v2) {
$f[] = '<input type="hidden"
name="on'.$j.'_'.$i.'"
value="'.$v2->attribute_title.'" />';
$f[] = '<input type="hidden"
name="os'.$j.'_'.$i.'"
value="'.$v2->option_title.'" />';
$j++;
}
}
$i++;
}
foreach ($order['total'] as $k => $v) {
if ($v->amount != 0 || $v->amount_currency != 0) {
switch($v->type) {
// All discounts (MINUS)
case 'dnetto':
$paymentBrutto += $price->roundPrice($v->amount * $r);
$discountAmount += $price->roundPrice(abs($v->amount * $r));
break;
// Tax (PLUS)
case 'tax':
$paymentBrutto += $price->roundPrice($v->amount * $r);
$f[] = '<input type="hidden"
name="tax_cart" value="'.
$price->roundPrice($v->amount * $r).'" />';
break;
// Payment Method, Shipping Method (PLUS)
case 'sbrutto':
case 'pbrutto':
$paymentBrutto += $price->roundPrice($v->amount * $r);
$f[] = '<input type="hidden"
name="item_name_'.$i.'"
value="'.$v->title.'" />';
$f[] = '<input type="hidden"
name="amount_'.$i.'" value="'.
$price->roundPrice($v->amount * $r).'" />';
$f[] = '<input type="hidden"
name="quantity_'.$i.'" value="1"
/>';
$i++;
break;
// Rounding (PLUS/MINUS)
case 'rounding':
if ($v->amount_currency != 0) {
// Rounding is set in order currency
if ($v->amount_currency > 0) {
$currencyAmount += round($v->amount_currency, 2,
$rounding_calculation);
$paymentBrutto += round($v->amount_currency, 2,
$rounding_calculation);
} else if ($v->amount_currency < 0) {
$discountAmount += round(abs($v->amount_currency), 2,
$rounding_calculation);
$paymentBrutto += round($v->amount_currency, 2,
$rounding_calculation);
}
} else {
// Rounding is set in default currency
if ($v->amount > 0 && round(($v->amount * $r), 2,
$rounding_calculation) > 0) {
$f[] = '<input type="hidden"
name="item_name_'.$i.'"
value="'.$v->title.'" />';
$f[] = '<input type="hidden"
name="amount_'.$i.'" value="'.
round(($v->amount * $r), 2, $rounding_calculation).'"
/>';
$f[] = '<input type="hidden"
name="quantity_'.$i.'" value="1"
/>';
$paymentBrutto += round(($v->amount * $r), 2,
$rounding_calculation);
} else if ($v->amount < 0) {
$discountAmount += round(abs($v->amount * $r), 2,
$rounding_calculation);
$paymentBrutto += round(($v->amount * $r), 2,
$rounding_calculation);
}
}
break;
// Brutto (total amount)
case 'brutto':
if ($v->amount_currency != 0) {
// Brutto is set in order currency
$cartBrutto = $price->roundPrice($v->amount_currency);
} else {
// Brutto is set in default currency
$cartBrutto = $price->roundPrice($v->amount * $r);
}
break;
}
}
}
// Comparte cart brutto and payment brutto and correct payment total
amount by cart total amount
if ($cartBrutto > $paymentBrutto) {
// in PayPal - if currency rounding plus then make new item
$currencyAmount += ($cartBrutto - $paymentBrutto);
} else if ($cartBrutto < $paymentBrutto) {
// in PayPal - if currency rounding minus then make it as a part of
discount
$discountAmount += ($paymentBrutto - $cartBrutto);
}
$discountAmount = $price->roundPrice($discountAmount);
if (round($discountAmount, 2, $rounding_calculation) > 0) {
$f[] = '<input type="hidden"
name="discount_amount_cart"
value="'.round($discountAmount, 2,
$rounding_calculation).'" />';
}
if (round($currencyAmount, 2, $rounding_calculation) > 0) {
$f[] = '<input type="hidden"
name="item_name_'.$i.'"
value="'.JText::_('COM_PHOCACART_CURRENCY_ROUNDING').'"
/>';
$f[] = '<input type="hidden"
name="amount_'.$i.'" value="'.
round($currencyAmount, 2, $rounding_calculation).'" />';
$f[] = '<input type="hidden"
name="quantity_'.$i.'" value="1"
/>';
$i++;
}
$f[] = '<input type="hidden"
name="currency_code"
value="'.$order['common']->currency_code.'"
/>';
$b = $order['bas']['b'];
$f[] = '<input type="hidden"
name="first_name"
value="'.$b['name_first'].'" />';
$f[] = '<input type="hidden" name="last_name"
value="'.$b['name_last'].'" />';
$f[] = '<input type="hidden" name="address1"
value="'.$b['address_1'].'" />';
$f[] = '<input type="hidden" name="address2"
value="'.$b['address_2'].'" />';
$f[] = '<input type="hidden" name="city"
value="'.$b['city'].'" />';
$f[] = '<input type="hidden" name="zip"
value="'.$b['zip'].'" />';
if ($country_type == 2) {
$f[] = '<input type="hidden" name="country"
value="'.$b['countrycode'].'" />';
} else {
$f[] = '<input type="hidden" name="country"
value="'.$b['countrytitle'].'" />';
}
$f[] = '<input type="hidden" name="email"
value="'.$b['email'].'"
/>';//$b->email_contact
$f[] = '<input type="hidden"
name="address_override"
value="'.(int)$address_override.'" />';
$f[] = '<input type="hidden" name="invoice"
value="'.$invoiceNr.'" />';
$f[] = '<input type="hidden" name="charset"
value="UTF-8" />';
//$f[] = '<input type="hidden" name="lc"
value="" />';
$f[] = '<input type="hidden" name="rm"
value="2" />';
$f[] = '<input type="hidden" name="no_note"
value="1" />';
$f[] = '<input type="hidden" name="bn"
value="PhocaCart_Cart_PPS" />';
$f[] = '<input type="hidden" name="custom"
value="'.(int)$order['common']->id.'"
/>';
$f[] = '<input type="hidden" name="return"
value="'.$return.'" />';
$f[] = '<input type="hidden"
name="notify_url" value="'.$notify_url.'"
/>';
$f[] = '<input type="hidden"
name="cancel_return"
value="'.$cancel_return.'" />';
//$f[] = '<input type="hidden"
name="paymentaction"
value="'.$payment_action.'" />';// sale
$f[] = '<div class="ph-center">';
$f[] =
'<div>'.JText::_('COM_PHOCACART_ORDER_SUCCESSFULLY_PROCESSED').'</div>';
$f[] =
'<div>'.JText::_('PLG_PCP_PAYPAL_STANDARD_YOU_ARE_NOW_BEING_REDIRECTED_TO_PAYPAL').'</div>';
$f[] = '<div class="ph-loader"></div>';
$f[] =
'<div>'.JText::_('PLG_PCP_PAYPAL_STANDARD_IF_YOU_ARE_NOT_REDIRECTED_WITHIN_A_FEW_SECONDS_PLEASE').'
';
$f[] = '<input type="submit" class="btn
btn-primary"
value="'.JText::_('PLG_PCP_PAYPAL_CLICK_HERE_TO_BE_REDIRECTED_TO_PAYPAL').'"
class="button" />';
$f[] = '</div>';
$f[] = '</div>';
$f[] = '</form>';
$form = implode("\n", $f);
$js = 'window.onload=function(){' . "\n"
.'
window.setTimeout(document.phCartPayment.submit.bind(document.phCartPayment),
1100);'. "\n"
.'};'. "\n";
$document->addScriptDeclaration($js);
/*$form2 = str_replace('<', '<', $form);
$form2 = str_replace('>', '>', $form2);
$form2 =
'<pre><code>'.$form2.'</code></pre>';
echo $form2;*/
PhocacartLog::add(1, 'Payment - PayPal Standard - SENDING FORM TO
PAYPAL', (int)$order['common']->id, $form);
return true;
}
function PCPbeforeCheckPayment($pid, $eventData) {
echo '<pre>';
var_dump('char');
echo '</pre>';
exit();
if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
return false;
}
if (! class_exists('PhocacartPaypalStandardIpnListener')) {
require_once(
JPATH_SITE.'/plugins/pcp/paypal_standard/helpers/ipnlistener.php');
}
$app = JFactory::getApplication();
$verified = false;
$listener = new PhocacartPaypalStandardIpnListener();
$paymentTemp = new PhocacartPayment();
$paymentOTemp = $paymentTemp->getPaymentMethod((int)$pid );
$paramsPaymentTemp = $paymentOTemp->params;
$p['sandbox'] =
$paramsPaymentTemp->get('sandbox', 0);
$p['verify_ssl'] =
$paramsPaymentTemp->get('verify_ssl', 1);
if ($p['sandbox'] == 1) {
$listener->use_sandbox = true;
} else {
$listener->use_sandbox = false;
}
$listener->force_ssl_v3 = false;
$listener->use_ssl = true;
try {
$listener->setParams($p);
$listener->requirePostMethod();
$verified = $listener->processIpn();
if (!$verified) {
PhocacartLog::add(1, 'Payment - PayPal Standard - ERROR', 0,
$listener->getTextReport());
}
} catch (Exception $e) {
PhocacartLog::add(1, 'Payment - PayPal Standard - ERROR (Listener
Error)', 0, $e->getMessage());
exit(0);
}
if ($verified) {
$id = $app->input->post->get('custom', 0,
'int');
$paymentStatus =
$app->input->post->get('payment_status', '',
'string');
if ((int)$id > 0 && $paymentStatus != '') {
$order = new PhocacartOrderView();
$payment = new PhocacartPayment();
$o = array();
$o['common'] = $order->getItemCommon($id);
$o['total'] = $order->getItemTotal($id);
// Order - check if the harder has assigned the payment method
if (isset($o['common']->payment_id) &&
(int)$o['common']->payment_id > 0) {
$paymentO =
$payment->getPaymentMethod((int)$o['common']->payment_id
);
// Order - check if the payment method set in Order is the same like
this plugin
if (isset($paymentO->method)) {
$paramsPayment = $paymentO->params;
$statusOption =
$paramsPayment->get('status_'.$paymentStatus, 0);
// Status - check if returned status from paypal is assigned to
payment method order statuses
// (see Payment Method Options in Payment - Paypal statuses are
assigned to our order statuses )
// We don't check for "Completed" here, we just set
the Order status of eshop by Paypal status
// So if status option is higher than zero, it is assigned to some
if($statusOption > 0) {
// OK - we got status from PayPal which is assigned in our eshop to
order status
// Now - check all possible parameters of PayPal status
$error = 0;
$errorMsg = '';
// Merchant Email
$receiverEmail =
$app->input->post->get('receiver_email', '',
'string');
$merchantEmail = $paramsPayment->get('merchant_email',
'');
if ($receiverEmail != $merchantEmail) {
$errorMsg .= 'Merchant email does not match' . "
\n";
$error = 1;
}
// Total Amount
$mcGross = $app->input->post->get('mc_gross',
'', 'float');
$totalA = array_reverse($o['total']);
$totalBrutto = 0;
foreach($totalA as $k => $v) {
if ($v->type == 'brutto') {
$totalBrutto = $v->amount;
break;
}
}
if ($totalBrutto == 0) {
$errorMsg .= 'Total amount not found in order' . "
\n";
$error = 1;
}
// Attention Refunded and Reversed have negative amount
$mcGrossCompare = $mcGross;
if ($paymentStatus == 'Refunded' || $paymentStatus ==
'Reversed') {
$mcGrossCompare = abs($mcGross);
}
// Other currency in order - r = rate
$r = 1;
if (isset($o['common']->currency_exchange_rate)) {
$r = $o['common']->currency_exchange_rate;
}
$totalBrutto *= $r;
if ($totalBrutto != $mcGrossCompare) {
$errorMsg .= 'Total amount does not match' . "
\n"
. 'Total amount in eshop: '.$totalBrutto. "
\n"
. 'Total amount on PayPal: '.$mcGross. "
\n";
$error = 1;
}
// Currency
$mcCurrency =
$app->input->post->get('mc_currency', '',
'string');
if (strtoupper($o['common']->currency_code) !=
strtoupper($mcCurrency)) {
$errorMsg .= 'Currency does not match' . "
\n"
. 'Currency in eshop:
'.$o['common']->currency_code. " \n"
. 'Currency on PayPal: '.$mcCurrency. "
\n";
$error = 1;
}
$txnId = $app->input->post->get('txn_id',
'', 'string');
$mcFee = $app->input->post->get('mc_fee',
'', 'string');
if ($error == 1) {
$msg = 'Order Id: '. $id . " \n"
. 'Txn Id: '.$txnId. " \n"
. 'Message: '.$errorMsg. " \n"
//. 'POST: '.$val. " \n"
. 'Report: '.$listener->getTextReport();
PhocacartLog::add(1, 'Payment - PayPal Standard - ERROR',
(int)$id, $msg);
exit(0);
} else {
// 1) First change the status in database
// and create invoice in case invoice is created by status
change
if (PhocacartOrderStatus::changeStatusInOrderTable((int)$id,
(int)$statusOption)) {
PhocacartLog::add(1, 'Payment - PayPal Standard - Order
Status Change', (int)$id, 'Order status changed to:
'.$statusOption . '('.$paymentStatus.')');
}
// 2) Change the status including sending emails
// This must be second step so it can include even newly created
invoice
// (Changing status is diveded into two functions because mostly
the status id in database is changed when saving items
// models: phocacartorder, phocacarteditstatus, ... So
changeStatus method does not change the id in database)
$notify = false;
try {
$notify = PhocacartOrderStatus::changeStatus((int)$id,
(int)$statusOption, $o['common']->order_token);
} catch (RuntimeException $e) {
PhocacartLog::add(1, 'Payment - PayPal Standard -
ERROR', (int)$id, $e->getMessage());
}
$comment =
JText::_('COM_PHOCACART_ORDER_STATUS_CHANGED_BY_PAYMENT_SERVICE_PROVIDER')
. '(Paypal Standard)';
$comment .= "\n" .
JText::_('COM_PHOCACART_INFORMATION');
$comment .= "\n".
JText::_('COM_PHOCACART_PAYMENT_ID'). ': '. $txnId;
$comment .= "\n".
JText::_('COM_PHOCACART_PAYMENT_AMOUNT'). ': '.
$mcGross;
$comment .= "\n".
JText::_('COM_PHOCACART_PAYMENT_FEE'). ': '. $mcFee;
$comment .= "\n".
JText::_('COM_PHOCACART_PAYMENT_STATUS'). ': '.
$paymentStatus;
// Add status history
PhocacartOrderStatus::setHistory((int)$id, (int)$statusOption,
(int)$notify, $comment);
// Add log
$msg = 'Order Id: '. $id . " \n"
. 'Txn Id: '.$txnId. " \n"
. 'Message: Payment successfully made'. " \n"
//. 'POST: '.$val. " \n"
. 'Report: '.$listener->getTextReport();
PhocacartLog::add(1, 'Payment - PayPal Standard -
SUCCESS', (int)$id, $msg);
exit(0);
}
}
}
}
} else {
PhocacartLog::add(1, 'Payment - PayPal Standard - ERROR', 0,
'No order id or payment status found in payment response');
exit(0);
}
} else {
PhocacartLog::add(1, 'Payment - PayPal Standard - ERROR', 0,
$listener->getTextReport());
exit(0);
}
exit(0);
}
/* The payment method plugin can decide whether or not to empty the cart
when an order is placed.
* For example, if the payment gateway returns information about a failed
payment,
* the cart can remain filled and the customer can try to make the payment
again.
* However, if the payment method plugin decides not to delete the items
in the cart,
* then it must use other events to ensure that the cart is deleted. For
example, on a successful payment.
*
* To empty cart:
*
* $cart = new PhocacartCart();
* $cart->emptyCart();
* PhocacartUserGuestuser::cancelGuestUser();
*
* For example in following events:
* - PCPafterRecievePayment
* - PCPafterCancelPayment
* - PCPbeforeCheckPayment
* - PCPonPaymentWebhook
*
* If the cart is not emptied and the user re-orders,
* then a new order ID is created - which is generally standard procedure
*/
function PCPbeforeEmptyCartAfterOrder(&$form, &$pluginData,
$paramsC, $params, $order, $eventData) {
echo '<pre>';
var_dump('panj');
echo '</pre>';
exit();
if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
return false;
}
// Uncomment to not empty cart when order is placed
// $pluginData['emptycart'] = false;
return true;
}
/**
* Payment Recieve
*
* @param integer $mid ID of message - can be set in
PCPbeforeSetPaymentForm
* @param string $message Custom message array set by plugin to
override standard messages made by component
*
* @return boolean True
*/
function PCPafterRecievePayment($mid, &$message, $eventData){
echo '<pre>';
var_dump('shish');
echo '</pre>';
exit();
if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
return false;
}
// Uncomment to empty cart when PCPafterRecievePayment is reached
// $cart = new PhocacartCart();
// $cart->emptyCart();
// PhocacartUserGuestuser::cancelGuestUser();
$message = array();
return true;
}
/*
function PCPbeforeShowPossiblePaymentMethod(&$active, $params,
$eventData){
if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
return false;
}
// Payment plugin can disable/deactivate current payment method in
possible payment method list based on own rules
// $active = false;
return true;
}
function PCPonInfoViewDisplayContent($data, $eventData){
if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
return false;
}
$output = array();
$output['content'] = '';
return $output;
}
/*
* Payment plugin wants to display some information on Item View (Detail
View) page
* */
/*
public function PCPonItemBeforeEndPricePanel($context, &$item,
&$params) {
//return "<div></div>";
}
*/
}
?>
PKi��[pge�paypal_standard.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension type="plugin" group="pcp"
method="upgrade" version="3.9">
<name>plg_pcp_paypal_standard</name>
<author>Jan Pavelka (www.phoca.cz)</author>
<creationDate>04/10/2021</creationDate>
<authorEmail></authorEmail>
<authorUrl>https://www.phoca.cz</authorUrl>
<copyright>Jan Pavelka</copyright>
<license>GNU/GPL</license>
<version>3.5.8</version>
<description>PLG_PCP_PAYPAL_STANDARD_DESCRIPTION</description>
<projectName>PhocaCartPayPalStandardPlugin</projectName>
<files>
<folder>helpers</folder>
<filename
plugin="paypal_standard">index.html</filename>
<filename
plugin="paypal_standard">paypal_standard.php</filename>
</files>
<languages>
<language
tag="en-GB">language/en-GB/en-GB.plg_pcp_paypal_standard.ini</language>
<language
tag="en-GB">language/en-GB/en-GB.plg_pcp_paypal_standard.sys.ini</language>
</languages>
<administration>
<languages>
<language
tag="en-GB">language/en-GB/en-GB.plg_pcp_paypal_standard.ini</language>
<language
tag="en-GB">language/en-GB/en-GB.plg_pcp_paypal_standard.sys.ini</language>
</languages>
</administration>
<form>
<fields name="params"
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fieldset name="payment"
addpath="/administrator/components/com_phocacart/models/fields"
group="pcp">
<field name="merchant_email" type="text"
class="inputbox" size="40"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_MERCHANT_EMAIL_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_MERCHANT_EMAIL_DESC"
required="true"/>
<field name="sandbox" type="list"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_SANDBOX_MODE_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_SANDBOX_MODE_DESC"
default="0">
<option
value="1">PLG_PCP_PAYPAL_STANDARD_YES</option>
<option
value="0">PLG_PCP_PAYPAL_STANDARD_NO</option>
</field>
<field name="verify_ssl" type="list"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_VERIFY_SSL_CERTIFICATE_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_VERIFY_SSL_CERTIFICATE_DESC"
default="1">
<option
value="1">PLG_PCP_PAYPAL_STANDARD_YES</option>
<option
value="0">PLG_PCP_PAYPAL_STANDARD_NO</option>
</field>
<field name="address_override" type="list"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_ADDRESS_OVERRIDE_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_ADDRESS_OVERRIDE_DESC"
default="0">
<option
value="1">PLG_PCP_PAYPAL_STANDARD_YES</option>
<option
value="0">PLG_PCP_PAYPAL_STANDARD_NO</option>
</field>
<field name="country_type" type="list"
label="PLG_PCP_PAYPAL_STANDARD_COUNTRY_FIELD_TYPE_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_COUNTRY_FIELD_TYPE_DESC"
default="1">
<option
value="1">PLG_PCP_PAYPAL_STANDARD_COUNTRY_TITLE</option>
<option
value="2">PLG_PCP_PAYPAL_STANDARD_COUNTRY_CODE</option>
</field>
<field name="status_Canceled_Reversal"
type="PhocaCartOrderStatus" default="3"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_CANCELED_REVERSAL_STATUS_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_COMMON_STATUS_DESC"/>
<field name="status_Completed"
type="PhocaCartOrderStatus" default="6"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_COMPLETED_STATUS_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_COMMON_STATUS_DESC"/>
<field name="status_Denied"
type="PhocaCartOrderStatus" default="3"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_DENIED_STATUS_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_COMMON_STATUS_DESC"/>
<field name="status_Expired"
type="PhocaCartOrderStatus" default="3"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_EXPIRED_STATUS_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_COMMON_STATUS_DESC"/>
<field name="status_Failed"
type="PhocaCartOrderStatus" default="3"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_FAILED_STATUS_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_COMMON_STATUS_DESC"/>
<field name="status_Pending"
type="PhocaCartOrderStatus" default="3"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_PENDING_STATUS_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_COMMON_STATUS_DESC"/>
<field name="status_Processed"
type="PhocaCartOrderStatus" default="3"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_PROCESSED_STATUS_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_COMMON_STATUS_DESC"/>
<field name="status_Refunded"
type="PhocaCartOrderStatus" default="3"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_REFUNDED_STATUS_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_COMMON_STATUS_DESC"/>
<field name="status_Reversed"
type="PhocaCartOrderStatus" default="3"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_REVERSED_STATUS_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_COMMON_STATUS_DESC"/>
<field name="status_Voided"
type="PhocaCartOrderStatus" default="3"
label="PLG_PCP_PAYPAL_STANDARD_FIELD_VOIDED_STATUS_LABEL"
description="PLG_PCP_PAYPAL_STANDARD_FIELD_COMMON_STATUS_DESC"/>
</fieldset>
</fields>
</form>
<updateservers>
<server type="extension"
name="PLG_PCP_PAYPAL_STANDARD"
priority="1"><![CDATA[https://raw.githubusercontent.com/PhocaCz/PhocaCartPayPalStandardPlugin/master/manifest.xml]]></server>
</updateservers>
</extension>
PKi��[Ay{L1%1%helpers/api_cert_chain.crtnu�[���PKi��[�#o,,{%helpers/index.htmlnu�[���PKi��[�+Ւt-t-�%helpers/ipnlistener.phpnu�[���PKi��[��ؙWW�Shelpers/main.phpnu�[���PKi��[�#o,,
;Uindex.htmlnu�[���PKi��[X �
�g�g�Upaypal_standard.phpnu�[���PKi��[pgeÌ�ӽpaypal_standard.xmlnu�[���PKC��