Skip to content

Commit

Permalink
Merge branch 'development' into feat/improve_paymentrequest_inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
Viincenttt committed Jul 9, 2024
2 parents e26764f + e4af109 commit 855bc11
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@ public CreditCardPaymentRequest(PaymentRequest paymentRequest) : base(paymentReq
Method = PaymentMethod.CreditCard;
}

/// <summary>
/// The card holder�s address details. We advise to provide these details to improve the credit card
/// fraud protection, and thus improve conversion.
/// </summary>
public AddressObject? BillingAddress { get; set; }

/// <summary>
/// The shipping address details. We advise to provide these details to improve the credit card fraud
/// protection, and thus improve conversion.
/// </summary>
public AddressObject? ShippingAddress { get; set; }

/// <summary>
/// The card token you get from Mollie Components. The token contains the card information
/// (such as card holder, card number and expiry date) needed to complete the payment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ public PayPalPaymentRequest(PaymentRequest paymentRequest) : base(paymentRequest
Method = PaymentMethod.PayPal;
}

/// <summary>
/// The shipping address details. We advise to provide these details to improve PayPal�s fraud protection,
/// and thus improve conversion.
/// </summary>
public AddressObject? ShippingAddress { get; set; }

/// <summary>
/// The unique ID you have used for the PayPal fraud library. You should include this if you use PayPal
/// for an on-demand payment. The maximum character length is 32.
Expand Down
22 changes: 11 additions & 11 deletions tests/Mollie.Tests.Unit/Client/PaymentClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -563,15 +563,15 @@ public async Task CreatePaymentAsync_CreditcardPayment_RequestAndResponseAreConv
Method = PaymentMethod.Ideal,
RedirectUrl = "http://www.mollie.com",
WebhookUrl = "http://www.mollie.com/webhook",
BillingAddress = new AddressObject()
BillingAddress = new PaymentAddressDetails()
{
City = "Amsterdam",
Country = "NL",
PostalCode = "1000AA",
Region = "Noord-Holland",
StreetAndNumber = "Keizersgracht 313"
},
ShippingAddress = new AddressObject()
ShippingAddress = new PaymentAddressDetails()
{
City = "Amsterdam",
Country = "NL",
Expand All @@ -582,6 +582,14 @@ public async Task CreatePaymentAsync_CreditcardPayment_RequestAndResponseAreConv
CardToken = "card-token"
};
const string jsonRequest = @"{
""cardToken"": ""card-token"",
""amount"": {
""currency"": ""EUR"",
""value"": ""100.00""
},
""description"": ""Description"",
""redirectUrl"": ""http://www.mollie.com"",
""webhookUrl"": ""http://www.mollie.com/webhook"",
""billingAddress"": {
""streetAndNumber"": ""Keizersgracht 313"",
""postalCode"": ""1000AA"",
Expand All @@ -596,14 +604,6 @@ public async Task CreatePaymentAsync_CreditcardPayment_RequestAndResponseAreConv
""region"": ""Noord-Holland"",
""country"": ""NL""
},
""cardToken"": ""card-token"",
""amount"": {
""currency"": ""EUR"",
""value"": ""100.00""
},
""description"": ""Description"",
""redirectUrl"": ""http://www.mollie.com"",
""webhookUrl"": ""http://www.mollie.com/webhook"",
""method"": [
""ideal""
]
Expand Down Expand Up @@ -636,7 +636,7 @@ public async Task CreatePaymentAsync_CreditcardPayment_RequestAndResponseAreConv
}";
var mockHttp = CreateMockHttpMessageHandler(HttpMethod.Post, $"{BaseMollieClient.ApiEndPoint}payments", jsonResponse, jsonRequest);
HttpClient httpClient = mockHttp.ToHttpClient();
PaymentClient paymentClient = new PaymentClient("abcde", httpClient);
PaymentClient paymentClient = new("abcde", httpClient);

// When: We send the request
var result = await paymentClient.CreatePaymentAsync(paymentRequest);
Expand Down

0 comments on commit 855bc11

Please sign in to comment.