Skip to content

Commit 6100dd1

Browse files
committed
fix: resolved bug when redirecting to callback url after successful paystack payment
1 parent 4b0fdba commit 6100dd1

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/Traits/Paystack/TransactionTrait.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getPaymentData(): array
7676
{
7777
$this->validateTransaction();
7878

79-
return $this->getData();
79+
return $this->getResponse();
8080
}
8181

8282
/**
@@ -99,22 +99,31 @@ private function validateTransaction(): void
9999
*/
100100
public function verifyTransaction(string $reference): array
101101
{
102-
return $this->httpClient()->get(url: "transaction/verify/{$reference}");
102+
return $this->makeRequest(
103+
method: 'GET',
104+
requestUrl: "transaction/verify/{$reference}",
105+
);
103106
}
104107

105108
/**
106109
* Hit Paystack's Api to get a transaction
107110
*/
108111
public function getTransaction(string $reference): array
109112
{
110-
return $this->httpClient()->get(url: "transaction/{$reference}");
113+
return $this->makeRequest(
114+
method: 'GET',
115+
requestUrl: "transaction/{$reference}",
116+
);
111117
}
112118

113119
/**
114120
* Hit Paystack's Api to get all transaction
115121
*/
116122
public function getAllTransactions(): array
117123
{
118-
return $this->httpClient()->get(url: 'transaction');
124+
return $this->makeRequest(
125+
method: 'GET',
126+
requestUrl: "transactions",
127+
);
119128
}
120129
}

0 commit comments

Comments
 (0)