Skip to content

Commit ed47723

Browse files
committed
laravel 8
1 parent 3a02929 commit ed47723

File tree

15 files changed

+7001
-43
lines changed

15 files changed

+7001
-43
lines changed

examplev2.png

-177 KB
Loading

src/Config/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
|--------------------------------------------------------------------------
2323
|
2424
| Set the custom middleware
25-
| you can set the "auth" or "auth:guard"
25+
| you can set the "web", "auth" or "auth:guard"
2626
|
2727
*/
2828

src/Http/Controllers/AjaxController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function encrypt_payload(Request $request) {
208208
return response()->json([
209209
'result' => false,
210210
'message' => $e->getMessage()
211-
], 500);
211+
], 400);
212212
}
213213

214214
}
@@ -235,7 +235,7 @@ public function create_transaction(Request $request) {
235235
}
236236

237237
$data = [
238-
'amount' => $request->amountTotal,
238+
'amount' => (FLOAT) $request->amountTotal,
239239
'currency1' => config('coinpayment.default_currency'),
240240
'currency2' => $request->coinIso,
241241
'buyer_email' => $request->buyer_email
@@ -274,7 +274,7 @@ public function create_transaction(Request $request) {
274274
return response()->json([
275275
'result' => false,
276276
'message' => $e->getMessage()
277-
], 500);
277+
], 400);
278278
}
279279
}
280280

src/Providers/CoinPaymentServiceProvider.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Hexters\CoinPayment\Providers;
44

55
use Illuminate\Support\ServiceProvider;
6-
use Illuminate\Database\Eloquent\Factory;
76
use Hexters\CoinPayment\Console\InstallationCommand;
87
use Hexters\CoinPayment\Helpers\CoinPaymentHelper;
98

@@ -26,7 +25,6 @@ public function boot() {
2625
$this->registerTranslations();
2726
$this->registerConfig();
2827
$this->registerViews();
29-
$this->registerFactories();
3028
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
3129
}
3230

@@ -105,19 +103,7 @@ public function registerTranslations()
105103
$this->loadTranslationsFrom(__DIR__ .'/../Resources/lang', 'coinpayment');
106104
}
107105
}
108-
109-
/**
110-
* Register an additional directory of factories.
111-
*
112-
* @return void
113-
*/
114-
public function registerFactories()
115-
{
116-
if (! app()->environment('production')) {
117-
app(Factory::class)->load(__DIR__ . '/../Database/factories');
118-
}
119-
}
120-
106+
121107
/**
122108
* Get the services provided by the provider.
123109
*
861 Bytes
Loading

src/Resources/assets/js/components/formTransaction.vue

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
</div>
8080
</div>
8181
<div class="text-center mb-3">
82-
<a v-bind:href="payload.redirect_url">&laquo; Cancel transaction</a>
82+
<a v-bind:href="payload.redirect_url">&laquo; Cancel Transaction</a>
8383
</div>
8484
</div>
8585

@@ -302,23 +302,20 @@ export default {
302302
container: this.fullPage ? null : this.$refs.formContainer,
303303
canCancel: false
304304
});
305-
305+
306306
axios.post(_host + '/coinpayment/ajax/create', newPayload)
307307
.then(json => {
308308
self.transaction = json.data;
309309
$('#createdResult').modal('show');
310310
self.format_expired();
311311
loader.hide()
312312
})
313-
.then(error => {
314-
if(error) {
315-
if(error.response.data.message != undefined) {
316-
swal(error.response.data.message, {
317-
icon: 'warning'
318-
});
319-
}
313+
.catch(error => {
314+
if(error.response.status >= 400) {
315+
swal(error.response.data.message, {
316+
icon: 'warning'
317+
});
320318
}
321-
322319
loader.hide()
323320
});
324321
},
@@ -343,7 +340,7 @@ export default {
343340
}
344341
})
345342
.catch(error => {
346-
if(error.response.data.message !== undefined) {
343+
if(typeof error.response.data.message !== "undefined") {
347344
swal(error.response.data.message, {
348345
icon: 'warning'
349346
});

src/Resources/assets/prod/css/coinpayment.css

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Database/factories/.gitkeep renamed to src/Resources/assets/prod/css/coinpayment.transaction.css

File renamed without changes.

src/Resources/assets/prod/js/coinpayment.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Resources/assets/prod/js/coinpayment.transaction.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)