Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing point PointOfSalePaymentResponseDetails properties #348

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading