diff --git a/app/Http/Controllers/Give/GivingPageController.php b/app/Http/Controllers/Give/GivingPageController.php index c626df7..68fd667 100644 --- a/app/Http/Controllers/Give/GivingPageController.php +++ b/app/Http/Controllers/Give/GivingPageController.php @@ -65,7 +65,6 @@ class GivingPageController extends Controller 'brand_color' => ['nullable', 'string', 'max:20'], 'collection_types' => ['nullable', 'array', 'min:1'], 'collection_types.*' => ['string', 'max:80'], - 'accepts_payment' => ['nullable', 'boolean'], 'church_logo' => ['nullable', 'image', 'mimes:jpeg,jpg,png,gif,webp', 'max:4096'], 'church_cover' => ['nullable', 'image', 'mimes:jpeg,jpg,png,gif,webp', 'max:8192'], ]); @@ -73,7 +72,7 @@ class GivingPageController extends Controller $data = array_merge($request->all(), [ 'type' => QrCode::TYPE_CHURCH, 'currency' => 'GHS', - 'accepts_payment' => $request->boolean('accepts_payment'), + 'accepts_payment' => true, 'church_logo' => $request->file('church_logo'), 'church_cover' => $request->file('church_cover'), ]); @@ -115,14 +114,13 @@ class GivingPageController extends Controller 'brand_color' => ['nullable', 'string', 'max:20'], 'collection_types' => ['nullable', 'array', 'min:1'], 'collection_types.*' => ['string', 'max:80'], - 'accepts_payment' => ['nullable', 'boolean'], 'is_active' => ['sometimes', 'boolean'], 'church_logo' => ['nullable', 'image', 'mimes:jpeg,jpg,png,gif,webp', 'max:4096'], 'church_cover' => ['nullable', 'image', 'mimes:jpeg,jpg,png,gif,webp', 'max:8192'], ]); $data = array_merge($request->all(), [ - 'accepts_payment' => $request->boolean('accepts_payment', (bool) ($givingPage->content()['accepts_payment'] ?? false)), + 'accepts_payment' => true, 'is_active' => $request->boolean('is_active', $givingPage->is_active), 'church_logo' => $request->file('church_logo'), 'church_cover' => $request->file('church_cover'), diff --git a/app/Http/Controllers/Public/DonationController.php b/app/Http/Controllers/Public/DonationController.php index fdcf146..86e9b3d 100644 --- a/app/Http/Controllers/Public/DonationController.php +++ b/app/Http/Controllers/Public/DonationController.php @@ -27,10 +27,6 @@ class DonationController extends Controller return response()->json(['error' => 'This giving page does not accept donations.'], 422); } - if (empty($qrCode->content()['accepts_payment'])) { - return response()->json(['error' => 'Online giving is not enabled for this page.'], 422); - } - $validated = $request->validate([ 'customer_name' => ['required', 'string', 'max:120'], 'customer_email' => ['required', 'email', 'max:200'], diff --git a/app/Services/Give/GiveDonationService.php b/app/Services/Give/GiveDonationService.php index f5233ad..6f64337 100644 --- a/app/Services/Give/GiveDonationService.php +++ b/app/Services/Give/GiveDonationService.php @@ -30,10 +30,6 @@ class GiveDonationService throw new RuntimeException('This QR is not a giving page.'); } - if (empty($qrCode->content()['accepts_payment'])) { - throw new RuntimeException('Online giving is not enabled for this page.'); - } - $items = $data['items'] ?? []; if (empty($items)) { throw new RuntimeException('Enter an amount to give.'); diff --git a/app/Services/Qr/QrPayloadValidator.php b/app/Services/Qr/QrPayloadValidator.php index fbfc8c9..2639324 100644 --- a/app/Services/Qr/QrPayloadValidator.php +++ b/app/Services/Qr/QrPayloadValidator.php @@ -188,7 +188,7 @@ class QrPayloadValidator 'logo_path' => $input['logo_path'] ?? null, 'cover_path' => $input['cover_path'] ?? null, 'org_type' => $orgType, - 'accepts_payment' => filter_var($input['accepts_payment'] ?? false, FILTER_VALIDATE_BOOL), + 'accepts_payment' => true, 'currency' => 'GHS', 'collection_types' => $collectionTypes, ], diff --git a/config/mobile-topbar.php b/config/mobile-topbar.php index 9ac615a..2936bc2 100644 --- a/config/mobile-topbar.php +++ b/config/mobile-topbar.php @@ -1,5 +1,5 @@ 'Mini', + 'app_name' => 'Give', ]; diff --git a/resources/views/give/giving-pages/create.blade.php b/resources/views/give/giving-pages/create.blade.php index f8f85fe..cff34c2 100644 --- a/resources/views/give/giving-pages/create.blade.php +++ b/resources/views/give/giving-pages/create.blade.php @@ -75,13 +75,6 @@ -

Giving categories