Skip to content

Commit b57a487

Browse files
committed
wip
1 parent 7b10f16 commit b57a487

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

.github/workflows/tests.yaml

+12-12
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,6 @@ jobs:
2525
- name: Checkout code
2626
uses: actions/checkout@v1
2727

28-
- name: Setup PHP
29-
uses: shivammathur/setup-php@v2
30-
with:
31-
php-version: ${{ matrix.php }}
32-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
33-
34-
- name: Install dependencies
35-
run: |
36-
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
37-
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
38-
3928
- name: Get changed files (Payments)
4029
id: changed-files-payments
4130
uses: tj-actions/changed-files@v44
@@ -45,7 +34,7 @@ jobs:
4534
src/Http/Controllers/Payments
4635
tests/Feature/Payments
4736
composer.json
48-
.github/workflows/tests.yml
37+
.github/workflows/tests.yaml
4938
5039
- name: Determine whether payment tests should run
5140
id: should-run-payment-tests
@@ -54,6 +43,17 @@ jobs:
5443
echo "result=true" >> $GITHUB_OUTPUT
5544
echo "result=true" >> $env:GITHUB_OUTPUT
5645
46+
- name: Setup PHP
47+
uses: shivammathur/setup-php@v2
48+
with:
49+
php-version: ${{ matrix.php }}
50+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
51+
52+
- name: Install dependencies
53+
run: |
54+
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
55+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
56+
5757
- name: Execute tests
5858
run: vendor/bin/phpunit --exclude-group=payments
5959

resources/js/components/fieldtypes/OrderReceiptFieldtype.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<div>{{ __('Grand Total') }}</div>
4545
<div>{{ receipt.totals.grand_total }}</div>
4646
</div>
47-
<div class="receipt-total">
47+
<div v-if="receipt.refund.issued" class="receipt-total">
4848
<div>{{ __('Refund') }}</div>
4949
<div>-{{ receipt.totals.amount_refunded }}</div>
5050
</div>

src/Fieldtypes/OrderReceiptFieldtype.php

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ public function preProcess($data)
5252
'amount' => Money::format($tax['amount'], Site::selected()),
5353
])->all(),
5454
] : null,
55+
'refund' => [
56+
'issued' => $order->get('amount_refunded', 0) > 0,
57+
],
5558
'totals' => [
5659
'sub_total' => Money::format($order->subTotal(), Site::selected()),
5760
'discount_total' => Money::format($order->discountTotal(), Site::selected()),

0 commit comments

Comments
 (0)