Provide custom_attributes value if you want to customize form behaviour. This value (if provided) must be valid json.
Currently we support following keys:
installments_configfields_config
Example:
{
"installments_config": {
"rules": [
{
"brand": "visa",
"min_installments": 2,
"max_installments": 12
},
{
"brand": "master",
"min_installments": 12,
"max_installments": 24
}
]
},
"fields_config": {
"fields": [
{
"name": "ch_email",
"readonly": true
},
{
"name": "ch_full_name",
"readonly": true
}
]
}
}
Installments Config
Used to customize installments selection after user's card number input.
This extension can be used to fulfil contract between merchant and buyer, where buyer can only pay with one of supported card brands (provided in rules list) by selecting installments from min_installments to max_installments defined in installments config.
Types:
InstallmentConfig- type = object
- properties
- rules
- type =
Array<InstallmentsConfigRule> - description = includes one or more installments config rule. Rule's brand must be unique per
rulesarray. This means you cannot include multiple brand = 'brand' rules.
- type =
- rules
InstallmentsConfigRule- type = object
- properties
- brand
- type = string
- description = one of
visa,master,maestro,diners,amex
- min_installments
- type = number, integer
- description = min installments, must be < than max_installments
- max_installments
- type = number, integer
- description = max installments, must be > than min_installments
- brand
Installments config example:
{
"installments_config": {
"rules": [
{
"brand": "visa",
"min_installments": 2,
"max_installments": 12
},
{
"brand": "master",
"min_installments": 12,
"max_installments": 24
}
]
}
}
Usage example
Requirements
- installments are enabled in merchant's profile
- merchant's acquiring account is enabled for installments
If you need helping enabling installments contact support@monri.com
Example steps
- Set custom attributes field to
'{
"installments_config": {
"rules": [{
"brand": "visa",
"min_installments": 2,
"max_installments": 12
}, {
"brand": "master",
"min_installments": 12,
"max_installments": 24
}
]
}
}'
- Submit prepared data
- Enter
visaormastercard number incard numberfield- Installments selection is updated using rules provided in installments config. If
visais entered installments selection isone time payment (jednokratno)and then from2 to 12installments. Ifmasteris entered installments selection isone time payment (jednokratno)and then from12 to 24installments - Select desired number of installments
- Proceed with payment
- Payment completed
- Installments selection is updated using rules provided in installments config. If
- Enter
amex (eg 3704 387472 13977)incard numberfield- installments selection is only
one time payment - jednokratno - appropriate error message is shown -
Card 'amex' not supported - payment is disabled
- installments selection is only
Fields Config
Used to customize installments selection after user's card number input.
This extension can be used to fulfil contract between merchant and buyer, where buyer can only pay with one of supported card brands (provided in rules list) by selecting installments from min_installments to max_installments defined in installments config.
Types:
FieldsConfig- type = object
- properties
- fields
- type =
Array<FieldConfig> - description = includes one or more field configs
- type =
- fields
FieldConfig- type = object
- properties
- name
- type = string
- description = one of
ch_email,ch_full_name
- readonly
- type = boolean
- description =
trueorfalse. Field is readonly for input only if initial value is provided and valid
- name
Fields config example:
{
"fields_config":{
"fields":[
{
"name":"ch_email",
"readonly": true
},
{
"name":"ch_full_name",
"readonly": true
}
]
}
}
Usage example
Example steps
- Set custom attributes field to
'{
"fields_config": {
"fields": [{
"name": "ch_email",
"readonly": true
}, {
"name": "ch_full_name",
"readonly": true
}
]
}
}'
- Submit prepared data
- Inputs for email and full name (if provided) are read-only