Add get an individual payment
This commit is contained in:
parent
2f75c7dd1f
commit
dd82509008
22
src/API.php
22
src/API.php
@ -8,7 +8,7 @@ use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use Intuit\Exceptions\{ConnectionIssueException,InvalidQueryResultException};
|
||||
use Intuit\Models\{ProviderToken};
|
||||
use Intuit\Models\{ProviderToken,Payment};
|
||||
use Intuit\Response\{Customer,Invoice,ListList};
|
||||
|
||||
final class API
|
||||
@ -289,6 +289,26 @@ final class API
|
||||
return new ListList($this->execute('query',$parameters),$key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a specific payment record
|
||||
*
|
||||
* @param int $id
|
||||
* @param array $parameters
|
||||
* @return Payment
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getPayment(int $id,array $parameters=[]): Payment
|
||||
{
|
||||
Log::debug(sprintf('%s:Get a specific payment [%d]',static::LOGKEY,$id));
|
||||
|
||||
$x = $this->execute('payment/'.$id,$parameters);
|
||||
|
||||
if (! $x->Payment)
|
||||
throw new InvalidQueryResultException(sprintf('%s:Query response malformed',self::LOGKEY));
|
||||
|
||||
return new Payment((array)$x->Payment);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of our payments
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user