question

Pintuna avatar image
Pintuna asked parquet76 commented

Payment SDK issue - result code is always RESULT_CANCELED

This is my code block to launch Clover pay screen, even when the payment is successful the result code is always RESULT_CANCELED. It should be RESULT_OK. It is failing on both the devkit and the emulator. Please help.

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);
}
PaymentConnector
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

parquet76 avatar image parquet76 commented ·
You cannot use the emulator to test payments.
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community