-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create PaymentAddressDetails record and add integration test
- Loading branch information
1 parent
afa543c
commit 59e04ea
Showing
5 changed files
with
57 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace Mollie.Api.Models.Payment; | ||
|
||
public record PaymentAddressDetails : AddressObject { | ||
/// <summary> | ||
/// The person’s organization, if applicable. | ||
/// </summary> | ||
public string? OrganizationName { get; set; } | ||
|
||
/// <summary> | ||
/// The title of the person, for example Mr. or Mrs.. | ||
/// </summary> | ||
public string? Title { get; set; } | ||
|
||
/// <summary> | ||
/// The given name (first name) of the person. | ||
/// </summary> | ||
public string? GivenName { get; set; } | ||
|
||
/// <summary> | ||
/// The family name (surname) of the person. | ||
/// </summary> | ||
public string? FamilyName { get; set; } | ||
|
||
/// <summary> | ||
/// The email address of the person. | ||
/// </summary> | ||
public string? Email { get; set; } | ||
|
||
/// <summary> | ||
/// The phone number of the person. Some payment methods require this information. If you have it, you | ||
/// should pass it so that your customer does not have to enter it again in the checkout. Must be in | ||
/// the E.164 format. For example +31208202070. | ||
/// </summary> | ||
public string? Phone { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -363,6 +363,19 @@ public async Task CanCreatePaymentWithCustomMetaDataClass() { | |
[DefaultRetryFact] | ||
public async Task CanCreatePaymentWithLines() { | ||
// Arrange | ||
var address = new PaymentAddressDetails { | ||
Title = "Mr", | ||
GivenName = "John", | ||
FamilyName = "Doe", | ||
OrganizationName = "Mollie", | ||
StreetAndNumber = "Keizersgracht 126", | ||
Email = "[email protected]", | ||
City = "Amsterdam", | ||
Country = "NL", | ||
Phone = "+31600000000", | ||
Region = "Zuid-Holland", | ||
PostalCode = "1015CW" | ||
}; | ||
PaymentRequest paymentRequest = new PaymentRequest() { | ||
Amount = new Amount(Currency.EUR, 90m), | ||
Description = "Description", | ||
|
@@ -382,14 +395,18 @@ public async Task CanCreatePaymentWithLines() { | |
VatAmount = new Amount(Currency.EUR, 15.62m), | ||
VatRate = "21.00" | ||
} | ||
} | ||
}, | ||
ShippingAddress = address, | ||
BillingAddress = address | ||
}; | ||
|
||
// Act | ||
PaymentResponse result = await _paymentClient.CreatePaymentAsync(paymentRequest); | ||
|
||
// Assert | ||
result.Lines.Should().BeEquivalentTo(paymentRequest.Lines); | ||
result.BillingAddress.Should().BeEquivalentTo(paymentRequest.BillingAddress); | ||
result.ShippingAddress.Should().BeEquivalentTo(paymentRequest.ShippingAddress); | ||
} | ||
|
||
[DefaultRetryFact] | ||
|