paypal voucher

fixed paypal vouchers. added round off function
This commit is contained in:
franknstayn
2019-11-05 22:51:38 +08:00
parent 7000bbebe3
commit 1dd7578508
6 changed files with 117 additions and 106 deletions

View File

@@ -92,7 +92,7 @@ class PaypalController extends Controller {
$getPercentageValue = $totalValue / 100;
$getDiscountValue = ($getSubtotal[0]->Subtotal * $getPercentageValue);
$data = array(
'Price' => $getDiscountValue * -1
'Price' => round($getDiscountValue * -1, 2)
);
$m->updateVoucherValueInCart($data, $item_id);
@@ -108,10 +108,11 @@ class PaypalController extends Controller {
$order_items = array();
$updated_items = $m->myCart($cartKey);
$updated_getSubtotal = $m->getSubtotal($cartKey);
var_dump($updated_items);
$order_subtotal = $updated_getSubtotal[0]->Subtotal;
// $order_subtotal = $updated_getSubtotal[0]->Subtotal;
$order_grandtotal = $updated_getSubtotal[0]->Subtotal;
var_dump($order_grandtotal);
// $tax_value = 0.10;
if($grouped_item[0]->StoreId == 76 || $grouped_item[0]->StoreId == 78){
@@ -122,6 +123,8 @@ class PaypalController extends Controller {
$tax = $order_grandtotal * $tax_value;
var_dump($tax);
foreach($updated_items as $key => $item){
// $descriptions = "Name: " . $item->Name . " Number: " . $item->Number . " Size: " . $item->Size;"?"
@@ -138,12 +141,14 @@ class PaypalController extends Controller {
$item_list = PayPal::ItemList();
$item_list->setItems($order_items);
var_dump($order_grandtotal);
$amount_details = PayPal::Details();
$amount_details->setSubtotal($order_subtotal);
$amount_details->setSubtotal($order_grandtotal);
$amount_details->setTax($tax);
var_dump($item_list->items);
$amount = PayPal::Amount();
$amount->setCurrency($store_array[0]->StoreCurrency);
$amount->setDetails($amount_details);

View File

@@ -823,6 +823,7 @@ class UserController extends Controller {
$arrayItems = $post['item'];
$order = 1;
$UserModel = new UserModel;
foreach ($arrayItems as $item) {
$i = $UserModel->updateThumbnailOrdering($order, $item);
$order++;

157
composer.lock generated
View File

@@ -1,7 +1,7 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "9ad9cbf7c7c319c392284bef379f0004",
@@ -267,16 +267,16 @@
},
{
"name": "google/recaptcha",
"version": "1.2.2",
"version": "1.2.3",
"source": {
"type": "git",
"url": "https://github.com/google/recaptcha.git",
"reference": "c4a17d6af648d4f3814430cd103cba50b75b571c"
"reference": "98c4a6573b27e8b0990ea8789c74ea378795134c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/google/recaptcha/zipball/c4a17d6af648d4f3814430cd103cba50b75b571c",
"reference": "c4a17d6af648d4f3814430cd103cba50b75b571c",
"url": "https://api.github.com/repos/google/recaptcha/zipball/98c4a6573b27e8b0990ea8789c74ea378795134c",
"reference": "98c4a6573b27e8b0990ea8789c74ea378795134c",
"shasum": ""
},
"require": {
@@ -310,20 +310,20 @@
"recaptcha",
"spam"
],
"time": "2019-05-24T12:44:03+00:00"
"time": "2019-08-16T15:48:25+00:00"
},
{
"name": "guzzlehttp/guzzle",
"version": "5.3.3",
"version": "5.3.4",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "93bbdb30d59be6cd9839495306c65f2907370eb9"
"reference": "b87eda7a7162f95574032da17e9323c9899cb6b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/93bbdb30d59be6cd9839495306c65f2907370eb9",
"reference": "93bbdb30d59be6cd9839495306c65f2907370eb9",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/b87eda7a7162f95574032da17e9323c9899cb6b2",
"reference": "b87eda7a7162f95574032da17e9323c9899cb6b2",
"shasum": ""
},
"require": {
@@ -363,7 +363,7 @@
"rest",
"web service"
],
"time": "2018-07-31T13:33:10+00:00"
"time": "2019-10-30T09:32:00+00:00"
},
{
"name": "guzzlehttp/ringphp",
@@ -654,25 +654,25 @@
},
{
"name": "kylekatarnls/update-helper",
"version": "1.1.1",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/kylekatarnls/update-helper.git",
"reference": "b34a46d7f5ec1795b4a15ac9d46b884377262df9"
"reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kylekatarnls/update-helper/zipball/b34a46d7f5ec1795b4a15ac9d46b884377262df9",
"reference": "b34a46d7f5ec1795b4a15ac9d46b884377262df9",
"url": "https://api.github.com/repos/kylekatarnls/update-helper/zipball/5786fa188e0361b9adf9e8199d7280d1b2db165e",
"reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.1.0",
"composer-plugin-api": "^1.1.0 || ^2.0.0",
"php": ">=5.3.0"
},
"require-dev": {
"codeclimate/php-test-reporter": "dev-master",
"composer/composer": "^2.0.x-dev",
"composer/composer": "2.0.x-dev || ^2.0.0-dev",
"phpunit/phpunit": ">=4.8.35 <6.0"
},
"type": "composer-plugin",
@@ -695,7 +695,7 @@
}
],
"description": "Update helper",
"time": "2019-06-05T08:34:23+00:00"
"time": "2019-07-29T11:03:54+00:00"
},
{
"name": "laravel/framework",
@@ -825,16 +825,16 @@
},
{
"name": "league/flysystem",
"version": "1.0.53",
"version": "1.0.57",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "08e12b7628f035600634a5e76d95b5eb66cea674"
"reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/08e12b7628f035600634a5e76d95b5eb66cea674",
"reference": "08e12b7628f035600634a5e76d95b5eb66cea674",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a",
"reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a",
"shasum": ""
},
"require": {
@@ -905,7 +905,7 @@
"sftp",
"storage"
],
"time": "2019-06-18T20:09:29+00:00"
"time": "2019-10-16T21:01:05+00:00"
},
{
"name": "league/flysystem-sftp",
@@ -956,16 +956,16 @@
},
{
"name": "monolog/monolog",
"version": "1.24.0",
"version": "1.25.1",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266"
"reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266",
"reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/70e65a5470a42cfec1a7da00d30edb6e617e8dcf",
"reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf",
"shasum": ""
},
"require": {
@@ -1030,7 +1030,7 @@
"logging",
"psr-3"
],
"time": "2018-11-05T09:00:11+00:00"
"time": "2019-09-06T13:49:17+00:00"
},
{
"name": "mtdowling/cron-expression",
@@ -1078,16 +1078,16 @@
},
{
"name": "nesbot/carbon",
"version": "1.38.4",
"version": "1.39.1",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "8dd4172bfe1784952c4d58c4db725d183b1c23ad"
"reference": "4be0c005164249208ce1b5ca633cd57bdd42ff33"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8dd4172bfe1784952c4d58c4db725d183b1c23ad",
"reference": "8dd4172bfe1784952c4d58c4db725d183b1c23ad",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4be0c005164249208ce1b5ca633cd57bdd42ff33",
"reference": "4be0c005164249208ce1b5ca633cd57bdd42ff33",
"shasum": ""
},
"require": {
@@ -1135,7 +1135,7 @@
"datetime",
"time"
],
"time": "2019-06-03T15:41:40+00:00"
"time": "2019-10-14T05:51:36+00:00"
},
{
"name": "netshell/paypal",
@@ -1324,16 +1324,16 @@
},
{
"name": "phpseclib/phpseclib",
"version": "2.0.18",
"version": "2.0.23",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "60519001db8d791215a822efd366d24cafee9e63"
"reference": "c78eb5058d5bb1a183133c36d4ba5b6675dfa099"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/60519001db8d791215a822efd366d24cafee9e63",
"reference": "60519001db8d791215a822efd366d24cafee9e63",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/c78eb5058d5bb1a183133c36d4ba5b6675dfa099",
"reference": "c78eb5058d5bb1a183133c36d4ba5b6675dfa099",
"shasum": ""
},
"require": {
@@ -1412,20 +1412,20 @@
"x.509",
"x509"
],
"time": "2019-06-13T06:15:54+00:00"
"time": "2019-09-17T03:41:22+00:00"
},
{
"name": "psr/log",
"version": "1.1.0",
"version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd"
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
"url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801",
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801",
"shasum": ""
},
"require": {
@@ -1434,7 +1434,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.1.x-dev"
}
},
"autoload": {
@@ -1459,7 +1459,7 @@
"psr",
"psr-3"
],
"time": "2018-11-20T15:27:04+00:00"
"time": "2019-11-01T11:05:21+00:00"
},
{
"name": "psy/psysh",
@@ -2107,16 +2107,16 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.11.0",
"version": "v1.12.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "82ebae02209c21113908c229e9883c419720738a"
"reference": "550ebaac289296ce228a706d0867afc34687e3f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a",
"reference": "82ebae02209c21113908c229e9883c419720738a",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4",
"shasum": ""
},
"require": {
@@ -2128,7 +2128,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.11-dev"
"dev-master": "1.12-dev"
}
},
"autoload": {
@@ -2145,12 +2145,12 @@
],
"authors": [
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Gert de Pagter",
"email": "backendtea@gmail.com"
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
@@ -2161,20 +2161,20 @@
"polyfill",
"portable"
],
"time": "2019-02-06T07:57:58+00:00"
"time": "2019-08-06T08:03:45+00:00"
},
{
"name": "symfony/polyfill-php56",
"version": "v1.11.0",
"version": "v1.12.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php56.git",
"reference": "f4dddbc5c3471e1b700a147a20ae17cdb72dbe42"
"reference": "0e3b212e96a51338639d8ce175c046d7729c3403"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/f4dddbc5c3471e1b700a147a20ae17cdb72dbe42",
"reference": "f4dddbc5c3471e1b700a147a20ae17cdb72dbe42",
"url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/0e3b212e96a51338639d8ce175c046d7729c3403",
"reference": "0e3b212e96a51338639d8ce175c046d7729c3403",
"shasum": ""
},
"require": {
@@ -2184,7 +2184,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.11-dev"
"dev-master": "1.12-dev"
}
},
"autoload": {
@@ -2217,20 +2217,20 @@
"portable",
"shim"
],
"time": "2019-02-06T07:57:58+00:00"
"time": "2019-08-06T08:03:45+00:00"
},
{
"name": "symfony/polyfill-util",
"version": "v1.11.0",
"version": "v1.12.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-util.git",
"reference": "b46c6cae28a3106735323f00a0c38eccf2328897"
"reference": "4317de1386717b4c22caed7725350a8887ab205c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-util/zipball/b46c6cae28a3106735323f00a0c38eccf2328897",
"reference": "b46c6cae28a3106735323f00a0c38eccf2328897",
"url": "https://api.github.com/repos/symfony/polyfill-util/zipball/4317de1386717b4c22caed7725350a8887ab205c",
"reference": "4317de1386717b4c22caed7725350a8887ab205c",
"shasum": ""
},
"require": {
@@ -2239,7 +2239,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.11-dev"
"dev-master": "1.12-dev"
}
},
"autoload": {
@@ -2269,7 +2269,7 @@
"polyfill",
"shim"
],
"time": "2019-02-08T14:16:39+00:00"
"time": "2019-08-06T08:03:45+00:00"
},
{
"name": "symfony/process",
@@ -2990,22 +2990,22 @@
},
{
"name": "phpspec/prophecy",
"version": "1.8.1",
"version": "1.9.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76"
"reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
"reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203",
"reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
"sebastian/comparator": "^1.1|^2.0|^3.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0"
},
@@ -3049,7 +3049,7 @@
"spy",
"stub"
],
"time": "2019-06-13T12:50:23+00:00"
"time": "2019-10-03T11:07:50+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -3857,16 +3857,16 @@
},
{
"name": "webmozart/assert",
"version": "1.4.0",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "83e253c8e0be5b0257b881e1827274667c5c17a9"
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9",
"reference": "83e253c8e0be5b0257b881e1827274667c5c17a9",
"url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4",
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4",
"shasum": ""
},
"require": {
@@ -3874,8 +3874,7 @@
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
"phpunit/phpunit": "^4.6",
"sebastian/version": "^1.0.1"
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
},
"type": "library",
"extra": {
@@ -3904,7 +3903,7 @@
"check",
"validate"
],
"time": "2018-12-25T11:19:39+00:00"
"time": "2019-08-24T08:43:50+00:00"
}
],
"aliases": [],

View File

@@ -46,7 +46,7 @@
</div>
<div style="border: 1px solid #e2e2e2; padding: 10px; border-bottom: none;">
<h3>Subtotal: <span id="my_subtotal">{{ $getSubtotal }}</span> <small>{{ $store_array[0]->StoreCurrency }}</small></h3>
<h3>Subtotal: <span id="my_subtotal">{{ round($getSubtotal, 2) }}</span> <small>{{ $store_array[0]->StoreCurrency }}</small></h3>
<hr>
<div class="form-group" id="voucher_list">
@foreach($row as $item)

View File

@@ -48,7 +48,7 @@
</div>
</div>
<!-- BEGIN PRODUCTS -->
<div id="item_list_sort">
@foreach($product_array as $i => $product)
@foreach($thumbnails as $t => $thumb)
@if($thumb['product_id'] == $product->Id)
@@ -56,8 +56,8 @@
@define $filename = $thumb['thumb']
@endif
@endforeach
<div class="col-md-3 col-sm-6">
<div class="thumbnail">
<div class="col-md-3 col-sm-6" id="{{ 'order_number_' . $product->Ordering }}">
<div class="thumbnail" >
<a href="{{ url('user/store-items/item') }}/{{ $product->ProductURL }}">
<img style="height:200px" src="{{ config('site_config.prod_private_server_ip') }}/images/{{ $filename . '?t=' . time() }}" alt="{{ $product->ProductName }}" >
</a>
@@ -67,13 +67,12 @@
</div>
<h4 class="product-name-holder">{{ $product->ProductName }}<br><small>$ {{ $product->ProductPrice }}</small></h4>
<hr class="line">
<a href="{{ url('user/store-items/item') }}/{{ $product->ProductURL }}" class="btn btn-success btn-block" > View Details</a>
</div>
</div>
@endforeach
</div>
</div>
</div>
<div class="box-footer">

View File

@@ -587,7 +587,7 @@
<!-- jQuery 2.2.3 -->
<script src="{{asset('/public/bower_components/AdminLTE/plugins/jQuery/jquery-2.2.3.min.js')}}"></script>
<!-- jQuery UI 1.11.4 -->
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="{{asset('/public/bower_components/AdminLTE/bootstrap/js/bootstrap.min.js')}}"></script>
@@ -761,16 +761,23 @@
});
$('.select2').select2();
var tr_sortable = $('#sortable');
var item_list_sort = $('#item_list_sort');
item_list_sort.sortable();
item_list_sort.disableSelection();
// setTimeout(function(){
// item_list_sort.sortable("disable");
// }, 500);
tr_sortable.sortable({
revert: 100,
placeholder: 'placeholder'
});
$('.select2').select2();
tr_sortable.disableSelection();
$('#btn_save_thumbnail_sorting').on('click', function(e) {