1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00

Enable Mollie webhooks

This commit is contained in:
Hillel Coren 2017-07-06 13:10:54 +03:00
parent 6141c48373
commit ac8938eea9
2 changed files with 17 additions and 2 deletions

View File

@ -11,7 +11,8 @@ class MolliePaymentDriver extends BasePaymentDriver
$data = parent::paymentDetails($paymentMethod);
// Enable the webhooks
$data['notifyUrl'] = $data['returnUrl'];
//$data['notifyUrl'] = $data['returnUrl'];
$data['notifyUrl'] = url('/payment_hook/'. $this->account->account_key . '/' . GATEWAY_MOLLIE);
return $data;
}
@ -24,6 +25,9 @@ class MolliePaymentDriver extends BasePaymentDriver
$response = $this->gateway()->fetchTransaction($details)->send();
\Log::info('completeOffsitePurchase');
\Log::info($response);
if ($response->isCancelled()) {
return false;
} elseif (! $response->isSuccessful()) {
@ -32,4 +36,15 @@ class MolliePaymentDriver extends BasePaymentDriver
return $this->createPayment($response->getTransactionReference());
}
public function handleWebHook($input)
{
//$paymentId = array_get($input, 'id');
$response = $this->gateway()->fetchTransaction($input)->send();
\Log::info('handleWebHook');
\Log::info($response);
return 'Processed successfully';
}
}

View File

@ -22,7 +22,7 @@ class UpdateDarkMode extends Migration
$table->text('credit_number_pattern')->nullable();
});
DB::statement('update users set dark_mode = 1;');
DB::statement('update users set dark_mode = 1');
// update invoice_item_type_id for task invoice items
DB::statement('update invoice_items