checkout / frames-android

Frames Android: making native card payments simple
https://www.checkout.com/docs/integrate/sdks/android-sdk
MIT License
47 stars 32 forks source link

Setting payment form to the fragment #181

Closed cornusmas closed 1 year ago

cornusmas commented 1 year ago

While setting the checkout payment form to the fragment, I realized that there is no this method "@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState ) { return paymentFormMediator.provideFragmentContent(this); }" was designed for fragments in version 4.0.0 and there is a similar method "@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState ) { return paymentFormMediator.provideFragmentContent(this, ViewCompositionStrategy.Default); }", but this did not work either. Could you explain this point? Thanks in advance

maxim-nosov-cko commented 1 year ago

Hi @cornusmas

Thank you for pointing out this issue. paymentFormMediator.provideFragmentContent(this); is not available from the java code right now, it will be improved soon.

From the other side paymentFormMediator.provideFragmentContent(this, ViewCompositionStrategy.Default); should work. Could you please describe in detail what exactly does not work for this approach? Do you use androidx.fragment?

To get more understanding of how it works under the hood please take a look at this.

cornusmas commented 1 year ago

Thank you for your quick reply. Yes, the second method works fine. The issue is related to the speed of the server. I solved the problem

maxim-nosov-cko commented 1 year ago

paymentFormMediator.provideFragmentContent(this); availability for java code is improved in the latest version 4.0.1.