Add InPost Pay integration to admin templates
- Created a new template for the cart rule form with custom label, switch, and choice widgets. - Implemented the InPost Pay block in the order details template for displaying delivery method, APM, and VAT invoice request. - Added legacy support for the order details template to maintain compatibility with older PrestaShop versions.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace izi\prestashop\BasketApp\Payment;
|
||||
|
||||
use izi\prestashop\BasketApp\Payment\Response\AvailablePaymentOptions;
|
||||
|
||||
interface PaymentsApiClientInterface
|
||||
{
|
||||
public function getAvailablePaymentOptions(): AvailablePaymentOptions;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace izi\prestashop\BasketApp\Payment\Response;
|
||||
|
||||
use izi\prestashop\Common\PaymentType;
|
||||
|
||||
/**
|
||||
* @implements \IteratorAggregate<PaymentType>
|
||||
*/
|
||||
final class AvailablePaymentOptions implements \JsonSerializable, \IteratorAggregate
|
||||
{
|
||||
/**
|
||||
* @var PaymentType[]
|
||||
*/
|
||||
private $payment_type;
|
||||
|
||||
/**
|
||||
* @param PaymentType[] $payment_type
|
||||
*/
|
||||
public function __construct(array $payment_type)
|
||||
{
|
||||
$this->payment_type = $payment_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PaymentType[]
|
||||
*/
|
||||
public function getPaymentTypes(): array
|
||||
{
|
||||
return $this->payment_type;
|
||||
}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return get_object_vars($this);
|
||||
}
|
||||
|
||||
public function getIterator(): \Iterator
|
||||
{
|
||||
return new \ArrayIterator($this->payment_type);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user