NET

APM Refund

APM Refund works almost like a card refund.

Edit "APM Refund" on GitHub

The APM refund is almost like a card refund. When calling Refund/RefundAsync the APM-reference need to be supplied. The reference is received in the PaymentRequestResult as APMReference.

The Refund may be on partial amount and the same reference is used if several refunds as long as the total amount of the referenced transaction is above 0.

Refund of APMTransaction with reference from APM transaction result

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  ISwpTrmIf_1 Pax;
  .
  .
  .
  public async Task MakePayment(decimal Amount)
  {
      var result = await Pax.PaymentAsync(Amount);
      if (result.ResponseResult == NexoResponseResult.Success) 
      {
        if (!String.IsNullOrEmpty(result.APMReference)) 
        {
          // this is an APM transaction, save reference in case of refund.
          SaveApmReferenceForRefund(result.APMReference);
          string type = result.APMType;
        }
        .
        .
        .
      }
      PrintReceipt(result.ReceiptBlob);
  }
  public async Task MakeRefund(decimal Amount, string apmReference)
  {
    var result = await Pax.RefundAsync(Amount, apmReference)
    if (result.ResponseResult == NexoRequestResult.Success) {
      . // refund was successful
      .
      .
    }
    else {
      .
      .
      .
    }
    PrintReceipt(result.ReceiptBlob);
  }