Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1 from bitpay/master
Browse files Browse the repository at this point in the history
Sync with Bitpay
  • Loading branch information
ionux committed Feb 20, 2015
2 parents 3a006e6 + 6603e8f commit 7511238
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
@@ -1,4 +1,6 @@
<strong>©2011-2014 BITPAY, INC.</strong>
<strong>©2011-2015 BITPAY, INC.</strong>

The MIT License

Permission is hereby granted to any person obtaining a copy of this software and associated documentation for use and/or modification in association with the bitpay.com service.

Expand Down
12 changes: 10 additions & 2 deletions bitpay/bp_lib.php
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

0 comments on commit 7511238

Please sign in to comment.