mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Payfast
This commit is contained in:
parent
ad4413018f
commit
fbe4ac3fb6
@ -94,7 +94,7 @@ class Token
|
||||
|
||||
// $header['signature'] = md5( $this->generate_parameter_string(array_merge($header, $body), false) );
|
||||
|
||||
$header['signature'] = $this->genSig(array_merge($body, $header));
|
||||
$header['signature'] = $this->payfast->generateTokenSignature(array_merge($body, $header));
|
||||
|
||||
nlog($header['signature']);
|
||||
|
||||
|
@ -123,7 +123,36 @@ class PayFastPaymentDriver extends BaseDriver
|
||||
return (new Token($this))->tokenBilling($cgt, $payment_hash);
|
||||
}
|
||||
|
||||
public function generateSignature($data)
|
||||
public function generateTokenSignature($data)
|
||||
{
|
||||
$fields = [];
|
||||
|
||||
$keys = [
|
||||
'merchant-id',
|
||||
'version',
|
||||
'timestamp',
|
||||
'amount',
|
||||
'item_name',
|
||||
'item_description',
|
||||
'itn',
|
||||
'm_payment_id',
|
||||
'cc_css',
|
||||
'split_payment'
|
||||
];
|
||||
|
||||
foreach($keys as $key)
|
||||
{
|
||||
if (!empty($data[$key])) {
|
||||
$fields[$key] = $data[$key];
|
||||
}
|
||||
}
|
||||
|
||||
nlog(http_build_query($fields));
|
||||
|
||||
return md5(http_build_query($fields));
|
||||
}
|
||||
|
||||
public function generateSignature($data)
|
||||
{
|
||||
$fields = array();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user