geschenkgutscheine implementiert ("Paket verschenken"). Neuer Upload-Provider: Sparkbooth.
This commit is contained in:
@@ -4,10 +4,13 @@ namespace App\Services\Coupons;
|
||||
|
||||
use App\Models\CheckoutSession;
|
||||
use App\Models\CouponRedemption;
|
||||
use App\Services\GiftVouchers\GiftVoucherService;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class CouponRedemptionService
|
||||
{
|
||||
public function __construct(private readonly GiftVoucherService $giftVouchers) {}
|
||||
|
||||
public function recordSuccess(CheckoutSession $session, array $payload = []): void
|
||||
{
|
||||
if (! $session->coupon_id) {
|
||||
@@ -41,6 +44,8 @@ class CouponRedemptionService
|
||||
);
|
||||
|
||||
$session->coupon?->increment('redemptions_count');
|
||||
|
||||
$this->giftVouchers->markRedeemed($session->coupon, $transactionId);
|
||||
}
|
||||
|
||||
public function recordFailure(CheckoutSession $session, string $reason): void
|
||||
|
||||
Reference in New Issue
Block a user