diff --git a/README.md b/README.md index b436e37..17bb920 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ $thepeer->chargeLink("lost-in-the-world", 5000, "Benz"); * processSendReceipt - `accepts`: - receipt_id (string) - - insufficient_funds (bool) + - event (string) - `returns`: object * indexUser @@ -70,7 +70,7 @@ $thepeer->chargeLink("lost-in-the-world", 5000, "Benz"); * authorizaDirectCharge - `accepts`: - reference (string) - - insufficient_funds (bool) + - event (string) - `returns`: object ## Extra diff --git a/src/Thepeer.php b/src/Thepeer.php index 47a9865..4dfd601 100644 --- a/src/Thepeer.php +++ b/src/Thepeer.php @@ -49,11 +49,7 @@ public function validateSignature(Request $payload) $calculatedSignature = hash_hmac('sha1', json_encode($payload->all()), $this->secretKey); - if ($headerSignature === $calculatedSignature) { - return true; - } - - return false; + return $headerSignature === $calculatedSignature; } public function getSendReceipt(string $receipt) @@ -69,12 +65,12 @@ public function getSendReceipt(string $receipt) } } - public function processSendReceipt(string $receipt, bool $insufficient_funds) + public function processSendReceipt(string $receipt, string $event) { try { $request = $this->client->post("/send/{$receipt}", [ "body" => json_encode([ - 'insufficient_funds' => $insufficient_funds, + 'event' => $event, ]) ]); @@ -166,12 +162,12 @@ public function chargeLink(string $link, int $amount, string $remark) } } - public function authorizeDirectCharge(string $reference, bool $insufficient_funds) + public function authorizeDirectCharge(string $reference, string $event) { try { $request = $this->client->post("/debit/{$reference}", [ "body" => json_encode([ - 'insufficient_funds' => $insufficient_funds, + 'event' => $event, ]) ]);