Skip to content
This repository was archived by the owner on Sep 28, 2019. It is now read-only.

Commit 23b3495

Browse files
committed
fixed the stripe payment currency code
1 parent 19aae17 commit 23b3495

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

resources/views/payment/stripe/index.blade.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ function stripeTokenHandler(token) {
121121
hiddenInput.setAttribute('value', token.id);
122122
formWrapper.appendChild(hiddenInput);
123123
124-
var hiddenInput = document.createElement('input');
125-
hiddenInput.setAttribute('type', 'hidden');
126-
hiddenInput.setAttribute('name', 'payment_option');
127-
hiddenInput.setAttribute('value', 'stripe');
128-
formWrapper.appendChild(hiddenInput);
129-
130124
}
131125
132126
</script>

src/Payment/Stripe/Payment.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use AvoRed\Framework\Models\Database\Configuration;
88
use AvoRed\Framework\Payment\Payment as PaymentEcommerce;
99
use AvoRed\Framework\Payment\Contracts\Payment as PaymentContracts;
10-
use AvoRed\Ecommerce\Models\Database\User;
1110

1211
class Payment extends PaymentEcommerce implements PaymentContracts
1312
{
@@ -91,20 +90,10 @@ public function process($orderData, $cartProducts, $request)
9190
$apiKey = Configuration::getConfiguration(self::CONFIG_SECRET_KEY);
9291

9392
Stripe::setApiKey($apiKey);
94-
//dd($orderData);
95-
//$user = User::find($orderData['user_id']);
96-
//$customer = \Stripe\Customer::create([
97-
// 'email' => $user->email,
98-
// 'description' => 'Customer for One of Charge ' . $user->id,
99-
// 'source' => $request->get('stripeToken')
100-
// ]);
101-
102-
//dd($request->all());
103-
//dd($request->get('stripeToken'));
104-
93+
$currencyCode = Configuration::getConfiguration('general_site_currency');
10594
$response = Charge::create([
10695
'amount' => $totalCents,
107-
'currency' => 'nzd',
96+
'currency' => $currencyCode,
10897
'source' => $request->get('stripeToken'), // obtained with Stripe.js
10998
'description' => 'AvoRed E commerce Payment',
11099
]);

0 commit comments

Comments
 (0)