Copied!

PaymentMethodCreateStruct

PaymentMethodCreateStruct.php : 32
Extends ValueObject

Structure containing data required to create a payment method.

The following example creates "PayPal" payment method:

$createStruct = new PaymentMethodCreateStruct('paypal', $type);
$createStruct->setName('eng-GB', 'PayPal');
$createStruct->setDescription('eng-GB', 'Transfer money online in seconds with PayPal money transfer.');
$createStruct->setEnabled(true);

$paymentMethod = $paymentMethodService->createPaymentMethod($createStruct);
Tags
See
PaymentMethodServiceInterface::createPaymentMethod()

Methods

public__construct()

PaymentMethodCreateStruct.php : 49

Construct object optionally with a set of properties.

public __construct(string $identifier, TypeInterface $type)

Readonly properties values must be set using $properties as they are not writable anymore after object has been created.

Parameters

Name Type Default value Description
$identifier string - -
$type TypeInterface - -

publicgetDescription()

PaymentMethodCreateStruct.php : 171

Returns the description of the payment method in the specified language.

public getDescription(string $languageCode) : string|null

Parameters

Name Type Default value Description
$languageCode string - -

Return values

string|null

publicgetDescriptions()

PaymentMethodCreateStruct.php : 143

Returns the descriptions of the payment method.

public getDescriptions() : array<string, string|null>

The key is the language code and the value is the description of the payment method in that language.

Return values

array<string, string|null>

publicgetIdentifier()

PaymentMethodCreateStruct.php : 64

Returns the identifier of the payment method.

public getIdentifier() : string

Return values

string

publicgetName()

PaymentMethodCreateStruct.php : 116
public getName(string $languageCode) : string

Parameters

Name Type Default value Description
$languageCode string - -

Return values

string

Tags
Throws
InvalidArgumentException

If name in the specified language is not defined.

publicgetNames()

PaymentMethodCreateStruct.php : 96

Returns the names of the payment method.

public getNames() : array<string, string>

The key is the language code and the value is the name of the payment method in that language.

Return values

array<string, string>

publicgetOptions()

PaymentMethodCreateStruct.php : 197

Returns payment method specific options.

public getOptions() : MapInterface<string, mixed>

Return values

MapInterface<string, mixed>

publicgetType()

PaymentMethodCreateStruct.php : 79
public getType() : TypeInterface

Return values

TypeInterface

publicisEnabled()

PaymentMethodCreateStruct.php : 179

Returns whether the payment method is enabled.

public isEnabled() : bool

Return values

bool

publicsetDescription()

PaymentMethodCreateStruct.php : 163

Sets the description of the payment method in the specified language.

public setDescription(string $languageCode, string|null $description) : void

Parameters

Name Type Default value Description
$languageCode string - -
$description string|null - -

publicsetDescriptions()

PaymentMethodCreateStruct.php : 155

Sets the descriptions of the payment method.

public setDescriptions(array<string, string|null> $descriptions) : void

The key is the language code and the value is the description of the payment method in that language.

Parameters

Name Type Default value Description
$descriptions array<string, string|null> - -

publicsetEnabled()

PaymentMethodCreateStruct.php : 187

Sets whether the payment method is enabled.

public setEnabled(bool $enabled) : void

Parameters

Name Type Default value Description
$enabled bool - -

publicsetIdentifier()

PaymentMethodCreateStruct.php : 74

Sets the identifier of the payment method.

public setIdentifier(string $identifier) : void

Parameters

Name Type Default value Description
$identifier string -

Identifier must be unique and contain only alphanumeric characters, underscores and hyphens.

publicsetName()

PaymentMethodCreateStruct.php : 131

Sets the name of the payment method in the specified language.

public setName(string $languageCode, string $name) : void

Parameters

Name Type Default value Description
$languageCode string - -
$name string - -

publicsetNames()

PaymentMethodCreateStruct.php : 108

Sets the names of the payment method.

public setNames(array<string, string> $names) : void

The key is the language code and the value is the name of the payment method in that language.

Parameters

Name Type Default value Description
$names array<string, string> - -

publicsetOptions()

PaymentMethodCreateStruct.php : 207

Sets payment method specific options.

public setOptions(MapInterface<string, mixed> $options) : void

Parameters

Name Type Default value Description
$options MapInterface<string, mixed> - -

publicsetType()

PaymentMethodCreateStruct.php : 84
public setType(TypeInterface $type) : void

Parameters

Name Type Default value Description
$type TypeInterface - -

protectedgetProperties()

ValueObject.php : 50

Function where list of properties are returned.

protected getProperties([array<string|int, mixed> $dynamicProperties = [] ]) : array<string|int, mixed>

Used by attributes(), override to add dynamic properties

Parameters

Name Type Default value Description
$dynamicProperties array<string|int, mixed> []

Additional dynamic properties exposed on the object

Return values

array<string|int, mixed>