Processing UI Component

Processing UI Component

The Processing UI Component is displayed during checkout initialization and payment.

Basic implementation

This code sample demonstrates a basic implementation of Processing UI Component.

Implementation
Layout

public class ProcessingFragment 
        extends Fragment 
        implements ProcessingUiComponent {

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater,
                             @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {
        return ProcessingFragmentBinding.inflate(inflater, container, false)
                .getRoot();
    }

    @Override
    public void onUiComponentCreated(@NonNull ProcessingUiComponentInteraction interaction) {
        // this method will be called after onViewCreated() and before onStart(),
        // it provides the link to the UI Component interaction, use it to initialize your UI
    }
}
class ProcessingUiComponentFragment : Fragment(), ProcessingUiComponent {

    private var _binding: ProcessingUiComponentFragmentBinding? = null
    private val binding get() = _binding!!

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        _binding = ProcessingUiComponentFragmentBinding.inflate(
            inflater, container, false)

        return binding.root
    }

    override fun onDestroyView() {
        super.onDestroyView()

        _binding = null
    }

    override fun onUiComponentCreated(interaction: ProcessingUiComponentInteraction) {
        // this method will be called after onViewCreated() and before onStart(),
        // it provides the link to the UI Component interaction, use it to initialize your UI
    }
}