question

Gabriel Fernandez avatar image
Gabriel Fernandez asked sam Deactivated commented

Is there an error on EXTRA_PAYMENT - The resulting payment when you use ACTION_MANUAL_PAY - Launch Sale activity ?

I have made two payments with Sales app using ACTIONMANUALPAY:

Case 1: The first one was successful.

Case 2: The second one was successful too, but i did Void Transaction after the payment was successful using the button Void Transaction.

Here the result Payment object that come on EXTRA_PAYMENT for both cases:

Case 1:

{ "result": "SUCCESS", "createdTime": 1489189111631, "taxRates": { "elements": [ { "id": "1P0HEQEARAFNP", "taxableAmount": 1500, "name": null, "rate": 0 } ] }, "offline": false, "cardTransaction": { "cardholderName": "BT TTTTTTTTT", "authCode": "264472", "entryType": "EMV_CONTACT", "token": "", "extra": { "applicationIdentifier": "A0000001523010", "cvmResult": "SIGNATURE", "routingIndicator": "C" }, "state": "PENDING", "referenceId": "266940295", "last4": "4464", "transactionNo": "200080", "type": "PREAUTH", "cardType": "DISCOVER", "vaultedCard": null }, "id": "1EHM0794D17YM", "amount": 1500, "cashTendered": null, "tipAmount": null, "taxAmount": 0, "lineItemPayments": null, "order": { "id": "4AR0997254A7P" }, "tender": { "id": "094VZ0686XBP6", "enabled": true, "instructions": null, "visible": true, "labelKey": "com.clover.tender.credit_card", "label": "Credit Card", "opensCashDrawer": false, "editable": false }, "employee": { "id": "7C7NZ76AVRFP4" }, "externalPaymentId": null, "cashbackAmount": null }

Case 2:

{ "result": "SUCCESS", "createdTime": 1489189310354, "taxRates": { "elements": [ { "id": "1P0HEQEARAFNP", "taxableAmount": 1500, "name": null, "rate": 0 } ] }, "offline": false, "cardTransaction": { "cardholderName": "BT ACSTRESSTEST", "authCode": "333427", "entryType": "EMV_CONTACT", "token": "", "extra": { "applicationIdentifier": "A0000001523010", "cvmResult": "SIGNATURE", "routingIndicator": "C" }, "state": "PENDING", "referenceId": "266940295", "last4": "4464", "transactionNo": "200082", "type": "PREAUTH", "cardType": "DISCOVER", "vaultedCard": null }, "id": "TD4F57SWDPB0R", "amount": 1500, "cashTendered": null, "tipAmount": null, "taxAmount": 0, "lineItemPayments": null, "order": { "id": "K94GN4SZT96A4" }, "tender": { "id": "094VZ0686XBP6", "enabled": true, "instructions": null, "visible": true, "labelKey": "com.clover.tender.credit_card", "label": "Credit Card", "opensCashDrawer": false, "editable": false }, "employee": { "id": "7C7NZ76AVRFP4" }, "externalPaymentId": null, "cashbackAmount": null }

As you can see both payments return "result": "SUCCESS" but according to the documentation Case 2 has this possible values.

AUTH
AUTHCOMPLETED
FAIL
INITIATED
SUCCESS
VOID
FAILED
VOIDED
VOIDING

The question is. Should not return the Case 2 "result": "VOIDED"?

10 |2000

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

1 Answer

sam avatar image
sam Deactivated answered sam Deactivated commented

Thanks for bringing this to our attention. At the moment, it looks like "result" captures the payment data immediately after success. You will need to implement additional logic that checks the returned data, grabs the orderId, then check to see that order's payment.

Payment payment = data.getExtras().getParcelable(Intents.EXTRA_PAYMENT);

then

List<Payment> payments = mOrderConnector.getOrder(payment.getOrder().getId()).getPayments();
2 comments
10 |2000

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

Gabriel Fernandez avatar image Gabriel Fernandez commented ·

But i want to make this to avoid using module Orders. My implementation is running on clover under Terminal Plan. May be future update of Sale app could return expected result. Sales app is not changing Payment object returned by SECUREPAYMENTACTION when you press Void Transaction, after payment successful from SUCCESS to VOIDED.

0 Likes 0 ·
sam avatar image sam commented ·

You are able to set Order Read permission without requiring Orders module, allowing merchant is on Terminal (Payment Plus) plan to use your app. The current work-around is to check the resulting payment from the activity using the OrderConnector.

http://pastebin.com/LQvDC4GH

0 Likes 0 ·

Welcome to the
Clover Developer Community