# SDK Flutter for Android and iOS {#en_sdk_flutter} An article about using SDK Flutter for integrating a payment form in Android and iOS mobile applications. **Parent topic:**[Integration using SDK](en_sdk_overview.md) ## Overview {#en_sdk_flutter_overview} ### Introduction {#section_eyg_rmf_5bc .section} Mobile SDK Flutter for Android and iOS\(referred to as SDK Flutter further in this article\) is a software development kit with open-source code that can be used to integrate Flutter mobile applicationswith the Ecommpay payment platform. SDK Flutterwas developed as a plugin within the Flutter framework. It provides the functionality for interaction of customers with the user interface and for interaction of a mobile application with the Ecommpay payment platformwhich allows sending and receiving necessary information during payment processing. SDK Flutter can be embedded in mobile applications built using Flutter \(version 3.3.0 or later\) and developed for Android \(version 5.0 or later\) or iOS \(version 15.6 or later\).The SDK Flutter libraries and code examples are available on GitHub and pub.dev.To access, use the following URLs: - [https://github.com/ITECOMMPAY/msdk-flutter-plugin](https://github.com/ITECOMMPAY/msdk-flutter-plugin) - [https://pub.dev/packages/ecommpay\_flutter\_plugin](https://pub.dev/packages/ecommpay_flutter_plugin) ### Capabilities {#section_dnn_rmf_5bc .section} The following functional capabilities are supported by SDK Flutter: - Processing different types of payments made with cards, Apple Pay, and Google Pay as well as other payment methodsavailable for the merchant's project. Supported payment types include: - One-time one-step purchases. - One-time two-step purchases\(an authorisation hold can be placed via the SDK and subsequent debiting of the authorised amount is carried out via Gate or Dashboard\). - COF purchases\(they can be registered via the SDK and then managed via Gate or Dashboard\). **Note:** In case of card, Apple Pay, and Google Pay payments, the payment interface described in this article is used. With other payment methods, Payment Page is used during payment processing. - Performing payment card verification\(it involves debiting a zero amount from the customer's card\). - Checking current payment information. - Auxiliary procedures and additional capabilities to boost payment acceptance rates: - Submission of additional payment information. - Payment retries. - Collecting customer data. - Additional capabilities to improve user experience: - Saving customer payment data. - Payment interface language support. - Sending email notifications with the list of purchased items to customers. - Customising the appearance of the payment interfaceincluding the colour scheme settings. ### Workflow {#section_qcs_rmf_5bc .section} Generally, the following workflow is relevant when purchases are processed with the use of SDK Flutter. ![](images/sdk/flutter/en_sdk_flutter_functional.svg) 1. In the user interface of a mobile application, the customer initiates a purchaseby clicking the payment button or in a different fashion set up on the merchant side. 2. In the mobile application, a set of parameters for creating a payment session is generated. Then, with the help of SDK Flutter, this set is converted into a string for signing, and the string is sent to the server side of the merchantweb service. 3. On the server side of the merchantweb service, the parameters can be checked and supplemented if necessary, and the signature to the final parameter set is generated, following which the prepared data is sent back to SDK Flutter. 4. With the help of SDK Flutter, a payment session is initiated in the payment platform. 5. On the payment platform side, the payment interface is preparedin accordance with the invocation parameters, and the data for opening the interface is passed to the customer's device. 6. In the mobile application, the payment interface is displayed to the customer. 7. The customer selects a payment method\(if no method was selected when the payment session was initiated\),specifies the necessary information, and confirms the purchase. 8. SDK Flutter sends a purchase request to the payment platform. 9. On the payment platform side, the payment is registered and all necessary technical actions are performed; these actions include sending the required data to the payment environment—to the providers and payment systems. 10. The payment is processed in the payment environment. Then the payment result information is received in the payment platform. 11. In the payment platform, the information about the payment result is processed and a callback is sent to the server side of the web service. 12. The information about the purchase result is sent from the payment platform to SDK Flutter. 13. The notification with the result information is displayed to the customer in the user interface. ### Interface {#section_q2y_rmf_5bc .section} When card, Apple Pay, and Google Paypayments are processed, the customer interacts with the user interface designed by the Ecommpay specialists. This user interface can be customised: you can change its colour. ![](images/sdk/android/all_sdk_ui_core_design_color.svg "Customisation options") ![](images/sdk/android/all_sdk_ui_core_design_card_details.svg "Page to enter payment details") ![](images/sdk/android/all_sdk_ui_core_design_result.png "Payment result page") ## Setup {#en_sdk_flutter_setup} ### Integration steps {#section_um4_rpf_5bc .section} To integrate the web service with the Ecommpay payment platform by using SDK Flutter: 1. Address the following organisational issues of interaction with Ecommpay: 1. If your company has not obtained a project identifier and a secret key for interacting with Ecommpay, submit the application for connecting to the Ecommpay payment platform. 2. If your company has obtained a project identifier and a secret key for interacting with Ecommpay, inform the technical support specialists about the company's intention to integrate by using SDK Flutter and coordinate the procedure of testing and launching the functionality. 2. Complete the following preliminary technical steps: 1. Download and install SDK Flutter. 2. Ensure the collection of data necessary for the payment interface invocation.The minimum data set needed in order to invoke the payment interface consists of the project, payment, and customer identifiers as well as of the payment amount and currency. 3. Ensure signature generation for the data on the server side of the mobile application. 4. Ensure the receipt of and the response to the notifications from SDK Flutter as well as the receipt of and the response to the callbacks from the payment platform on the web service side. 3. With the technical support specialists, coordinate the timeline and the main steps of integrating, testing\(including testing available payment methods\), and launching the solution. 1. For testing, use the test project identifier and the details of [test cards](en_test_cards.md). 2. For switching to the production mode, change the value of the test project identifier to the value of the production project identifier received from Ecommpay. If you have any questions about working with SDK Flutter, contact the Ecommpay technical support specialists\([support@ecommpay.com](mailto:support@ecommpay.com)\). ### Installation {#section_sw5_rpf_5bc .section} To install SDK Flutterusing the tools of the Flutter framework, follow these steps: 1. Add the name of the plugin to the `pubspec.yaml` file of the project in useby issuing the following command. ``` $ flutter pub add ecommpay\_flutter\_plugin ``` As a result, the `pubspec.yaml` file should contain the line with the name of the added plugin and its version. ``` dependencies: ecommpay\_flutter\_plugin: ^1.0.4 ``` 2. Open the `lib/main.dart` file and import the functionalities contained in the package ``` import 'package:ecommpay\_flutter\_plugin/ecmpplugin.dart'; import 'package:ecommpay\_flutter\_plugin/ecmpplugin_method_channel.dart'; import 'package:ecommpay\_flutter\_plugin/ecmpplugin_platform_interface.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_additional_field.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_additional_field.g.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_payment.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_payment.g.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_payment_info.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_payment_info.g.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_payment_options.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_payment_options.g.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_plugin_result.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_plugin_result.g.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_recipient_info.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_recipient_info.g.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_recurrent_data.dart'; import 'package:ecommpay\_flutter\_plugin/models/ecmp_recurrent_data.g.dart'; ``` You can also install SDK Flutter differently as described in the Flutter documentation \([learn more](https://docs.flutter.dev/packages-and-plugins/using-packages)\). ### Signature generation {#section_emz_rpf_5bc .section} Make sure that the data is signed on the server side of the web service with the use of the secret key received from Ecommpay. To work with the signature, you can use ready-to-use components, such as language-specific SDKs for web services \([details](en_sdk_overview.md)\), or your own in-house solutions.The procedure of working with the signature is described in [Signature generation and verification](en_platform_signature.md). ## Testing {#en_sdk_flutter_testing} If necessary, the payment interface can be invoked in test modein order to get information about errors if there were any when payment parameters were specified or to test processing payments with a certain payment result. When creating the request to open the payment interface, in the `EcmpPaymentOptions` object specify the following values for the `mockModeType` parameter: - `EcmpMockModeType.success`—if you need to receive a `Success` payment result. - `EcmpMockModeType.decline`—if you need to receive a `Decline` payment result. You can also test payment processing in the test environment of the Ecommpay payment platform. In this case, you should get access to the Ecommpay test environment\(you can do it via [an application](https://ecommpay.com/sign-up/) on the company's main site and use the identifier and the secret key of the test project\). If you need to switch to the production mode, pass `EcmpMockModeType.disabled` as a value for the `mockModeType` parameter and use the production identifier and secret key. **Warning:** Do not test Apple Pay payments via SDK Flutter on simulated iOS devices. Testing the flow of Apple Pay requires a physical device, as the simulator cannot generate a valid Apple Pay token, which results in payment failures. Any errors observed in a simulation environment are expected and do not reflect the behaviour of a production integration. ## Use {#en_sdk_flutter_use} ### Payment interface invocation {#en_sdk_flutter_openingpf} SDK Flutter supports such actions as performing one-time purchases and placing authorisation holds as part of executing two-step purchases, registering COF purchases and performing payment card verification. To initiate these actions, you need a certain parameter set. The required minimum of parameters is passed in the `EcmpPaymentInfo` object while other parameters can be passed in the `EcmpPaymentOptions` object, requested from the customer, or received from the payment platform. To invoke the payment interface: 1. Create the `EcmpPaymentInfo` object containing the following required parameters. - `projectId` \(integer\)—a project identifierassigned by Ecommpay - `paymentId` \(string\)—a payment identifierunique within the project - `paymentCurrency` \(string\)—the payment currency codein the ISO 4217 alpha-3 format - `paymentAmount` \(integer\)—the payment amountin the smallest currency unit - `customerId` \(string\)—a customer's identifierwithin the project - `signature` \(string\)—a request signaturegenerated after all required parameters have been specified ```language-json final paymentInfo = EcmpPaymentInfo( projectId: 77655, paymentId: "payment_322", paymentAmount: 100, paymentCurrency: "USD", customerId: "customer007" ); ``` You can also add any other parameters listed [in the separate table](en_sdk_flutter.md#section_bqz_pcj_wbc). 2. Receive the string for signing the parameters. ``` final paramsForSignature = await ecmpPlugin.getParamsForSignature(paymentInfo); debugPrint(paramsForSignature); ``` 3. Send this string to the server side of the application. 4. On the server side of the application, sign the final set of parameters and send it to the client side. 5. Add the signature to the `EcmpPaymentInfo` object. ```language-json paymentInfo.signature = "CALCULATED_SIGNATURE_FROM_BACKEND"; ``` 6. Create the `EcmpPaymentOptions` object that contains the required parameter `actionType` \(string\) with the value specifying the target operation type: `sale`, `auth`, or `verify`. For card payments, specify at least one of the following fields: `email` or `phone` in the `additionalFields` list. If necessary, you can also specify additional information about the payment or the list of custom fields that will be displayed to the customer for collecting additional information \(in the `additionalFields` list\), including prepopulated fields. For example, for 3‑D Secure it is recommended that you pass the customer's billing address information \(country code, postal code, city, and street address\). Parameters that can be specified in the `EcmpPaymentOptions` object are listed [in the following table](en_sdk_flutter.md#section_y1v_qcj_wbc). **Note:** [According to Visa](files_for_downloads/cc0a9603-8fcc-4ef3-9738-3ffa823d06bd.pdf), rigorous use of these parameters can significantly increase payment acceptance rates \(up to 6 %\) and drastically decrease the number of operations flagged as fraudulent after they have been processed \(up to 65 %\). The following example contains the required `actionType` parameter and the `email` parameter required for card payments as well as several additional parameters passed in the `additionalFields` list to collect customer information.These additional fields include the parameters that are required for 3‑D Secure. ```language-json final paymentOptions = EcmpPaymentOptions( actionType: EcmpActionType.sale, paymentInfo: paymentInfo, isDarkTheme: false, //if need use real service- set EcmpMockModeType.disabled mockModeType: EcmpMockModeType.success, //set display mode if need screenDisplayModes: [EcmpScreenDisplayMode.hideDeclineFinalScreen], //set additional fields if need additionalFields: [ EcmpAdditionalField(type: "email", value: "mail@mail.com"), EcmpAdditionalField(type: "first_name", value: "firstName"), ], //set recipient info if need recipientInfo: EcmpRecipientInfo(), //set recurrent info if need recurrentData: EcmpRecurrentData(), ); ``` 7. Create the `EcmpPlugin` object. ```language-json final ecmpPlugin = EcmpPlugin(); ``` 8. Send the request to invoke the payment interface and receive result information. ```language-json final response = await ecmpPlugin.sdkRun(paymentOptions); ``` The following is the example of the code that can be used to invoke the payment interface. ``` final ecmpPlugin = EcmpPlugin(); //create payment info final paymentInfo = EcmpPaymentInfo( projectId: 12312, paymentId: "paymentId", paymentAmount: 100, paymentCurrency: "USD", customerId: "customer007" ); //get params for signature final paramsForSignature = await ecmpPlugin.getParamsForSignature(paymentInfo); debugPrint(paramsForSignature); //calculate and set signature and set it into payment info paymentInfo.signature = "signature"; final paymentOptions = EcmpPaymentOptions( actionType: EcmpActionType.sale, paymentInfo: paymentInfo, isDarkTheme: false, //if need use real service- set EcmpMockModeType.disabled mockModeType: EcmpMockModeType.success, //set display mode if need screenDisplayModes: [EcmpScreenDisplayMode.hideDeclineFinalScreen], //set additional fields if need additionalFields: [ EcmpAdditionalField(type: "email", value: "mail@mail.com"), EcmpAdditionalField(type: "first_name", value: "firstName"), ], //set recipient info if need recipientInfo: EcmpRecipientInfo(), //set recurrent info if need recurrentData: EcmpRecurrentData(), ); try { final response = await ecmpPlugin.sdkRun(paymentOptions); debugPrint(response.toString()); } on PlatformException { debugPrint("PlatformException"); } ``` ### Payment processing {#en_sdk_flutter_payments} SDK Flutter allows processing one-step and two-step purchases\(with the placing of authorisation hold via the SDK and subsequent debiting\). To process a one-step purchase, pass `sale` in the `actionType` parameter in the request to invoke the payment interface. To process a two-step purchase: 1. Send the request to invoke the payment interface with `auth` specified as a value for the `actionType` parameterin the `EcmpPaymentOptions` object: ```language-java actionType: EcmpActionType.auth ``` 2. When needed, initiate debiting of the authorised amount via Dashboard \([details](en_dbl_payments.md)\) or Gate\(by sending the request to the [/v2/payment/card/capture](https://api-developers.ecommpay.com/api-specification/card-payments/post-v2-payment-card-capture) endpoint\). ### Payment card verification {#en_sdk_flutter_verify} Payment instrument verification can be used when you need to validate a card without withdrawing funds instantly\(for example, before performing a payout\) or when you need to save card details for subsequent use. To perform verification, send the request to invoke the payment interface with `verify` specified as a value for the `actionType` parameterin the `EcmpPaymentOptions` object: ```language-java actionType: EcmpActionType.verify ``` ### Payment status information {#en_sdk_flutter_status} To receive payment result notifications, use the `EcmpPluginResult` object. ```language-json import 'package:ecommpay\_flutter\_plugin/models/ecmp_payment.dart'; import 'package:json_annotation/json_annotation.dart'; part 'ecmp_plugin_result.g.dart'; @JsonSerializable() class EcmpPluginResult { final int resultCode; final EcmpPayment? payment; final String? errorCode; final String? errorMessage; EcmpPluginResult( this.resultCode, this.payment, this.errorCode, this.errorMessage); Map toJson() => _$EcmpPluginResultToJson(this); factory EcmpPluginResult.fromJson(Map data) => _$EcmpPluginResultFromJson(data); } ``` ### Additional capabilities {#en_sdk_flutter_additional_capabilities} #### Submitting additional payment information {#section_yhs_g5f_5bc .section} Generally, for processing a payment, it is enough to send a set of parameters that are mandatory for its initiation. However, in some cases, a payment system or a provider can require additional data necessary for processing a particular payment.This can be due to region-specific requirements, the need for an additional anti-fraud check, or other factors. The final set of required parameters can vary depending on a specific provider or a payment system. The list of parameters relevant for a particular payment is displayed to the customer on the payment form.The customer fills in the required data, confirms the payment, and receives the payment result information. For more information about using the capability, see [this article](en_pp_clarification.md). #### Collecting customer data {#section_a3y_g5f_5bc .section} In some cases, alongside the mandatory parameters, it can be relevant to require the additional ones\(such as phone numbers and email addresses\) from the customers. To have this capability set up, the merchant shoulddecide which data has to be mandatory to be specified by the customers and communicate data collection preferences to the technical support specialists. For more information about using the capability, see [this article](en_PP_Gathering_customer_data.md). #### Payment interface language support {#section_znc_h5f_5bc .section} By default, the payment interface is localised according to either the language of the customer's device—if this language is supported for the project in use—or a language set as default for other cases\(as a general rule, it is English\). Along with that, if relevant, you can localise the payment interface for particular sessions. For this, every request for invoking the payment interface must contain a corresponding language code in the `languageCode` parameter of the `EcmpPaymentInfo` object. **Warning:** If the language is not supported for the project, the payment interface is not opened and the error information is displayed to the customer. The following languages are supported for the SDK Flutter interface and can be promptly set up in the projects of the payment platform. |Language|Language code| |--------|-------------| |English|`en`| |Estonian|`et`| |French|`fr`| |German|`de`| |Italian|`it`| |Latvian|`lv`| |Lithuanian|`lt`| |Portuguese|`pt`| |Spanish|`es`| |Ukrainian|`uk`| #### Saving payment data {#section_j3z_l5f_5bc .section} SDK Flutter allows saving payment data of the customer for subsequent processing of payments without the need for the said customer to re-enter such data. This capability is set up individually for each project.The merchant has to let the technical support know which of the two options is preferable: *always save payment data* or *ask the customer to select the option*. As a result of saving payment data, a separate identifier is generated for each payment instrument. This identifier is associated with the identifier of a certain customer \(`customerId`\). To display saved payment data to the customer, pass `false` in the `hideSavedWallets` parameter of the `EcmpPaymentInfo` object. For more information about using the capability, see [this article](en_PP_saved_data.md). ## Additional parameters for invocation requests {#en_sdk_flutter_parameters} ### Parameters of the EcmpPaymentInfo object {#section_bqz_pcj_wbc .section} When working with SDK Flutter, you can use the following additional parameters in the `EcmpPaymentInfo` object. |Parameter|Description| |:--------|:----------| |`paymentDescription` string |Description of the payment. A string that contains between 1 and 255 characters. Example: `Cosmoshop purchase` | |`receiptData` string |Data to be included in the notification with the list of the purchased items, passed as a JSON object encoded using the Base64 scheme. Example: `eyAgCiAgICAgICJwb3NpdGlvbnMiOlsgIAogICAgICAgICB7ICAKICAgICAgI CAgICAgInF1YW50aXR5IjozLAogICAgICAgICAgICAiYW1vdW50IjoxMDAwMC wKICAgICAgICAgICAgInRheCI6MTgsCiAgICAg` | |`token` string |Token associated with certain payment data. A string that contains between 1 and 255 characters. Example: `6bbd9255e484f00cc778246c5b7489aa4c498b8bb5231e85942437c` | |`hideSavedWallets` boolean |Parameter that allows you to enable hiding or displaying previously saved payment instruments. Possible values: - `true`—hide - `false`—display | |`forcePaymentMethod` string |The identifier of the preselected payment methodaccording to [the table](en_pm_codes.md). Example: `card` | |`languageCode` string |Payment interface language code in the ISO 639-1 alpha-2 format.Must match one of the languages supported for the given project. Example: `EN` | |`regionCode ` string |Code of the customer's country in the ISO 3166-1 alpha-2 format. Example: `GB` | ### Parameters of the EcmpPaymentOptions object {#section_y1v_qcj_wbc .section} You can use the following additional parameters in the `EcmpPaymentOptions` object. |Parameter|Description| | |---------|-----------|--| |`googleMerchantId` string |The Google Pay identifier of the merchant.|1| |`googleMerchantName` string |The Google Pay name of the merchant.|2| |`googleIsTestEnvironment` boolean |Parameter that indicates a test payment.Passed when processing Google Pay payments. Possible values: - `true`—test payment - `false`—real payment |3| |`applePayMerchantId` string |The Apple Pay identifier of the merchant.|4| |`applePayDescription` string |The description of the merchant in the Apple Pay service.|5| |`applePayCountryCode` string |Code of the customer's country in the ISO 3166-1 alpha-2 format. Passed when Apple Pay payments are processed. Example: `GB` |6| |`isDarkTheme` boolean |Parameter that indicates the use of the payment interface's dark mode. Possible values: - `true`—use the dark mode - `false`—do not use the dark mode |7| |`brandColor` string |The colour of the payment interface's main elements in hexadecimal format. Example: `#800080` |8| |`screenDisplayModes` list |Parameter indicating that the payment result does not need to be shown in the payment interface. Possible values: - `hideSuccessFinalScreen`—do not show payment completion information - `hideDeclineFinalScreen`—do not show payment decline information |10| |`additionalFields` list |Additional fields that contain information about the customer. Contains the list of parameters and can include their values. Example: ``` additionalFields: [ EcmpAdditionalField(type: "email", value: "mail@mail.com"), EcmpAdditionalField(type: "first_name", value: "firstName"), ], ``` |11| |`storedCardType` integer |Indicator of a COF purchase type. Possible values: - `3`—autopurchase - `5`— regular purchase |12| |`recipientInfo` object |Object with information about the recipient of the payment.|13| |`pan` string |Card number. Example: `5413330000000019` |13-113| |`cardHolder` string |First and last name \(as specified on the card\). Example: `Arthur Eddington` |13-213| |`walletId` string |Number of the wallet. Example: `WID2812188222111944` |13-313| |`walletOwner` string |First and last name of the recipient. Example: `Arthur Eddington` |13-413| |`country` string |Code of the recipient's country in the ISO 3166-1 alpha-2 format. Example: `GB` |13-513| |`address` string |Recipient's address. Example: `42 Walliscote Road` |13-613| |`city` string |Recipient's city of residence. Example: `Weston-super-Mare` |13-713| |`stateCode` string |Recipient's state. Example: `GB` |13-813| |`recurrentData` object |Object that contains information about a COF purchase that is being registered|14| |`register` boolean |Indicator that specifies whether a COF purchase should be registered. Possible values: - `true`—payment that registers a COF purchase - `false`—payment that does not register a COF purchase |14-114| |`type` string |Type of the COF purchase to register. Possible values: - `C`—OneClick - `U`—autopurchase - `R`—regular purchase |14-214| |`expiryDay` string |Calendar day on which the specified duration period of the COF purchase will end \(the value should be provided as an integer from `1` to `31`, without a leading zero, in accordance with the Gregorian calendar\).|14-314| |`expiryMonth` string |Month in which the specified duration period of the COF purchase will end \(the value should be provided as an integer from `1` to `12`, without a leading zero, in accordance with the Gregorian calendar\).|14-414| |`expiryYear` string |Year in which the specified duration period of the COF purchase will end \(in the `YYYY` format, in accordance with the Gregorian calendar\).|14-514| |`period` string |Frequency of debits \(for a regular COF purchase\). Possible values: - `D`—daily - `W`—weekly - `M`—monthly \(if the set day is not available in the next month, for example, 31, the payment is performed on the last day of the month\) - `Q`—quarterly - `Y`—yearly |14-614| |`interval` integer |Multiplier to increase debiting frequency \(i.e. the interval of performing regular COF purchases\). This parameter is used in conjunction with the `period` parameter. Possible values: from `1` to `100` |14-714| |`time` string |Time of performing subsequent debits \(for a regular purchase\) in `hh:mm:ss` format. The parameter is used if the `period` parameter is specified in the request.|14-814| |`startDate` string |Date on which the first debit operation is performed \(for a COF regular purchase\). This parameter is used in conjunction with the `scheduled_payment_id` parameter and should be specified in the `DD-MM-YYYY` format.|14-914| |`scheduledPaymentID` string |Identifier assigned to the payment within which scheduled debits are performed \(for automatic debiting\), it must differ from the identifier of the payment made to register a COF purchase and must be unique within the project. Parameter must be passed together with the `start_date` parameter. |14-1014| |`amount` integer |The amount to debit in the smallest currency unit.|14-1114| **Note:** If any of the parameters defining the expiry date of the COF purchase is not provided in the request, the following default values apply: - For standard card payments—the corresponding parameter value \(day, month, year\) is determined based on the expiry date of the specified payment card. - For other available methods—the corresponding parameter value is determined as follows: - Calendar day—the last calendar day of the relevant month \(as specified in the `expiry_month` parameter or corresponding to the COF purchase registration date\). - Month—the month in which the COF purchase was registered. - Year—the year that is 10 years after the year in which the COF purchase was registered. Accordingly, if only the year is specified, for standard card payments the day and month are taken from the expiry date of the relevant card and combined with the specified year. For an alternative payment method, the expiry date is set to the last calendar day of the month in which the COF purchase was registered and the specified year.