Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #12 from sambohler/master
Browse files Browse the repository at this point in the history
Security Patch
  • Loading branch information
JoshuaEstes committed Oct 10, 2014
2 parents e8688fa + 92fdf13 commit 0fd6651
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bitpay/bp_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@ function bpVerifyNotification($apiKey = false) {
return 'authentication failed (bad hash)';
$json['posData'] = $posData['posData'];

return $json;
if (!array_key_exists('id', $json))
{
return 'Cannot find invoice ID';
}

return bpGetInvoice($json['id'], $apiKey);
}

// $options can include ('apiKey')
Expand All @@ -143,6 +148,10 @@ function bpGetInvoice($invoiceId, $apiKey=false) {
if (is_string($response))
return $response; // error
$response['posData'] = json_decode($response['posData'], true);
if($bpOptions['verifyPos'])
{
$response['posData'] = $response['posData']['posData'];
}
return $response;
}

Expand Down

0 comments on commit 0fd6651

Please sign in to comment.