Skip to content

Language Change Resets Payer Details in SetupPayerDetailsViewController #12

@Matejkob

Description

@Matejkob

Description:
I encountered a bug related to the SetupPayerDetailsViewController in the SDK when using it for iOS. The issue occurs when changing the language after entering the payer's details, which causes the data in the payerName and payerEmail fields to reset to their default values.

Steps to Reproduce:

  1. Create a Merchant instance as per the SDK documentation:

    let merchant = Merchant(
        authorization: Merchant.Authorization(
            clientId: "***",
            clientSecret: "***"
        ),
        environment: .sandbox
    )
  2. Configure the SDK with the following code:

    do {
        try TpayModule
            .configure(merchant: merchant)
            .configure(merchantDetailsProvider: MyCustomMerchantDetailsProvider())
            .configure(
                paymentMethods: [
                    .payPo,
                    .pbl
                ]
            )
            .configure(preferredLanguage: .pl)
    } catch {
        print(error)
    }
  3. Open the SDK and navigate to the SetupPayerDetailsViewController.

  4. Enter values for payerName and payerEmail.

  5. Change the language from PL to English EN.

  6. Observe that the data in the payerName and payerEmail fields resets to their default values (empty inputs in this case).

Expected Behavior:
The payerName and payerEmail fields should retain the modified data even after the language is changed. If an additional PayerContext was provided, the fields should not reset to the data from the PayerContext but rather retain any manual modifications made by the user.

Actual Behavior:
After changing the language, the data in the payerName and payerEmail fields resets to their default state (empty inputs). If a PayerContext is provided, the fields reset to the data from the PayerContext instead of keeping the modified input.

Environment:

  • SDK Version: 1.2.0
  • iOS Version: 17.2

Additional Context:
This issue affects the user experience as it forces users to re-enter their information after a language change, which can be particularly inconvenient. The expected behavior would be for the data to persist regardless of language changes unless explicitly reset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions