Skip to content

Commit

Permalink
Adjusting year in license
Browse files Browse the repository at this point in the history
  • Loading branch information
delias-silva committed Feb 11, 2021
1 parent 60d548b commit d70495f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 24 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 MercadoPago Developers
Copyright (c) 2021 MercadoPago Developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 6 additions & 6 deletions MercadoPagoSDK.Test/Helpers/CardHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ namespace MercadoPagoSDK.Test.Helpers
{
public static class CardHelper
{
public static string SingleUseCardToken(string PublicKey, string Status)
public static string SingleUseCardToken(string Status)
{
JObject payload = JObject.Parse(CardDummyWithSpecificStatus(Status));

MPRESTClient client = new MPRESTClient();
String path = "https://api.mercadopago.com/v1/card_tokens?public_key=" + PublicKey;
String path = "https://api.mercadopago.com/v1/card_tokens";
MPAPIResponse responseCardToken = client.ExecuteRequest(HttpMethod.POST, path, PayloadType.JSON, payload, null, 0, 1);

JObject jsonResponse = JObject.Parse(responseCardToken.StringResponse.ToString());
Expand All @@ -36,17 +36,17 @@ public static string CardDummyWithSpecificStatus(string status)
};

string StringPayload = "{ " +
"\"card_number\": \"4508336715544174\", " +
"\"security_code\": \"122\", " +
"\"card_number\": \"5031433215406351\", " +
"\"security_code\": \"123\", " +
"\"expiration_month\": \"7\", " +
"\"expiration_year\": \"2030\", " +
"\"cardholder\": " +
"{ " +
"\"name\": \"" + CardsNameForStatus[status] + "\", " +
"\"identification\": " +
"{ " +
"\"type\": \"DNI\", " +
"\"number\": \"12345678\" " +
"\"type\": \"CPF\", " +
"\"number\": \"37462770865\" " +
"} " +
"} " +
"}";
Expand Down
12 changes: 4 additions & 8 deletions MercadoPagoSDK.Test/Resources/AdvancedPaymentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
using System.Linq;
using System.Threading;
using MercadoPago.Resources;
using MercadoPagoSDK.Test.Helpers;
using NUnit.Framework;
using AdvPayDS = MercadoPago.DataStructures.AdvancedPayment;

namespace MercadoPagoSDK.Test.Resources
{
[TestFixture(Ignore = "Skipping")]
public class AdvancedPaymentTest : BaseResourceTest
{
[Test]
Expand Down Expand Up @@ -115,13 +117,7 @@ public void AdvancedPaymentSearchTest()

private static AdvancedPayment NewAdvancedPayment(bool capture)
{
var cardToken = new CardToken
{
CardId = "8940397939",
CustomerId = "649457098-FybpOkG6zH8QRm",
SecurityCode = "123",
};
cardToken.Save();
string token = CardHelper.SingleUseCardToken("approved");

return new AdvancedPayment
{
Expand All @@ -132,7 +128,7 @@ private static AdvancedPayment NewAdvancedPayment(bool capture)
{
PaymentMethodId = "master",
PaymentTypeId = "credit_card",
Token = cardToken.Id,
Token = token,
DateOfExpiration = DateTime.UtcNow.Add(TimeSpan.FromDays(120)),
TransactionAmount = 1000,
Installments = 1,
Expand Down
11 changes: 3 additions & 8 deletions MercadoPagoSDK.Test/Resources/PaymentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using MercadoPago.Common;
using MercadoPago.DataStructures.Payment;
using MercadoPago.Resources;
using MercadoPagoSDK.Test.Helpers;
using Newtonsoft.Json.Linq;
using NUnit.Framework;

Expand Down Expand Up @@ -227,13 +228,7 @@ public void PaymentCreateErrorTest()

private static Payment NewPayment(bool capture)
{
var cardToken = new CardToken
{
CardId = "8940397939",
CustomerId = "649457098-FybpOkG6zH8QRm",
SecurityCode = "123",
};
cardToken.Save();
string token = CardHelper.SingleUseCardToken("approved");

return new Payment
{
Expand Down Expand Up @@ -262,7 +257,7 @@ private static Payment NewPayment(bool capture)
},
TransactionAmount = 10,
//PaymentMethodId = "master",
Token = cardToken.Id,
Token = token,
Installments = 1,
StatementDescriptor = "STAT-DESC",
NotificationUrl = "https://seu-site.com.br/webhooks",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ If you require technical support, please contact our support team at [developers
## 🏻 License

```
MIT license. Copyright (c) 2018 - Mercado Pago / Mercado Libre
MIT license. Copyright (c) 2021 - Mercado Pago / Mercado Libre
For more information, see the LICENSE file.
```

0 comments on commit d70495f

Please sign in to comment.