Commit 45aa9496 authored by oskar's avatar oskar

fixed 'wrong-exception-construct' problem. fix #41

parent 9626ede5
......@@ -584,7 +584,7 @@ class PayPalFinance extends PaymentMethod
$payment = Payment::get($paymentId, $apiContext);
if ($payment->getState() != 'created') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
/*
......
......@@ -566,7 +566,7 @@ class PayPalPlus extends PaymentMethod
$payment = Payment::get($paymentId, $apiContext);
if ($payment->getState() != 'created') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
/*
......
......@@ -606,7 +606,7 @@ class PayPalFinance extends PaymentMethod
$payment = Payment::get($paymentId, $apiContext);
if ($payment->getState() != 'created') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
$this->patch($payment, $orderNumber, $_SESSION['Lieferadresse']);
......
......@@ -504,7 +504,7 @@ class PayPalPlus extends PaymentMethod
$payment = Payment::get($paymentId, $apiContext);
if ($payment->getState() != 'created') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
/*
......
......@@ -732,7 +732,7 @@ class PayPalFinance extends PaymentMethod
$this->logResult('ExecutePayment', $execution, $payment);
if ($payment->getState() !== 'approved') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
$sale = $payment->getTransactions()[0]
......
......@@ -734,7 +734,7 @@ class PayPalFinance extends PaymentMethod
$this->logResult('ExecutePayment', $execution, $payment);
if ($payment->getState() === 'failed') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
$sale = $payment->getTransactions()[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment