Turning on token billing for PayFast

This commit is contained in:
David Bomba 2021-09-23 14:20:04 +10:00
parent 3fafc46ca7
commit a2d437deae

View File

@ -170,8 +170,8 @@ class Token
$parameter_string = rtrim( $parameter_string, '&' );
}
nlog($parameter_string);
return $parameter_string;
return md5( $parameter_string, false, false );
}
private function genSig($data)
@ -198,7 +198,9 @@ class Token
]);
try {
$response = $client->post("https://api.payfast.co.za/subscriptions/{$token}/adhoc?testing=true",['query' => $body]);
$response = $client->post("https://api.payfast.co.za/subscriptions/{$token}/adhoc?testing=true",[
RequestOptions::JSON => ['body' => $body], RequestOptions::ALLOW_REDIRECTS => false
]);
return json_decode($response->getBody(),true);
}