Transaction Outcome Field for Surcharge

A new attribute representing surcharge is add to transaction outcome. The following code shows how to retrieve the attributes from different integration platforms.

Code Samples

CWS

<!--
    Field creditSurchargeStatus will be presented in the response for an approved transaction for both EMV and Swipe.
    If creditSurchargeStatus is APPLIED (other possible values are NOT_APPLIED and DECLINED), field creditSurcharge will also be presented.
    The following example is for an EMV transaction.
-->
{
  "requestId" : "1947227770",
  "statusDetails" : "REQUEST_ACCEPTED",
  "data" : {
    "paymentGatewayCommand" : {
      "completed" : true,
      "eventQueue" : [ ],
      "chanId" : "7c332149-ba08-497d-9c7f-ab57792dac1f",
      "paymentTransactionData" : {
        "result" : "APPROVED",
        "authCode" : "******",
        "iccAid" : "A0000000031010",
        "iccAppName" : "Visa Credit",
        "iccMode" : "ICC_MODE",
        "iccTvr" : "80C0008000",
        "iccTsi" : "6800",
        "resultMessage" : "APPLIED",
        "iccCvmr" : "SIGNATURE",
        "date" : "Fri Mar 04 13:21:39 MST 2016",
        "cardEntryType" : "EMV_CONTACT",
        "cardScheme" : "VISA",
        "amount" : {
          "currencyCode" : "USD",
          "value" : 1030
        },
        "creditSurchargeStatus" : "APPLIED",
        "creditSurcharge" : {
          "currencyCode" : "USD",
          "value" : 30
        },
        "id" : "040316A15-F48AB876-9635-4933-B773-136888A3D972",
        "transactionType" : "SALE",
        "approved" : "yes",
        "errors" : [ ],
        "tax" : {
          "currencyCode" : "USD",
          "value" : 200
        },
        "maskedPan" : "******",
        "gratuityAmount" : {
          "currencyCode" : "USD",
          "value" : 300
        },
        "tenderType" : "CARD",
        "balanceDue" : {
          "currencyCode" : "UNKNOWN",
          "value" : 0
        }
      }
    }
  }
}

Java

// Suppose a transaction is complete and the following instance outcome representing the transaction outcome.
ECLTransactionOutcome outcome;
 
// Get the surcharge status. Please look into documentation of ECLSurchargeStatus for available values.
ECLSurchargeStatus surchargeStatus = outcome.getSurchargeStatus();
 
// Get the surcharge amount. Note: surchargeAmount will be null for a transaction not allowing surcharge.
ECLMoney surchargeAmount = outcome.getSurchargeAmount();

Objective-C (iOS)

// Suppose a transaction is complete and the following instance outcome representing the transaction outcome.
ECLTransactionOutcome *outcome;
 
if ([outcome isKindOfClass:[ECLCardTransactionOutcome class]]) {
    ECLCardTransactionOutcome *cardOutcome = (ECLCardTransactionOutcome *)outcome;
 
    // Get the surcharge status. Please look into documentation of ECLSurchargeStatus for available values.
    ECLSurchargeStatus surchargeStatus = cardOutcome.surchargeStatus;
 
    // Get the surcharge amount. Note: creditSurchargeAmount will be nil for a transaction not allowing surcharge.
    ECLMoney *surchargeAmount = cardOutcome.creditSurchargeAmount;
}

C#

// Suppose a sale transaction is approved and the following object paymentData of PaymentTransactionData represents the transaction result
PaymentTransactionData paymentData = paymentResults.PaymentTransactionData;
 
// Get the surcharge status. Available values are APPLIED, NOT_APPLIED and DECLINED.
Log(String.Format("creditSurchargeStatus {0}", paymentData.creditSurchargeStatus));
if (null != paymentData.creditSurcharge)
    Log(String.Format("creditSurcharge {0}", paymentData.creditSurcharge.getAmountInMinorUnits()));