Copied!

PaymentMethodServiceDecorator

PaymentMethodServiceDecorator.php : 42

Base class for `\Ibexa\Contracts\Payment\PaymentMethodServiceInterface` decorators.

The following example is a service overriding the PaymentServiceInterface::createPayment():

final class MyPaymentMethodServiceDecorator extends PaymentMethodServiceDecorator
{
   public function createPaymentMethod(PaymentMethodCreateStruct $createStruct): PaymentMethodInterface
   {
       // Customize method behavior here
   }
}

and relevant service definition:

services:
    App\Payment\MyPaymentMethodServiceDecorator:
       decorates: Ibexa\Contracts\Payment\PaymentMethodServiceInterface
Tags
See
PaymentMethodServiceInterface

Properties

protected $innerService

PaymentMethodServiceDecorator.php : 44
protected PaymentMethodServiceInterface $innerService

Methods

public__construct()

PaymentMethodServiceDecorator.php : 46
public __construct(PaymentMethodServiceInterface $innerService)

Parameters

Name Type Default value Description
$innerService PaymentMethodServiceInterface - -

publiccreatePaymentMethod()

PaymentMethodServiceDecorator.php : 70

Creates a new payment method.

public createPaymentMethod(PaymentMethodCreateStruct $createStruct) : PaymentMethodInterface

Parameters

Name Type Default value Description
$createStruct PaymentMethodCreateStruct -

Struct with data needed to create a new payment method.

Return values

PaymentMethodInterface

publicdeletePaymentMethod()

PaymentMethodServiceDecorator.php : 88

Deletes the payment method.

public deletePaymentMethod(PaymentMethodInterface $paymentMethod) : void

Parameters

Name Type Default value Description
$paymentMethod PaymentMethodInterface - -

publicfindPaymentMethods()

PaymentMethodServiceDecorator.php : 63

Returns payment methods matching the given query.

public findPaymentMethods([PaymentMethodQuery|null $query = null ][, array<string|int, mixed>|null $prioritizedLanguages = null ]) : PaymentMethodListInterface

Parameters

Name Type Default value Description
$query PaymentMethodQuery|null null

Query used to fetch methods.

$prioritizedLanguages array<string|int, mixed>|null null

List of languages to use for fetching the payment methods.

Return values

PaymentMethodListInterface

publicgetPaymentMethod()

PaymentMethodServiceDecorator.php : 51

Returns payment method with given id.

public getPaymentMethod(int $id[, array<string|int, mixed>|null $prioritizedLanguages = null ]) : PaymentMethodInterface

Parameters

Name Type Default value Description
$id int - -
$prioritizedLanguages array<string|int, mixed>|null null

List of languages to use for fetching the payment method.

Return values

PaymentMethodInterface

publicgetPaymentMethodByIdentifier()

PaymentMethodServiceDecorator.php : 56

Returns payment method with given identifier.

public getPaymentMethodByIdentifier(string $identifier[, array<string|int, mixed>|null $prioritizedLanguages = null ]) : PaymentMethodInterface

Parameters

Name Type Default value Description
$identifier string - -
$prioritizedLanguages array<string|int, mixed>|null null

List of languages to use for fetching the payment method.

Return values

PaymentMethodInterface

publicisPaymentMethodUsed()

PaymentMethodServiceDecorator.php : 82

Checks if the payment method is used in any payment.

public isPaymentMethodUsed(PaymentMethodInterface $paymentMethod) : bool

Parameters

Name Type Default value Description
$paymentMethod PaymentMethodInterface - -

Return values

bool

publicupdatePaymentMethod()

PaymentMethodServiceDecorator.php : 75

Updates the payment method with given data.

public updatePaymentMethod(PaymentMethodInterface $paymentMethod, PaymentMethodUpdateStruct $updateStruct) : PaymentMethodInterface

Parameters

Name Type Default value Description
$paymentMethod PaymentMethodInterface - -
$updateStruct PaymentMethodUpdateStruct - -

Return values

PaymentMethodInterface