Copied!

PaymentMethodServiceInterface

PaymentMethodServiceInterface.php : 20

Service for managing payment methods.

Methods

publiccreatePaymentMethod()

PaymentMethodServiceInterface.php : 66

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

Tags
Throws
InvalidArgumentException
Throws
BadStateException
Throws
UnauthorizedException

If the current user does not have access to create a payment method.

Throws
ValidationFailedExceptionInterface

If the given update struct is invalid.

publicdeletePaymentMethod()

PaymentMethodServiceInterface.php : 86

Deletes the payment method.

public deletePaymentMethod(PaymentMethodInterface $paymentMethod) : void

Parameters

Name Type Default value Description
$paymentMethod PaymentMethodInterface - -
Tags
Throws
UnauthorizedException

If the current user does not have access to delete the payment method.

publicfindPaymentMethods()

PaymentMethodServiceInterface.php : 51

Returns payment methods matching the given query.

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

Parameters

Name Type Default value Description
$query PaymentMethodQuery|null null

Query used to fetch methods.

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

List of languages to use for fetching the payment methods.

Return values

PaymentMethodListInterface

publicgetPaymentMethod()

PaymentMethodServiceInterface.php : 30

Returns payment method with given id.

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

Parameters

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

List of languages to use for fetching the payment method.

Return values

PaymentMethodInterface

Tags
Throws
NotFoundException

If payment method with given id does not exist.

Throws
UnauthorizedException

If the current user does not have access to the payment method.

publicgetPaymentMethodByIdentifier()

PaymentMethodServiceInterface.php : 40

Returns payment method with given identifier.

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

Parameters

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

List of languages to use for fetching the payment method.

Return values

PaymentMethodInterface

Tags
Throws
NotFoundException

If payment method with given identifier does not exist.

Throws
UnauthorizedException

If the current user does not have access to the payment method.

publicisPaymentMethodUsed()

PaymentMethodServiceInterface.php : 91

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()

PaymentMethodServiceInterface.php : 76

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

Tags
Throws
InvalidArgumentException
Throws
BadStateException
Throws
UnauthorizedException

If the current user does not have access to update the payment method.

Throws
ValidationFailedExceptionInterface

If the given update struct is invalid.