clover / clover-android-sdk

Clover SDK for developing applications on Clover Station/Mobile/Mini/Flex

Home Page:https://docs.clover.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ACTION_CLOVER_PAY action always return RESULT_CANCELLED

vuleanh opened this issue · comments

commented

This is my code block to launch Clover pay screen, but even when the payment was successful but the result code is always RESULT_CANCELED. It should be RESULT_OK. Please help to check

ActivityResultLauncher<Intent> launchCloverPay = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback<ActivityResult>() {
        @Override
        public void onActivityResult(ActivityResult result) {
           // result.getResultCode() is always RESULT_CANCELED
        }
    });


private void startRegisterIntent(String orderId) {
        Intent intent = new Intent(Intents.ACTION_CLOVER_PAY);
        intent.putExtra(Intents.EXTRA_CLOVER_ORDER_ID, orderId);
        intent.putExtra(Intents.EXTRA_OBEY_AUTO_LOGOUT, false);
        launchCloverPay.launch(intent);
}