ver. 0.269: ShopPaymentMethod refactor + Apilo keepalive

This commit is contained in:
2026-02-14 15:22:02 +01:00
parent 847fdbbf3f
commit 9c23e7f16b
31 changed files with 1832 additions and 269 deletions

View File

@@ -1,19 +1,24 @@
<?
<?php
namespace shop;
class PaymentMethod implements \ArrayAccess
{
// lista dostępnych form płatności
static public function method_list()
private static function repo(): \Domain\PaymentMethod\PaymentMethodRepository
{
global $mdb;
return $mdb -> select( 'pp_shop_payment_methods', '*', [ 'status' => 1 ] );
return new \Domain\PaymentMethod\PaymentMethodRepository( $mdb );
}
// lista dostepnych form platnosci
static public function method_list()
{
return self::repo()->allActive();
}
// get_apilo_payment_method_id
static public function get_apilo_payment_method_id( $payment_method_id )
{
global $mdb;
return $mdb -> get( 'pp_shop_payment_methods', 'apilo_payment_type_id', [ 'id' => $payment_method_id ] );
return self::repo()->getApiloPaymentTypeId( (int)$payment_method_id );
}
public function offsetExists( $offset )
@@ -35,4 +40,4 @@ class PaymentMethod implements \ArrayAccess
{
unset( $this -> $offset );
}
}
}