| Total Complexity | 6 |
| Total Lines | 80 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class Transaction |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | protected $checkoutId; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | protected $endpoint; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var array |
||
| 27 | */ |
||
| 28 | protected $clientConfig = []; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Transaction constructor. |
||
| 32 | * |
||
| 33 | * @param string $checkoutId |
||
| 34 | */ |
||
| 35 | public function __construct(string $checkoutId) |
||
| 36 | { |
||
| 37 | $this->setCheckoutId($checkoutId); |
||
| 38 | |||
| 39 | if (config('sibs.mode') === 'test') { |
||
| 40 | $this->clientConfig = [ |
||
| 41 | 'verify' => false, |
||
| 42 | ]; |
||
| 43 | } |
||
| 44 | $this->endpoint = config('sibs.host') . config('sibs.version') . '/'; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | public function getCheckoutId(): string |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param mixed $checkoutId |
||
| 57 | */ |
||
| 58 | public function setCheckoutId($checkoutId): void |
||
| 59 | { |
||
| 60 | $this->checkoutId = $checkoutId; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Get status payment |
||
| 65 | * |
||
| 66 | * @return object |
||
| 67 | */ |
||
| 68 | public function status(): object |
||
| 93 | } |
||
| 94 | } |
||
| 95 | } |
||
| 96 |