mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
39 lines
839 B
PHP
39 lines
839 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Vouchers\Services\Voucherify;
|
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class FetchesVoucherifyRedemption
|
|
{
|
|
|
|
/** @var VoucherifyClient */
|
|
private $voucherifyClient;
|
|
|
|
|
|
/**
|
|
* FetchesVoucherifyRedemption constructor.
|
|
*
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->voucherifyClient = createVoucherifyClient();
|
|
}
|
|
|
|
/**
|
|
* @param string $redemptionId
|
|
* @return null|object
|
|
* @throws \Voucherify\ClientException
|
|
*/
|
|
public function execute(string $redemptionId)
|
|
{
|
|
try {
|
|
$result = $this->voucherifyClient->redemptions->get($redemptionId);
|
|
return $result;
|
|
} catch (\Voucherify\ClientException $e) {
|
|
Log::error('FetchesVoucherifyRedemption '.$e);
|
|
return null;
|
|
}
|
|
}
|
|
}
|