Adyen / adyen-flutter

MIT License
22 stars 3 forks source link

Customizing card components #160

Closed rimkerb closed 2 months ago

rimkerb commented 2 months ago

Hello, I am trying to integrate this sdk into a flutter app and was wondering if there is any proposed solution in customizing the CardComponents currently? As far as the documentations go on the native libraries, that option is available albeit slightly vague. For Android -> Overriding the styles of all components in styles.xml/strings.xml, which is still possible to do. on iOS -> adding the FormComponentStyle() on the cardComponent itself. However the iOS styling is done manually when initiating the native component and the style object is not exposed in the current version of the library as far as I can see or perhaps this is coming in a future release?

As a side question, is there a possibility to somehow invoke the onSubmit button without using the pre-built button? A common use case would be for devs to build their own custom button on the flutter side and invoke it manually.

Robert-SD commented 2 months ago

Hi @rimkerb,

Thanks for raising your questions. It helps us in prioritizing tasks and assessing our roadmap with the Flutter Checkout SDK.

Customization for components like the CardComponent is on our agenda for the first beta release. You are also right regarding current customization capabilities. For Android it’s already possible but we still need to expose the style on iOS in order to support customizations. We would like to keep this issue open and will provide updates when the implementation is completed.

Regarding your second question invoking onSubmit without using the pre-built button, this functionality is currently not available and might be provided in one of the later releases like a stable version. However, with the first beta release CSE will be supported. That means you could create your own card component ui with a custom button and call our API directly by encrypting the card details. Please keep in mind that this also requires handling actions (e.g. 3DS2 challenge) yourself.

In case you have additional questions or would like to get more information, please feel free to contact us.

rimkerb commented 2 months ago

Hey, thanks for the answer,

Is there any indication on when the beta release might roll out?

Robert-SD commented 2 months ago

Hey @rimkerb,

You're welcome, I am happy to help out.

We plan to release the beta at the end of May / in the beginning of June. We currently don’t have a specific date because we want to finish some features first and smaller adjustments before releasing the beta. I will update this issue and notify you when the release is available.

Robert-SD commented 2 months ago

Hi @rimkerb,

we merged the branch allowing for customization in the next release. Hope this answers your question and helps in styling your card component as required. Please let me know if there are still missing customizations. A full list of customization options can be found in the API Reference.

You can specify the style by adding the AdyenAppearance class which implements the AdyenComponentAppearanceProvider protocol. Within createCardComponnetStlye() you can specify your style. We applied it for our example app.

Feel free to reopen the issue in case of additional questions or suggestions.