我在客户网站上使用Barclaycard EPDQ模块(由Qphoria提供),该网站运行良好,但Q并未回复电子邮件以帮助解决此问题(付费我可能会添加)。
问题是付款页面的默认设计很差(Barclaycard结束),我们可以通过回电添加我们自己的付款页面。
<input type="hidden" name="TP" value="">
我想我找到了需要编辑的文件才能添加但不知道在哪里:
<?php
/**
* @author Qphoria@gmail.com
* @web http://www.opencartguru.com/
*
* @usage
* $params = array(
* 'xxx' => 'value1',
* 'yyy' => 'value2',
* 'zzz' => 'value3',
* );
*
* $payclass = New PayClass();
* $payclass->sendPayment($params);
*/
class barclay_advanced {
private $_url = 'https://payments.epdq.co.uk/ncol/prod/orderstandard.asp';
private $_testurl = 'https://mdepayments.epdq.co.uk/ncol/test/orderstandard.asp';
private $_log = '';
public function __construct($logpath = '') {
if ($logpath && is_dir($logpath) && is_writable($logpath)) { $this->_log = $logpath . basename(__FILE__, '.php') . '.log'; }
}
public function buildOutput($params) {
$url = $this->_url;
if (isset($params['test'])) {
unset($params['test']);
$url = $this->_testurl;
}
// Get the key but remove from the form list
$passphrase = $params['key'];
unset($params['key']);
ksort($params);
$hash = '';
foreach ($params as $k => $v) {
$hash .= $k . '=' . $v . trim($passphrase);
}
$this->writeLog('HASH STRING: ' . $hash);
$sha1hash = strtoupper(sha1($hash));
$params['SHASIGN'] = $sha1hash;
$data = 'Redirecting...';
$data .= '<form action="'.$url.'" id="payform" method="post">';
foreach ($params as $key => $value) {
if ($key == 'OWNERZIP' && !$value) { continue; } // Skip missing zip
$data .= '<input type="hidden" name="'.$key.'" value="'.$value.'" />';
}
$data .= '<input type="submit" value="-->" />';
$data .= '</form>';
$data .= '<script type="text/javascript">';
$data .= 'document.forms["payform"].submit();';
$data .= '</script>';
$this->writeLog($data);
return $data;
}
private function writeLog($msg) {
if ($this->_log) {
$msg = (str_repeat('-', 70) . "\r\n" . $msg . "\r\n" . str_repeat('-', 70) . "\r\n");
file_put_contents($this->_log, $msg, FILE_APPEND);
}
}
}
?>
任何人都可以帮助我解决这个问题?
答案 0 :(得分:1)
就在之前:
$data .= '<input type="submit" value="-->" />';
添加您想要的行:
$data .= '<input type="hidden" name="TP" value="">';
交替查找此函数的调用位置:buildOutput($ params)并添加到$ params
阵列
'TP' => 'value'
还有许多其他选择,但最好的方法是遵循开发人员已经设置的路线,即在$ params数组中添加参数。