diff --git a/README.md b/README.md index c000a6a..ea6db93 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -©2011-2014 BITPAY, INC. +©2011-2015 BITPAY, INC. + +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. diff --git a/bitpay/bp_lib.php b/bitpay/bp_lib.php index 2cfcc40..dee7491 100644 --- a/bitpay/bp_lib.php +++ b/bitpay/bp_lib.php @@ -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') @@ -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; }