Skip to content

Commit

Permalink
Merge pull request #188 from Judopay/JR-8016-DropRegisterCard
Browse files Browse the repository at this point in the history
JR-8016 : Remove IRegisterCards interface and associated code and tests
  • Loading branch information
Stuart-Baillie authored Jul 4, 2024
2 parents 428f0af + 6552bfb commit 62235ba
Show file tree
Hide file tree
Showing 12 changed files with 103 additions and 571 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Change Log
All notable changes to this project will be documented in this file.

## 4.2 Changes on 2024
## 5.0 Changes on 2024-07
- Update Api-Version to 6.21
- Add optional AllowIncrement boolean flag to CardPaymentModel for CIT preAuths that can be incremented before they are fully collected
- Add optional AllowIncrement boolean flag to WebPaymentRequestModel for payment sessions created through JudoPayDotNet.Clients.WebPayments.IPreAuths (should not be specified on IPayments or ICheckCards)
Expand All @@ -11,6 +11,8 @@ All notable changes to this project will be documented in this file.
- Add IsIncrementalAuth to PaymentReceiptMode, true on receipts for call to incrementalAuth endpoint
- Remove DelayedAuthorisation request attribute from PaymentModel and WebPaymentRequestModel, and from the response GetWebPaymentResponseModel (use the new incremental authorisation feature instead)
- Drop issueNumber (no longer exposed as a request attribute on Judo Transaction API)
- Drop IRegisterCards interface - ICheckCard or IPreAuths should be used instead
- Remove RecurringPayment, RecurringPaymentType, RelatedReceiptId from CheckCardModel

## 4.1 Changes on 2023-09
- Update Api-Version to 6.20
Expand Down
21 changes: 0 additions & 21 deletions JudoPayDotNet/Clients/IRegisterCards.cs

This file was deleted.

23 changes: 0 additions & 23 deletions JudoPayDotNet/Clients/RegisterCards.cs

This file was deleted.

5 changes: 0 additions & 5 deletions JudoPayDotNet/IJudoPayApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ public interface IJudoPayApi
/// </summary>
IThreeDs ThreeDs { get; set; }

/// <summary>
/// Enables the developer to register a consumer card
/// </summary>
IRegisterCards RegisterCards { get; set; }

/// <summary>
/// Allows you voids previously authorised transactions (<see cref="PreAuths"/>).
/// </summary>
Expand Down
2 changes: 0 additions & 2 deletions JudoPayDotNet/JudoPayApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class JudoPayApi : IJudoPayApi
public ITransactions Transactions { get; set; }
public ICollections Collections { get; set; }
public IThreeDs ThreeDs { get; set; }
public IRegisterCards RegisterCards { get; set; }
public ISaveCard SaveCards { get; set; }
public IVoids Voids { get; set; }
public Connection Connection { get; }
Expand All @@ -41,7 +40,6 @@ public JudoPayApi(Func<Type, ILog> logger, IClient client)
Transactions = new Transactions(logger(typeof(Transactions)), client);
Collections = new Collections(logger(typeof(Collections)), client);
ThreeDs = new ThreeDs(logger(typeof(ThreeDs)), client);
RegisterCards = new RegisterCards(logger(typeof(RegisterCards)), client, true);
CheckCards = new CheckCards(logger(typeof(CheckCards)), client, true);
SaveCards = new SaveCard(logger(typeof(SaveCard)), client);
Voids = new Voids(logger(typeof(Voids)), client);
Expand Down
2 changes: 1 addition & 1 deletion JudoPayDotNet/JudoPayDotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<PropertyGroup Label="Package">
<PackageId>JudoPay.Net</PackageId>
<Version>4.2</Version>
<Version>5.0</Version>
<Authors>JudoPay</Authors>
<Description>A .Net client for our JudoPay API, allowing you to quickly and easily process payments</Description>
<Copyright>Copyright 2018</Copyright>
Expand Down
100 changes: 98 additions & 2 deletions JudoPayDotNet/Models/CheckCardModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Runtime.Serialization;
using Newtonsoft.Json.Linq;
using System;
using System.Runtime.Serialization;

namespace JudoPayDotNet.Models
{
Expand All @@ -7,8 +9,102 @@ namespace JudoPayDotNet.Models
/// </summary>
[DataContract]
// ReSharper disable UnusedMember.Global
public class CheckCardModel : RegisterCardModel
public class CheckCardModel : SaveCardModel
{
public CheckCardModel()
{
YourPaymentReference = Guid.NewGuid().ToString();
}

/// <summary>
/// Gets or sets the CV2.
/// </summary>
/// <value>
/// The CV2.
/// </value>
public string CV2
{
get => Cv2;
set => Cv2 = value;
}

// This is marked as the DataMember to ensure the expected case is sent to the server API in Json - cv2
[DataMember(IsRequired = false)]
private string Cv2 { get; set; }

/// <summary>
/// Gets your payment reference.
/// </summary>
/// <value>
/// Your payment reference.
/// PLEASE NOTE!!!! there is a reflection call within JudoPayClient.cs that gets this property via a string call. update in both places
/// including other model instances of yourPaymentReference ********************
/// </value>
[DataMember(EmitDefaultValue = false)]
public string YourPaymentReference { get; set; }

/// <summary>
/// Gets or sets the mobile number.
/// </summary>
/// <value>
/// The mobile number.
/// </value>
[DataMember(EmitDefaultValue = false)]
public string MobileNumber { get; set; }

/// <summary>
/// Gets or sets the phone country code.
/// </summary>
/// <value>
/// The phone country code.
/// </value>
[DataMember(EmitDefaultValue = false)]
public string PhoneCountryCode { get; set; }

/// <summary>
/// Gets or sets the email address.
/// </summary>
/// <value>
/// The email address.
/// </value>
[DataMember(EmitDefaultValue = false)]
public string EmailAddress { get; set; }

/// <summary>
/// Is this transaction the first transaction of a series (has continuous authority
/// been granted to the merchant by the card holder).
/// </summary>
/// <remarks>Mastercard requires that when dealing with continuous authority
/// payments this flag identifies the transaction where the card holder gave permission for
/// repeat charges.</remarks>
[DataMember(EmitDefaultValue = false)]
public bool? InitialRecurringPayment { get; set; }

/// <summary>
/// Information needed for ThreeDSecure2 payments
/// </summary>
[DataMember(EmitDefaultValue = false)]
public ThreeDSecureTwoModel ThreeDSecure { get; set; }

/// <summary>
/// This is a set of fraud signals sent by the mobile SDKs
/// </summary>
[DataMember(EmitDefaultValue = false)]
// ReSharper disable once UnusedMember.Global
public JObject ClientDetails { get; set; }

/// <summary>
/// Details needed for MCC 6012 transactions
/// </summary>
[DataMember(EmitDefaultValue = false)]
// ReSharper disable once UnusedMember.Global
public PrimaryAccountDetailsModel PrimaryAccountDetails { get; set; }

/// <summary>
/// Details needed for passing in 3DS2 authentication details performed outside Judopay
/// </summary>
[DataMember(EmitDefaultValue = false)]
public ThreeDSecureMpiModel ThreeDSecureMpi { get; set; }
}
// ReSharper restore UnusedMember.Global
}
132 changes: 0 additions & 132 deletions JudoPayDotNet/Models/RegisterCardModel.cs

This file was deleted.

28 changes: 0 additions & 28 deletions JudoPayDotNetIntegrationTests/IntegrationTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,34 +196,6 @@ protected SaveCardModel GetSaveCardModel(
};
}

protected RegisterCardModel GetRegisterCardModel(
string yourConsumerReference = null,
string cardNumber = "4976000000003436",
string cv2 = "452",
string postCode = "TR14 8PA",
bool? recurringPayment = null,
string judoId = null)
{
if (string.IsNullOrEmpty(yourConsumerReference))
{
yourConsumerReference = Guid.NewGuid().ToString();
}

return new RegisterCardModel
{
YourConsumerReference = yourConsumerReference,
CardNumber = cardNumber,
CV2 = cv2,
ExpiryDate = "12/25",
CardAddress = new CardAddressModel
{
Address1 = "32 Edward Street",
PostCode = postCode,
Town = "Camborne"
}
};
}

protected CheckCardModel GetCheckCardModel(
string judoId = null,
string cardNumber = "4976000000003436",
Expand Down
Loading

0 comments on commit 62235ba

Please sign in to comment.