Added Ezypayment next payment check

This commit is contained in:
Deon George
2019-06-11 12:36:58 +10:00
parent c45f5136fe
commit eb254def7a
4 changed files with 107 additions and 11 deletions

View File

@@ -38,10 +38,17 @@ class Ezypay extends Payments
return json_decode($result->getBody()->getContents());
}
public function getCustomer(string $id)
{
return Cache::remember(__METHOD__.$id,86400,function() use ($id) {
return collect($this->connect('accounts/customerid/'.$id));
});
}
public function getCustomers(): Collection
{
return Cache::remember(__METHOD__,86400,function() {
return collect($this->connect('customers'));
return collect($this->connect('customers?pageSize=100'));
});
}