@@ -16,6 +16,7 @@ class SponsorSubscription extends Component
1616{
1717 public string $ option = 'one-time ' ;
1818 public string $ amount = '' ;
19+ public string $ currency = 'XAF ' ;
1920
2021 public function chooseOption (string $ option ): void
2122 {
@@ -24,16 +25,14 @@ public function chooseOption(string $option): void
2425
2526 public function subscribe (): void
2627 {
27- $ this ->validate (
28- ['amount ' => 'required ' ],
29- ['amount.required ' => __ ('Votre montant est requis ' )],
30- );
28+ $ this ->validate (['amount ' => 'required ' ]);
3129
3230 if (!Auth::check ()) {
3331 $ this ->emit ('openModal ' , 'modals.anonymous-sponsors ' , [
3432 'amount ' => $ this ->amount ,
3533 'option ' => $ this ->option ,
3634 ]);
35+
3736 return ;
3837 }
3938
@@ -45,7 +44,7 @@ public function subscribe(): void
4544 'amount ' => $ this ->amount ,
4645 'email ' => Auth::user ()?->email,
4746 'name ' => Auth::user ()?->name,
48- 'currency ' => ' XAF ' ,
47+ 'currency ' => $ this -> currency ,
4948 'reference ' => Auth::id () . '- ' . Auth::user ()?->username() . '- ' . uniqid (),
5049 'callback ' => route ('notchpay-callback ' ),
5150 ]);
@@ -72,7 +71,7 @@ public function subscribe(): void
7271 'initiated_at ' => $ payload ->transaction ->initiated_at ,
7372 'description ' => $ payload ->transaction ->description ,
7473 'for ' => PaymentType::SPONSORING ->value ,
75- ]
74+ ],
7675 ]);
7776
7877 $ this ->redirect ($ payload ->authorization_url );
0 commit comments