Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 3 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
34 changes: 2 additions & 32 deletions src/Thepeer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
])
Expand Down