*/ public static function present(MiniPayment $payment): array { return [ 'id' => $payment->id, 'reference' => $payment->reference, 'amount_minor' => $payment->amount_minor, 'merchant_amount_minor' => $payment->merchant_amount_minor, 'platform_fee_minor' => $payment->platform_fee_minor, 'currency' => $payment->currency, 'status' => $payment->status, 'payer_name' => $payment->payer_name, 'payer_email' => $payment->payer_email, 'payer_phone' => $payment->payer_phone, 'payer_note' => $payment->payer_note, 'qr_code_id' => $payment->qr_code_id, 'qr_label' => $payment->qrCode?->label, 'paid_at' => $payment->paid_at?->toIso8601String(), 'created_at' => $payment->created_at?->toIso8601String(), ]; } /** @return array */ public static function presentQr(QrCode $qr, ?string $previewUrl = null): array { $content = $qr->content(); return [ 'id' => $qr->id, 'label' => $qr->label, 'business_name' => $content['business_name'] ?? null, 'branch_label' => $content['branch_label'] ?? null, 'currency' => $content['currency'] ?? 'GHS', 'short_code' => $qr->short_code, 'public_url' => $qr->publicUrl(), 'is_active' => $qr->is_active, 'scans_total' => $qr->scans_total, 'preview_url' => $previewUrl, 'created_at' => $qr->created_at?->toIso8601String(), 'updated_at' => $qr->updated_at?->toIso8601String(), ]; } }