@@ -13,21 +13,7 @@ class StripeCheckout
13
13
*
14
14
* @var string length 3 and lowercase
15
15
*/
16
- private $ currency = 'usd ' ;
17
-
18
- /**
19
- * Checkout description.
20
- *
21
- * @var string
22
- */
23
- private $ description = 'Stripe payment checkout ' ;
24
-
25
- /**
26
- * Checkout products data.
27
- *
28
- * @var array
29
- */
30
- private $ products = [];
16
+ private $ theCurrency = 'usd ' ;
31
17
32
18
/**
33
19
* Secret key.
@@ -76,7 +62,7 @@ class StripeCheckout
76
62
77
63
public function __construct ()
78
64
{
79
- $ this ->currency = config ('stripe.currency ' );
65
+ $ this ->theCurrency = config ('stripe.currency ' );
80
66
$ this ->secretKey = config ('stripe.secret_key ' );
81
67
$ this ->publicKey = config ('stripe.public_key ' );
82
68
$ this ->successURI = config ('stripe.success_url ' );
@@ -94,7 +80,6 @@ public function __construct()
94
80
public function tnx ($ data )
95
81
{
96
82
$ this ->referenceKey = $ data ;
97
- $ this ->theDescription = $ data ;
98
83
99
84
return $ this ;
100
85
}
@@ -138,6 +123,19 @@ public function amount($data)
138
123
return $ this ;
139
124
}
140
125
126
+ /**
127
+ * Set currency.
128
+ *
129
+ * @param $data.
130
+ * @return $this
131
+ */
132
+ public function currency ($ data )
133
+ {
134
+ $ this ->theCurrency = $ data ;
135
+
136
+ return $ this ;
137
+ }
138
+
141
139
/**
142
140
* Get session id and public key
143
141
*
@@ -155,7 +153,7 @@ public function get()
155
153
// Line items.
156
154
$ this ->checkoutData ['line_items ' ] = [[
157
155
'price_data ' => [
158
- 'currency ' => $ this ->currency ,
156
+ 'currency ' => $ this ->theCurrency ,
159
157
'unit_amount ' => $ this ->amount * 100 , // Amount in cents (400 USD * 100)
160
158
'product_data ' => [
161
159
'name ' => $ this ->theTitle ],
0 commit comments