Skip to content

Commit

Permalink
Merge branch 'master' into seed-beatmaps-forum
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed Feb 5, 2025
2 parents c81c0b1 + 88de194 commit 4750de7
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 17 deletions.
2 changes: 0 additions & 2 deletions app/Libraries/Payments/PaymentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,6 @@ public function rejected()
// the whole transaction doesn't make it explode.
$this->signature->assertValid();

$order = $this->getOrder();

datadog_increment('store.payments.rejected', ['provider' => $this->getPaymentProvider()]);
}

Expand Down
10 changes: 10 additions & 0 deletions app/Libraries/Payments/PaypalPaymentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ public function getNotificationTypeRaw(): string
return $this['payment_status'] ?? $this['txn_type'];
}

public function rejected()
{
parent::rejected();

$order = $this->getOrder();
if ($this->params['payment_type'] === 'echeck') {
$order->update(['tracking_code' => Order::ECHECK_DENIED]);
}
}

public function validateTransaction(): bool
{
$this->signature->assertValid();
Expand Down
6 changes: 1 addition & 5 deletions app/Models/Store/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Order extends Model
use SoftDeletes;

const ECHECK_CLEARED = 'ECHECK CLEARED';
const ECHECK_DENIED = 'ECHECK DENIED';
const ORDER_NUMBER_REGEX = '/^(?<prefix>[A-Za-z]+)-(?<userId>\d+)-(?<orderId>\d+)$/';
const PENDING_ECHECK = 'PENDING ECHECK';

Expand Down Expand Up @@ -436,11 +437,6 @@ public function isPaidOrDelivered(): bool
return in_array($this->status, [static::STATUS_PAID, static::STATUS_DELIVERED], true);
}

public function isPendingEcheck(): bool
{
return $this->tracking_code === static::PENDING_ECHECK;
}

public function isShipped(): bool
{
return $this->status === static::STATUS_SHIPPED;
Expand Down
7 changes: 5 additions & 2 deletions resources/css/bem/team-settings-description-preview.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

.team-settings-description-preview {
padding: 0 var(--padding);
overflow-y: scroll;
height: calc(70 * var(--vh));

@media @desktop {
overflow-y: scroll;
height: calc(70 * var(--vh));
}
}
27 changes: 21 additions & 6 deletions resources/css/bem/team-settings.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

.team-settings {
display: grid;
gap: 5px;
gap: 15px 5px;

@media @desktop {
gap: 5px;
}

&__buttons {
display: flex;
Expand All @@ -30,20 +34,31 @@
}

&__item {
--grid-rows: none;
--grid-rows-desktop: none;
--grid-columns: 1fr;
--grid-columns-desktop: 2fr 1fr;
display: grid;
grid-template-columns: 2fr 1fr;
gap: 15px;
gap: 5px 15px;
grid-template-columns: var(--grid-columns);
grid-template-rows: var(--grid-rows);

@media @desktop {
--grid-columns: var(--grid-columns-desktop);
--grid-rows: var(--grid-rows-desktop);
}

&--buttons {
grid-template-columns: 1fr auto;
--grid-columns-desktop: 1fr auto;
}

&--description {
grid-template-columns: 1fr 1fr;
--grid-columns-desktop: 1fr 1fr;
--grid-rows: calc(var(--vh, 1vh) * 70) auto;
}

&--image {
grid-template-columns: 1fr;
--grid-columns-desktop: 1fr;
}
}
}
1 change: 1 addition & 0 deletions resources/lang/en/store.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
'contact' => 'Contact:',
'date' => 'Date:',
'echeck_delay' => 'As your payment was an eCheck, please allow up to 10 extra days for the payment to clear through PayPal!',
'echeck_denied' => 'The eCheck payment was rejected by PayPal.',
'hide_from_activity' => 'osu!supporter tags in this order are not displayed in your recent activities.',
'sent_via' => 'Sent Via:',
'shipping_to' => 'Shipping To:',
Expand Down
14 changes: 12 additions & 2 deletions resources/views/store/orders/_status.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0.
See the LICENCE file in the repository root for full licence text.
--}}
@php
use App\Models\Store\Order;
$echeckStatus = match ($order->tracking_code) {
Order::ECHECK_DENIED => 'echeck_denied',
Order::PENDING_ECHECK => 'echeck_delay',
default => null,
};
@endphp

<div class="store-page">
<h3 class="store-text store-text--title">{{ osu_trans('store.order.status.title') }}</h3>

Expand Down Expand Up @@ -56,9 +66,9 @@
</p>
@endif

@if ($order->isPendingEcheck())
@if ($echeckStatus !== null)
<p>
{{ osu_trans('store.invoice.echeck_delay') }}
{{ osu_trans("store.invoice.{$echeckStatus}") }}
</p>
@endif
@endif
Expand Down

0 comments on commit 4750de7

Please sign in to comment.