Adyen / adyen-ios

Adyen iOS Drop-in and Components
https://docs.adyen.com/checkout/ios
MIT License
150 stars 119 forks source link

[NEED ASSIST] IDeal Component in 5.9.0 missing #1699

Closed Sharkcoon closed 1 month ago

Sharkcoon commented 1 month ago

Describe the challenge I updated the SDK from version 5.8.0 to 5.9.0 and received following errors: IdealDetails missing -> It looks like the PaymentMethodDetail IdealDetails has been removed IdealComponent missing -> No more IdealComponent in the SDK

I then started to create my own IdealDetails like i use it for Sofort, Twint, Bancontact, etc.

struct IdealDetails: PaymentMethodDetails {
    var checkoutAttemptId: String?

    let type: Adyen.PaymentMethodType
}

In my AdyenCheckoutController i switched on the PaymentMethods and used iDeal via the IssuerListPaymentMethod where i was able to check on its type and then create an IdealComponent with my info from the issuerListPaymentMethod

        case let issuerListPaymentMethod as IssuerListPaymentMethod:
            switch issuerListPaymentMethod.type {
            case .ideal: // https://docs.adyen.com/payment-methods/ideal#collect-with-ios-component
                let style = ListComponentStyle()
                let payment: Payment? = orderResponseRelay.value?.payment
                component = try IdealComponent(paymentMethod: issuerListPaymentMethod, context: .current(payment: payment), configuration: .init(style: style))

It seems as i cant use that anymore so i´m stuck how to start a component correctly as there must also be an issuer set somewhere

What i want to achieve is: Show the iDeal Payment screen correctly

Documentation update (optional) Here it says for 5.0.0 or later to use IDealComponent https://docs.adyen.com/payment-methods/ideal/ios-component/?tab=advanced-5-config_2

erenbesel commented 1 month ago

Hey @Sharkcoon This change is mandatory to prepare for the new iDEAL flow. iDEAL will be a redirect and not an issuer list, so from 5.9.0 on we have made the change to support it.

This means iDEAL is now an InstantPaymentMethod which requires just an InstantPaymentComponent instead. (It won't be amongst the IssuerList type paymentmethods)

        guard let paymentMethod = paymentMethods.paymentMethod(ofType: .ideal) else { return }
        let component = InstantPaymentComponent(paymentMethod: paymentMethod, context: context, order: nil)
        component.initiatePayment() 

We will update our docs accordingly and also add more details on our release notes to make the change more clear. Apologies for any inconvenience

You can see the new flow on our demo app as well. The Instant/Redirect Payment section shows the new iDEAL flow.

goergisn commented 1 month ago

Hi @Sharkcoon here also a link to the documentation https://docs-admin.is.adyen.com/payment-methods/ideal/ios-component#component-configuration

Feel free to re-open the ticket if needed :)