Skip to content

Commit

Permalink
Add missing point PointOfSalePaymentResponseDetails properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Viincenttt committed Mar 29, 2024
1 parent 9e892da commit 98ae45f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,47 @@
namespace Mollie.Api.Models.Payment.Response.Specific {
public class PointOfSalePaymentResponse : PaymentResponse {
/// <summary>
/// An object with payment details.
/// </summary>
public PointOfSalePaymentResponseDetails Details { get; set; }
}

public class PointOfSalePaymentResponseDetails {
/// <summary>
/// The identifier referring to the terminal this payment was created for. For example, term_utGtYu756h.
/// </summary>
public string TerminalId { get; set; }

/// <summary>
/// Only available if the payment has been completed - The last four digits of the card number.
/// </summary>
public string CardNumber { get; set; }

/// <summary>
/// Only available if the payment has been completed - Unique alphanumeric representation of card, usable for
/// identifying returning customers.
/// </summary>
public string CardFingerprint { get; set; }

/// <summary>
/// Only available if the payment has been completed and if the data is available - The card’s target audience.
///
/// Check the Mollie.Api.Models.Payment.Response.CreditCardAudience class for a full list of known values.
/// </summary>
public string CardAudience { get; set; }

/// <summary>
/// Only available if the payment has been completed - The card’s label. Note that not all labels can be
/// processed through Mollie.
///
/// Check the Mollie.Api.Models.Payment.Response.CreditCardLabel class for a full list of known values.
/// </summary>
public string CardLabel { get; set; }

/// <summary>
/// Only available if the payment has been completed - The ISO 3166-1 alpha-2 country code of the country
/// the card was issued in. For example: BE.
/// </summary>
public string CardCountryCode { get; set; }
}
}
5 changes: 5 additions & 0 deletions tests/Mollie.Tests.Integration/Api/PaymentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@ public async Task CanCreatePointOfSalePayment() {
response.Should().BeOfType<PointOfSalePaymentResponse>();
PointOfSalePaymentResponse posResponse = (PointOfSalePaymentResponse)response;
posResponse.Details.TerminalId.Should().Be(paymentRequest.TerminalId);
posResponse.Details.CardNumber.Should().BeNull();
posResponse.Details.CardFingerprint.Should().BeNull();
posResponse.Details.CardAudience.Should().BeNull();
posResponse.Details.CardLabel.Should().BeNull();
posResponse.Details.CardCountryCode.Should().BeNull();
posResponse.Method.Should().Be(PaymentMethod.PointOfSale);
}
}
Expand Down

0 comments on commit 98ae45f

Please sign in to comment.