Fix bug where non-Stripe refunds were failing

This commit is contained in:
Dave 2016-03-22 15:24:31 +00:00
parent f82648c1f7
commit 20b7361178
1 changed files with 2 additions and 4 deletions

View File

@ -129,11 +129,9 @@ class EventOrdersController extends MyBaseController
}
if (!$error_message) {
try {
$gateway = Omnipay::gateway('stripe');
$gateway = Omnipay::create($order->payment_gateway->name);
$gateway->initialize([
'apiKey' => $order->account->stripe_api_key,
]);
$gateway->initialize($order->account->getGateway($order->payment_gateway->id)->config);
if ($refund_type === 'full') { /* Full refund */
$refund_amount = $order->organiser_amount - $order->amount_refunded;