Refund and Void as "detached" transactions

#1

Hi There!

I’m writing a Flutter library that “wraps” Payment Fragment and provides Flutter interface for it. So far SALE and AUTHORIZE transactions work perfectly well, as expected, and are used in our production app. But i’m struggling with VOID and REFUND transactions.
I’m aware that there is Intents.ACTION_DISPLAY_PAYMENT for locating a transaction and making adjustments to it, but i’m also looking for a way to be able to initiate a detached REFUND (refund in it’s classical meaning) and ‘detached’ VOID(by passing the original transaction parameters and jumping directly to cardholder part of the transaction flow).

Can it be done? If not, can I request it to be added as a Payment Fragment feature?

Also, I’m not sure how to report a bug, but I noticed that if I set payment.setAction(TransactionAction.REFUND); to transaction, it will initiate Sale transaction. The expected result would be either a Refund transaction or an error if refund is not supported, or there is something wrong with request. Subsequent call to payment.getAction().toString() does produce REFUND as an output, so it seems that there is something not right in Payment object.

Here is my code for better perspective:

    try {
      Payment payment = new Payment();
      payment.setAction(TransactionAction.REFUND);
      Log.d(LOG_TAG, "Payment action is set to: " + payment.getAction().toString());  // produces "REFUND"
      payment.setAmount(amount);
      Intent collectPaymentIntent = new Intent(Intents.ACTION_COLLECT_PAYMENT);
      collectPaymentIntent.putExtra(Intents.INTENT_EXTRAS_PAYMENT, payment);
      activity.startActivityForResult(collectPaymentIntent, PAYMENT_REQUEST);
    } catch (ActivityNotFoundException e) {
      Log.e(LOG_TAG,"Poynt Payment Activity not found. Ensure that Poynt Services are installed.", e);
      mainThreadResult.error(String.valueOf(e.hashCode()), e.getMessage(), null);
    } catch (Exception e) {
      mainThreadResult.error(String.valueOf(e.hashCode()), e.getMessage(), null);
    }

Dependencies:

implementation 'co.poynt.api:android-api-model:1.2.138@jar'
implementation 'co.poynt.android.sdk:poynt-sdk:1.2.42@aar'

Best