order = $order; $this->transaction = $transaction; $this->amountToRefund = $amountToRefund; $this->items = $items; } /** * Execute the job. * * @return void * @throws \RuntimeException If the transaction payment mode given is inShop or if the transaction refund failed. * @phpcs:disable Squiz.Commenting.FunctionCommentThrowTag.WrongNumber */ public function handle() { // phpcs:enable if ($this->transaction->payment_mode->equals(PaymentModeEnum::inShop())) { throw new \RuntimeException('An inShop transaction cannot be refunded by the platform'); } $this->transaction->getAdapter()->doRefundCustomer( $this->transaction, $this->amountToRefund, $this->items ); } }