We are using Payment connector to make the Sale payment transaction via the following code:
SaleRequest request = new SaleRequest();
request.setAmount(paymentAmount);
request.setExternalId(ExternalIdUtils.generateNewID()); //value returns in externalPaymentId
request.setOrderId(mOrder.getId());
request.setCardEntryMethods(Intents.CARD_ENTRY_METHOD_ALL);
request.setDisablePrinting(true);
request.setDisableReceiptSelection(true);
request.setDisableDuplicateChecking(true);
request.setTipAmount(getAmountInLong(DEFAULT_TIP));
request.setAllowOfflinePayment(false);
request.setTipMode(TipMode.TIP_PROVIDED);
Map<String, String> extraParam = new HashMap<>();
extraParam.put(Intents.EXTRA_EXTERNAL_REFERENCE_ID, "11111111");
request.setExtras(extraParam);
request.setRequestId("11111111");
paymentConnector.sale(request);
In the SaleResponse we are getting null value for “externalReferenceId” while we are sending the value for it in the SaleRequest with extras.
Can you please suggest a way to find the value in “externalReferenceId” field in the response of payment transactions by using a payment connector?
Also, explain the use of request Id during the transaction. We are sending it with the request but not getting it in the response.
Note: We can get the value for “externalReferenceId” in the response if we will use Intents.ACTION_SECURE_PAY with Intents.EXTRA_EXTERNAL_REFERENCE_ID to make the payment but clover is recommending the Payment connector to make the payment.
Thanks.