mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
Vourcherify
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Vouchers\Services;
|
||||
|
||||
use ErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class RollbacksRedemption
|
||||
{
|
||||
|
||||
/** @var VoucherifyClient */
|
||||
private $voucherifyClient;
|
||||
|
||||
|
||||
/**
|
||||
* RollbacksRedemption constructor.
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->voucherifyClient = createVoucherifyClient();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $redemptionId
|
||||
* @return null|object
|
||||
* @throws ErrorException
|
||||
*/
|
||||
public function execute(string $redemptionId)
|
||||
{
|
||||
try {
|
||||
$result = $this->voucherifyClient->redemptions->rollback($redemptionId);
|
||||
return $result;
|
||||
} catch (\Voucherify\ClientException $e) {
|
||||
Log::error('RollbacksRedemption error:' . $e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user