Skip to content
This repository was archived by the owner on Nov 11, 2019. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions bitpay/bp_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ function bpVerifyNotification($apiKey = false) {
return array('error' => '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 @@ -140,7 +145,10 @@ function bpGetInvoice($invoiceId, $apiKey=false) {
return array('error' => $response);
//decode posData
$response['posData'] = json_decode($response['posData'], true);
$response['posData'] = $response['posData']['posData'];
if($bpOptions['verifyPos'])
{
$response['posData'] = $response['posData']['posData'];
}

return $response;
}
Expand Down