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
Methods¶
__construct() ¶
Construct object optionally with a set of properties.
|
|
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 | - | - |
getDescription() ¶
Returns the description of the payment method in the specified language.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageCode | string | - | - |
Return values
string|null
getDescriptions() ¶
Returns the descriptions of the payment method.
|
|
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>
getIdentifier() ¶
Returns the identifier of the payment method.
|
|
Return values
string
getName() ¶
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageCode | string | - | - |
Return values
string
Tags
getNames() ¶
Returns the names of the payment method.
|
|
The key is the language code and the value is the name of the payment method in that language.
Return values
array<string, string>
getOptions() ¶
Returns payment method specific options.
|
|
Return values
MapInterface<string, mixed>
getType() ¶
|
|
Return values
isEnabled() ¶
Returns whether the payment method is enabled.
|
|
Return values
bool
setDescription() ¶
Sets the description of the payment method in the specified language.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageCode | string | - | - |
$description | string|null | - | - |
setDescriptions() ¶
Sets the descriptions of the payment method.
|
|
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> | - | - |
setEnabled() ¶
Sets whether the payment method is enabled.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$enabled | bool | - | - |
setIdentifier() ¶
Sets the identifier of the payment method.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$identifier | string | - |
Identifier must be unique and contain only alphanumeric characters, underscores and hyphens. |
setName() ¶
Sets the name of the payment method in the specified language.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageCode | string | - | - |
$name | string | - | - |
setNames() ¶
Sets the names of the payment method.
|
|
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> | - | - |
setOptions() ¶
Sets payment method specific options.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$options | MapInterface<string, mixed> | - | - |
setType() ¶
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$type | TypeInterface | - | - |
getProperties() ¶
Function where list of properties are returned.
|
|
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>