Differences

This shows you the differences between two versions of the page.

Link to this comparison view

sdk:reversal_refunds [2020/05/19 10:18] (current)
branko created
Line 1: Line 1:
 +<​html>​
 +<div class="​block">​
 +    <div class="​blockText"> ​
 +    <h2 class="​code-line"​ data-line-start=14 data-line-end=15><​a id="​Websockets_14"></​a>​Reversal and Refunds</​h2>​
  
 +    <h4 class="​has-line-data"​ data-line-start="​26"​ data-line-end="​28">​Overview</​h4>​
 +        <p class="​has-line-data"​ data-line-start="​15"​ data-line-end="​16">​
 +The SDK is required to handle the situation where a reversal is performed on a transaction with a certain OrderID that may have been used in more than one transaction attempt.
 +Transactions with the same OrderID are not guaranteed to be unique, and are therefore impossible to single out for a reversal on its own.
 +In the event of performing a reversal using the OrderID field, add a timestamp indicating the time transaction occurred in the merchant’s timezone.
 +        </p>
 +  </​div>​
 +  <div class="​blockCode">​
 +    <​h2></​h2>​
 +    <div class="​codeBox">​
 +      <ul>
 +        <li data-lang="​android">​Android</​li>​
 +        <li data-lang="​ios">​IOS</​li>​
 +      </ul>
 +      <div class="​codepanel"​ data-lang="​android">​
 +        <​pre><​code class="​javascript">​
 +CoreSale sale = new CoreSale(CoreUtil.parseStringToBigDecimal("​1.00"​));​
 +sale.setDateTime("​2020-01-01T10:​00:​00"​);​
 +sale.setOrderId("​TEST_ORDER_ID_001"​);​
 +// The dateTime and orderId fields must be stored to be used in the Refund/​Reversal request
 +AndroidTerminal.getInstance().processSale(sale);​
 +
 +</​code>​
 +    </​pre>​
 +      </​div>​
 +      <div class="​codepanel"​ data-lang="​ios">​
 +        <​pre><​code class="​javascript">​
 +CoreSale *sale = [[CoreSale alloc] init];
 +sale.amount = 1.00;
 +sale.orderId = "​TEST_ORDER_ID_001";​
 +sale.dateTime = "​2020-01-01T10:​00:​00";​
 +[[WTPSTerminal singleton] processSale:​sale];​
 +
 +</​code>​
 +    </​pre>​
 +      </​div>​
 +
 +    </​div>​
 +
 +
 +           </​div></​div>​
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +<div class="​block">​
 +  <div class="​blockText">​
 +
 +            <h4 class="​code-line"​ data-line-start=17 data-line-end=18>​Refund Flow</​h4>​
 +         <​p>​For the instances where the UniqueRef is not returned, the refund functionality is updated to allow refunds using OrderId + PreviousTransactionDateTime.</​p>​
 +           <​img src="/​lib/​exe/​fetch.php?​media=refund11111111.png">​
 + 
 +
 +  </​div>​
 +  <div class="​blockCode">​
 +    <​h2></​h2>​
 +    <div class="​codeBox">​
 +      <ul>
 +        <li data-lang="​android">​Android</​li>​
 +        <li data-lang="​ios">​IOS</​li>​
 +      </ul>
 +      <div class="​codepanel"​ data-lang="​android">​
 +        <​pre><​code class="​javascript">​
 +CoreRefund refund = new CoreRefund(BigDecimal.valueOf(0.5),​ "​TEST_ORDER_ID_001"​);​
 +refund.setPreviousTxnDateTime("​2020-01-01T10:​00:​00"​);​
 +AndroidTerminal.getInstance().processRefund(refund);​
 +
 +</​code>​
 +    </​pre>​
 +      </​div>​
 +      <div class="​codepanel"​ data-lang="​ios">​
 +        <​pre><​code class="​javascript">​
 +CoreRefund *refund = [[CoreRefund alloc] init];
 +refund.amount = 0.50;
 +refund.orderId = "​TEST_ORDER_ID_001";​
 +refund.previousTxnDateTime = "​2020-01-01T10:​00:​00";​
 +[[WTPSTerminal singleton] processRefund:​refund];​
 +
 +</​code>​
 +    </​pre>​
 +      </​div>​
 +
 +    </​div>​
 +
 +  </​div>​
 +</​div>​
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +           
 +
 +
 +
 +<div class="​block">​
 +  <div class="​blockText">​
 +            <h4 class="​code-line"​ data-line-start=17 data-line-end=18>​Reversal Flow</​h4>​
 +         <​p>​Reversals on terminals that do not force unique OrderID, now require the new field PreviousTxnDateTime when attempting Reversals using OrderID.
 +Transactions that have been settled between the time the first transaction occurs and the time the Reversal occurs are now Refunded instead of Reversed.</​p>​
 +           <​img src="/​lib/​exe/​fetch.php?​media=reversal.png"></​a>​
 +
 +  </​div>​
 +  <div class="​blockCode">​
 +    <​h2></​h2>​
 +    <div class="​codeBox">​
 +      <ul>
 +        <li data-lang="​android">​Android</​li>​
 +        <li data-lang="​ios">​IOS</​li>​
 +      </ul>
 +      <div class="​codepanel"​ data-lang="​android">​
 +        <​pre><​code class="​javascript">​
 +CoreReversal reversal = new CoreReversal();​
 +reversal.setOrderId("​TEST_ORDER_ID_001"​);​
 +reversal.setPreviousTxnDateTime("​2020-01-01T10:​00:​00"​);​
 +AndroidTerminal.getInstance().processReversal(reversal);​
 +
 +</​code>​
 +    </​pre>​
 +      </​div>​
 +      <div class="​codepanel"​ data-lang="​ios">​
 +        <​pre><​code class="​javascript">​
 +CoreReversal *reversal = [[CoreReversal alloc] init];
 +reversal.orderId = "​TEST_ORDER_ID_001";​
 +reversal.previousTxnDateTime = "​2020-01-01T10:​00:​00";​
 +[[WTPSTerminal singleton] processReversal:​reversal];​
 +
 +</​code>​
 +    </​pre>​
 +      </​div>​
 +
 +    </​div>​
 +
 +  </​div>​
 +</​div>​
 +
 +</​html>​