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()
            ¶
    
        Construct object optionally with a set of properties.
|  |  | 
Readonly properties values must be set using $properties as they aren't writable anymore
after object has been created.
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $identifier | string | - | - | 
| $type | TypeInterface | - | - | 
                 getDescription()
            ¶
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()
            ¶
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()
            ¶
getIdentifier()
            ¶
    
        Returns the identifier of the payment method.
|  |  | 
Return values
string
                 getName()
            ¶
getName()
            ¶
    
        |  |  | 
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $languageCode | string | - | - | 
Return values
string
Tags
                 getNames()
            ¶
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()
            ¶
getOptions()
            ¶
    
        Returns payment method specific options.
|  |  | 
Return values
MapInterface<string, mixed>
                 getType()
            ¶
getType()
            ¶
    
        |  |  | 
Return values
                 isEnabled()
            ¶
isEnabled()
            ¶
    
        Returns whether the payment method is enabled.
|  |  | 
Return values
bool
                 setDescription()
            ¶
setDescription()
            ¶
    
        Sets the description of the payment method in the specified language.
|  |  | 
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $languageCode | string | - | - | 
| $description | string|null | - | - | 
                 setDescriptions()
            ¶
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()
            ¶
setEnabled()
            ¶
    
        Sets whether the payment method is enabled.
|  |  | 
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $enabled | bool | - | - | 
                 setIdentifier()
            ¶
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()
            ¶
setName()
            ¶
    
        Sets the name of the payment method in the specified language.
|  |  | 
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $languageCode | string | - | - | 
| $name | string | - | - | 
                 setNames()
            ¶
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()
            ¶
setOptions()
            ¶
    
        Sets payment method specific options.
|  |  | 
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $options | MapInterface<string, mixed> | - | - | 
                 setType()
            ¶
setType()
            ¶
    
        |  |  | 
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $type | TypeInterface | - | - | 
                 getProperties()
            ¶
getProperties()
            ¶
    
        Returns list of available properties' names.
|  |  | 
Override to add dynamic properties.
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $dynamicProperties | array<int, string> | [] | Additional dynamic properties exposed on the object | 
Return values
array<int, string>