fix: 🐛 Mollie gateway route and settings
This commit is contained in:
parent
c95cde5cde
commit
5b44df24ab
5 changed files with 29 additions and 18 deletions
|
@ -67,9 +67,9 @@ class MollieExtension extends AbstractExtension
|
|||
'currency' => $shopProduct->currency_code,
|
||||
'value' => number_format($shopProduct->getTotalPrice(), 2, '.', ''),
|
||||
],
|
||||
'description' => "Order #{$payment->id}",
|
||||
'redirectUrl' => route('payment.mollieSuccess', ['payment' => $payment->id]),
|
||||
'cancelUrl' => route('payment.cancel'),
|
||||
'description' => "Order #{$payment->id} - " . $shopProduct->name,
|
||||
'redirectUrl' => route('payment.MollieSuccess'),
|
||||
'cancelUrl' => route('payment.Cancel'),
|
||||
'webhookUrl' => url('/extensions/payment/MollieWebhook'),
|
||||
'metadata' => [
|
||||
'payment_id' => $payment->id,
|
||||
|
@ -77,7 +77,7 @@ class MollieExtension extends AbstractExtension
|
|||
]);
|
||||
|
||||
if ($response->status() != 201) {
|
||||
Log::error('Mollie Payment: ' . $response->json()['title']);
|
||||
Log::error('Mollie Payment: ' . $response->body());
|
||||
$payment->delete();
|
||||
|
||||
Redirect::route('store.index')->with('error', __('Payment failed'))->send();
|
||||
|
|
|
@ -18,7 +18,7 @@ class MollieSettings extends Settings
|
|||
public static function encrypted(): array
|
||||
{
|
||||
return [
|
||||
"api_key",
|
||||
'api_key',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,12 @@ class MollieSettings extends Settings
|
|||
'type' => 'string',
|
||||
'label' => 'API Key',
|
||||
'description' => 'The API Key of your Mollie App',
|
||||
]
|
||||
],
|
||||
'enabled' => [
|
||||
'type' => 'boolean',
|
||||
'label' => 'Enabled',
|
||||
'description' => 'Enable or disable this payment gateway',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
use App\Extensions\PaymentGateways\Mollie\MollieExtension;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Extensions\PaymentGateways\Mollie\MollieExtension;
|
||||
|
||||
Route::middleware(['web', 'auth'])->group(function () {
|
||||
Route::get('payment/MolliePay/{shopProduct}', function () {
|
||||
|
@ -9,9 +9,14 @@ Route::middleware(['web', 'auth'])->group(function () {
|
|||
})->name('payment.MolliePay');
|
||||
|
||||
Route::get(
|
||||
'payment/PayPalSuccess',
|
||||
'payment/MollieSuccess',
|
||||
function () {
|
||||
MollieExtension::success(request());
|
||||
}
|
||||
)->name('payment.MollieSuccess');
|
||||
});
|
||||
|
||||
|
||||
Route::post('payment/MollieWebhook', function () {
|
||||
MollieExtension::webhook(request());
|
||||
})->name('payment.MollieWebhook');
|
||||
|
|
2
storage/framework/cache/data/.gitignore
vendored
2
storage/framework/cache/data/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
*
|
||||
!.gitignore
|
|
@ -84,14 +84,17 @@
|
|||
|
||||
@foreach ($paymentGateways as $gateway)
|
||||
<div class="ml-2">
|
||||
<label class="text-center" for="{{ $gateway->name }}">
|
||||
<img class="mb-3" height="50"
|
||||
src="{{ $gateway->image }}"></br>
|
||||
<input x-on:click="console.log(payment_method)"
|
||||
x-model="payment_method" type="radio"
|
||||
id="{{ $gateway->name }}" value="{{ $gateway->name }}">
|
||||
</input>
|
||||
</label>
|
||||
<span data-toggle="popover" data-trigger="hover" data-placement="bottom"
|
||||
data-content="{{ $gateway->name }}"> <label class="text-center"
|
||||
for="{{ $gateway->name }}">
|
||||
<img class="mb-3" height="50" src="{{ $gateway->image }}">
|
||||
</br>
|
||||
<input x-on:click="console.log(payment_method)"
|
||||
x-model="payment_method" type="radio"
|
||||
id="{{ $gateway->name }}" value="{{ $gateway->name }}">
|
||||
</input>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue