Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwok He Chu committed Jul 13, 2023
1 parent bafa04f commit 57f9c51
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 146 deletions.
22 changes: 3 additions & 19 deletions authorisation-adjustment-example/Models/HotelPaymentModel.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Text;
using System.Collections.Generic;

namespace adyen_dotnet_authorisation_adjustment_example.Models
{
public class BookingPaymentModel
public class HotelPaymentModel
{
// PspReference provided by Adyen.
public string PspReference { get; set; }
Expand All @@ -19,27 +19,11 @@ public class BookingPaymentModel
public string Currency { get; set; }

// Result.
public string ResultCode { get; set; } // ResultCode == Authorised.
public string ResultCode { get; set; }
public string RefusalReason { get; set; } // Populated when resultcode is not authorised.

// Payment method used.
public string PaymentMethodBrand { get; set; } // PaymentMethod brand (e.g. `mc`).
public string PaymentMethodType { get; set; } // PaymentMethod type (e.g. `scheme`).

// Override for outputting purposes.
public override string ToString()
{
var sb = new StringBuilder();
sb.AppendLine($"{nameof(PspReference)}: {PspReference}");
sb.AppendLine($"{nameof(Reference)}: {Reference}");
sb.AppendLine($"{nameof(DateTime)}: {DateTime}");
sb.AppendLine($"{nameof(Amount)}: {Amount}");
sb.AppendLine($"{nameof(Currency)}: {Currency}");
sb.AppendLine($"{nameof(ResultCode)}: {ResultCode}");
sb.AppendLine($"{nameof(RefusalReason)}: {RefusalReason}");
sb.AppendLine($"{nameof(PaymentMethodBrand)}: {PaymentMethodBrand}");
sb.AppendLine($"{nameof(PaymentMethodType)}: {PaymentMethodType}");
return sb.ToString();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ namespace adyen_dotnet_authorisation_adjustment_example.Repositories
public interface IHotelPaymentRepository
{
ConcurrentDictionary<string, HotelPaymentModel> HotelPayments { get; }

bool Remove(string pspReference);

bool Upsert(HotelPaymentModel hotelPayment);
}
Expand All @@ -24,11 +22,6 @@ public HotelPaymentRepository()
HotelPayments = new ConcurrentDictionary<string, HotelPaymentModel>();
}

public bool Remove(string pspReference)
{
return HotelPayments.TryRemove(pspReference, out var _);
}

public bool Upsert(HotelPaymentModel hotelPayment)
{
return HotelPayments.TryAdd(hotelPayment.PspReference, hotelPayment);
Expand Down

This file was deleted.

0 comments on commit 57f9c51

Please sign in to comment.