diff --git a/README.md b/README.md index 17bb920..9e445b4 100644 --- a/README.md +++ b/README.md @@ -27,17 +27,6 @@ $thepeer->chargeLink("lost-in-the-world", 5000, "Benz"); - request (object) - `returns`: boolean -* getSendReceipt - - `accepts`: - - receipt_id (string) - - `returns`: object - -* processSendReceipt - - `accepts`: - - receipt_id (string) - - event (string) - - `returns`: object - * indexUser - `accepts`: - name (string) @@ -58,16 +47,16 @@ $thepeer->chargeLink("lost-in-the-world", 5000, "Benz"); * getLink - `accepts`: - - lind_id (string) + - link_id (string) - `returns`: object * chargeLink - `accepts`: - - lind_id (string) + - link_id (string) - amount (integer) - `returns`: object -* authorizaDirectCharge +* authorizeCharge - `accepts`: - reference (string) - event (string) diff --git a/src/Thepeer.php b/src/Thepeer.php index 4dfd601..b381be3 100644 --- a/src/Thepeer.php +++ b/src/Thepeer.php @@ -52,36 +52,6 @@ public function validateSignature(Request $payload) return $headerSignature === $calculatedSignature; } - public function getSendReceipt(string $receipt) - { - try { - $request = $this->client->get("/send/{$receipt}"); - - $payload = json_decode($request->getBody()->getContents()); - - return $this->processResponse($payload, $request); - } catch (GuzzleException $e) { - throw new ServerErrorException($e->getMessage()); - } - } - - public function processSendReceipt(string $receipt, string $event) - { - try { - $request = $this->client->post("/send/{$receipt}", [ - "body" => json_encode([ - 'event' => $event, - ]) - ]); - - $payload = json_decode($request->getBody()->getContents()); - - return $this->processResponse($payload, $request); - } catch (GuzzleException $e) { - throw new ServerErrorException($e->getMessage()); - } - } - public function indexUser(string $name, string $email, string $identifier) { try { @@ -162,10 +132,10 @@ public function chargeLink(string $link, int $amount, string $remark) } } - public function authorizeDirectCharge(string $reference, string $event) + public function authorizeCharge(string $reference, string $event) { try { - $request = $this->client->post("/debit/{$reference}", [ + $request = $this->client->post("/authorization/{$reference}", [ "body" => json_encode([ 'event' => $event, ])