question

dhanaraj avatar image
dhanaraj asked dhanaraj edited

I am using to get the activity payment using Manual pay intent. returns data null when user choose charge option

Hi I am getting null data for the charge option in ManualPay intent.
Payment payment = data.getParcelableExtra(Intents.EXTRA_PAYMENT);

Is there any posibilty to get the intent data back from the activity.
Intents
10 |2000

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

chanel avatar image
chanel Deactivated answered
You can get the payment object using the following code snippets.

// Begin the payment process
Intent intent = new Intent(Intents.ACTION_MANUAL_PAY);
intent.putExtra(Intents.EXTRA_AMOUNT, 30L);
startActivityForResult(intent, 1007);

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data){
    if (requestCode == 1007){
        if(resultCode == RESULT_OK){
            Payment payment = data.getParcelableExtra(Intents.EXTRA_PAYMENT));
        } else {
            Toast.makeText(MainActivity.this, "Payment failed", Toast.LENGTH_SHORT).show();
        }
    }
}
10 |2000

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

dhanaraj avatar image
dhanaraj answered dhanaraj edited
@Chanel
Yes, I am using the same method for calling the Action-manual pay. It navigates to Sales activity. If I click cash or check means it is working fine. If I click Charge button means it navigates to Action_clover_pay_intent. After payment made it return to sales intent. And sales intent returns null to the startActivityForResult
10 |2000

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