@@ -16,6 +16,7 @@ class SponsorSubscription extends Component
16
16
{
17
17
public string $ option = 'one-time ' ;
18
18
public string $ amount = '' ;
19
+ public string $ currency = 'XAF ' ;
19
20
20
21
public function chooseOption (string $ option ): void
21
22
{
@@ -24,16 +25,14 @@ public function chooseOption(string $option): void
24
25
25
26
public function subscribe (): void
26
27
{
27
- $ this ->validate (
28
- ['amount ' => 'required ' ],
29
- ['amount.required ' => __ ('Votre montant est requis ' )],
30
- );
28
+ $ this ->validate (['amount ' => 'required ' ]);
31
29
32
30
if (!Auth::check ()) {
33
31
$ this ->emit ('openModal ' , 'modals.anonymous-sponsors ' , [
34
32
'amount ' => $ this ->amount ,
35
33
'option ' => $ this ->option ,
36
34
]);
35
+
37
36
return ;
38
37
}
39
38
@@ -45,7 +44,7 @@ public function subscribe(): void
45
44
'amount ' => $ this ->amount ,
46
45
'email ' => Auth::user ()?->email,
47
46
'name ' => Auth::user ()?->name,
48
- 'currency ' => ' XAF ' ,
47
+ 'currency ' => $ this -> currency ,
49
48
'reference ' => Auth::id () . '- ' . Auth::user ()?->username() . '- ' . uniqid (),
50
49
'callback ' => route ('notchpay-callback ' ),
51
50
]);
@@ -72,7 +71,7 @@ public function subscribe(): void
72
71
'initiated_at ' => $ payload ->transaction ->initiated_at ,
73
72
'description ' => $ payload ->transaction ->description ,
74
73
'for ' => PaymentType::SPONSORING ->value ,
75
- ]
74
+ ],
76
75
]);
77
76
78
77
$ this ->redirect ($ payload ->authorization_url );
0 commit comments