From 06b34a938fe3ac3e5ecde000d4868f562bcc10a0 Mon Sep 17 00:00:00 2001
From: Kwok He Chu <105217051+Kwok-he-Chu@users.noreply.github.com>
Date: Mon, 16 Oct 2023 15:01:01 +0200
Subject: [PATCH] Rename to 'saleReferenceId' property to 'saleTransactionId'
---
.../Models/PaymentStatusDetails.cs | 9 +++++---
.../Services/PosReversalService.cs | 23 ++++++++++++-------
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/in-person-payments-example/Models/PaymentStatusDetails.cs b/in-person-payments-example/Models/PaymentStatusDetails.cs
index 58331b2..84b9a86 100644
--- a/in-person-payments-example/Models/PaymentStatusDetails.cs
+++ b/in-person-payments-example/Models/PaymentStatusDetails.cs
@@ -15,7 +15,9 @@ public class PaymentStatusDetails
///
/// The POI Transaction Id, populated when a is set to .
- /// Example value: CmI6001693237705007.TG6DVRZ3HVTFWR82.
+ /// Format: "PoiTransactionId.PspReference"
+ /// Example value: "CmI6001693237705007.TG6DVRZ3HVTFWR82" - The second part after the period refers to the PspReference.
+ /// If you abort the transaction, no PspReference is appended after the period, e.g. "CmI6001693237705007".
///
public string PoiTransactionId { get; set; } = null;
@@ -25,8 +27,9 @@ public class PaymentStatusDetails
public DateTime? PoiTransactionTimeStamp { get; set; } = null;
///
- /// The SaleTransactionId (SaleReferenceId), populated when a is set to .
- /// Example value: 6abcb27d-9082-40d9-969d-1c7f283ebd52.
+ /// The SaleTransactionId populated when a is set to .
+ /// This appears as your "MerchantReference" in the customer area.
+ /// Example value: "6abcb27d-9082-40d9-969d-1c7f283ebd52"
///
public string SaleTransactionId { get; set; } = null;
diff --git a/in-person-payments-example/Services/PosReversalService.cs b/in-person-payments-example/Services/PosReversalService.cs
index 2604c41..d6f9719 100644
--- a/in-person-payments-example/Services/PosReversalService.cs
+++ b/in-person-payments-example/Services/PosReversalService.cs
@@ -16,13 +16,13 @@ public interface IPosReversalService
/// For error-scenarios, see: https://docs.adyen.com/point-of-sale/error-scenarios/#error-conditions.
///
/// .
- /// Unique Id of a sale global transaction. Appears as MerchantReference in your Customer Area.
+ /// Unique Id of a sale global transaction. Appears as MerchantReference in your Customer Area.
/// Unique Id of a POI transaction.
/// Your unique ID of the terminal to send this request to. Format: [device model]-[serial number]. Seealso
/// Your unique ID for the POS system (cash register) to send this request from. Seealso .
/// .
/// .
- Task SendReversalRequestAsync(ReversalReasonType reversalReasonType, string saleReferenceId, string poiTransactionId, string poiId, string saleId, CancellationToken cancellationToken = default);
+ Task SendReversalRequestAsync(ReversalReasonType reversalReasonType, string saleTransactionId, string poiTransactionId, string poiId, string saleId, CancellationToken cancellationToken = default);
}
public class PosReversalService : IPosReversalService
@@ -34,13 +34,13 @@ public PosReversalService(IPosPaymentCloudApi posPaymentCloudApi)
_posPaymentCloudApi = posPaymentCloudApi;
}
- public Task SendReversalRequestAsync(ReversalReasonType reversalReasonType, string saleReferenceId, string poiTransactionId, string poiId, string saleId, CancellationToken cancellationToken)
+ public Task SendReversalRequestAsync(ReversalReasonType reversalReasonType, string saleTransactionId, string poiTransactionId, string poiId, string saleId, CancellationToken cancellationToken)
{
- SaleToPOIRequest request = GetReversalRequest(reversalReasonType, saleReferenceId, poiTransactionId, poiId, saleId);
+ SaleToPOIRequest request = GetReversalRequest(reversalReasonType, saleTransactionId, poiTransactionId, poiId, saleId);
return _posPaymentCloudApi.TerminalApiCloudSynchronousAsync(request);
}
- private SaleToPOIRequest GetReversalRequest(ReversalReasonType reversalReasonType, string saleReferenceId, string poiTransactionId, string poiId, string saleId)
+ private SaleToPOIRequest GetReversalRequest(ReversalReasonType reversalReasonType, string saleTransactionId, string poiTransactionId, string poiId, string saleId)
{
SaleToPOIRequest request = new SaleToPOIRequest()
{
@@ -63,10 +63,17 @@ private SaleToPOIRequest GetReversalRequest(ReversalReasonType reversalReasonTyp
{
TimeStamp = DateTime.UtcNow,
TransactionID = poiTransactionId
- }
+ },
},
- ReversalReason = reversalReasonType,
- SaleReferenceID = saleReferenceId
+ SaleData = new SaleData()
+ {
+ SaleTransactionID = new TransactionIdentification()
+ {
+ TimeStamp = DateTime.UtcNow,
+ TransactionID = saleTransactionId
+ }
+ },
+ ReversalReason = reversalReasonType
}
};