diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 36f3e851..35c78962 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -19,7 +19,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v1 with: - dotnet-version: '5.0.x' + dotnet-version: '6.0.x' - name: Publish on NuGet id: publish_nuget diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 20e80113..41e885d7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,7 +18,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v1 with: - dotnet-version: '5.0.x' + dotnet-version: '6.0.x' # Build - name: Install dependencies @@ -32,7 +32,7 @@ jobs: run: dotnet restore src/MercadoPago.Tests/MercadoPago.Tests.csproj - name: Run tests - run: dotnet test src/MercadoPago.Tests/MercadoPago.Tests.csproj -f net5.0 --configuration Release --no-restore + run: dotnet test src/MercadoPago.Tests/MercadoPago.Tests.csproj -f net6.0 --configuration Release --no-restore env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} USER_EMAIL: ${{ secrets.USER_EMAIL }} diff --git a/.gitignore b/.gitignore index 7c902de6..c53e271e 100644 --- a/.gitignore +++ b/.gitignore @@ -117,6 +117,7 @@ ClientBin/ *.publishsettings node_modules/ orleans.codegen.cs +samples # Microsoft Fakes FakesAssemblies/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..5e605511 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +repos: + # Websec hook is MANDATORY, DO NOT comment it. + - repo: https://github.com/melisource/fury_websec-git-hooks + rev: v1.1.0 + hooks: + - id: pre_commit_hook + stages: [commit] + - id: post_commit_hook + stages: [post-commit] + + # Datasec hook is MANDATORY, DO NOT comment it. + - repo: https://github.com/melisource/fury_datasec-git-hooks + rev: 1.0.3 + hooks: + - id: pre_commit_hook + stages: [commit] + verbose: true diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..3c407670 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Releases + +## VERSION 2.4.0 +- Require .NET Framework 6.0 as minimum version. +- Avoid rethrowing exception that changes stack trace information. +- Add pre-commit. +- Add CHANGELOG file. diff --git a/README.es.md b/README.es.md index e0c0ea1f..1dd04997 100644 --- a/README.es.md +++ b/README.es.md @@ -11,7 +11,7 @@ El SDK oficial de Mercado Pago. ## 💡 Requisitos -**.NET Standard 2.0+**, **.NET Core 2.0+**, y **.NET Framework 4.6.1+**. +**.NET Standard 2.1+**, **.NET Core 2.0+**, y **.NET Framework 6.0+**. Si estás utilizando versiones anteriores del .NET Framework en tu proyecto, consulta las [versiones anteriores](https://github.com/mercadopago/sdk-dotnet/tree/master-dotnet-framework) del SDK. @@ -146,7 +146,7 @@ Todas las contribuciones son bienvenidas, desde personas que deseen filtrar las Lea y siga nuestras [pautas de contribución](CONTRIBUTING.md). Las contribuciones que no sigan estas pautas no se tendrán en cuenta. Las pautas están establecidas para hacernos la vida más fácil y hacer que la contribución sea un proceso consistente para todos. -## ❤️ Support +## ❤️ Soporte Si necesitas asistencia técnica, póngase en contacto con nuestro equipo de asistencia en [developers.mercadopago.com](https://developers.mercadopago.com). diff --git a/README.md b/README.md index aed77012..b1d5cc44 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The official Mercado Pago .NET SDK. ## 💡 Requirements -**.NET Standard 2.0+**, **.NET Core 2.0+**, and **.NET Framework 4.6.1+**. +**.NET Standard 2.1+**, **.NET Core 2.0+**, and **.NET Framework 6.0+**. If you are using previous versions of .NET Framework in your project, please refer to the [older versions](https://github.com/mercadopago/sdk-dotnet/tree/master-dotnet-framework) of the SDK. diff --git a/README.pt.md b/README.pt.md index 35de0aa4..94271336 100644 --- a/README.pt.md +++ b/README.pt.md @@ -11,7 +11,7 @@ O SDK oficial do Mercado Pago. ## 💡 Requisitos -**.NET Standard 2.0+**, **.NET Core 2.0+**, e **.NET Framework 4.6.1+**. +**.NET Standard 2.1+**, **.NET Core 2.0+**, e **.NET Framework 6.0+**. Se você estiver usando versões anteriores do .NET Framework em seu projeto, consulte as [versões mais antigas](https://github.com/mercadopago/sdk-dotnet/tree/master-dotnet-framework) do SDK. @@ -146,7 +146,7 @@ Todas as contribuições são bem-vindas, desde pessoas que desejam fazer a tria Por favor, leia e siga nossas [diretrizes de contribuição](CONTRIBUTING.md). As contribuições que não seguirem essas diretrizes serão desconsideradas. As diretrizes existem para facilitar todas as nossas vidas e tornar a contribuição um processo consistente para todos. -## ❤️ Soporte +## ❤️ Suporte Se você necessita de suporte técnico, por favor entre em contato com nosso time de suporte em [developers.mercadopago.com](https://developers.mercadopago.com) diff --git a/docfx.json b/docfx.json index 11e041a2..52b1a188 100644 --- a/docfx.json +++ b/docfx.json @@ -1,41 +1,41 @@ { - "metadata": [ + "metadata": [ + { + "src": [ { - "src": [ - { - "files": [ "MercadoPago/MercadoPago.csproj" ], - "exclude": [ "**/bin/**", "**/obj/**" ], - "src": "src" - } - ], - "dest": "obj/sdk", - "properties": { - "TargetFramework": "netcoreapp3.1" - } + "files": ["MercadoPago/MercadoPago.csproj"], + "exclude": ["**/bin/**", "**/obj/**"], + "src": "src" } - ], - "build": { - "content": [ - { - "files": [ "**/*.yml" ], - "src": "obj/sdk", - "dest": "sdk" - }, - { - "files": [ "*.md", "toc.yml" ] - }, - { - "files": [ "*.md" ], - "src": ".github/ISSUE_TEMPLATE" - } - ], - "globalMetadata": { - "_appTitle": "MercadoPago official .NET SDK", - "_enableSearch": true - }, - "template": ["statictoc"], - "markdownEngineName": "markdig", - "dest": "docs", - "xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ] + ], + "dest": "obj/sdk", + "properties": { + "TargetFramework": "net6.0" + } } -} \ No newline at end of file + ], + "build": { + "content": [ + { + "files": ["**/*.yml"], + "src": "obj/sdk", + "dest": "sdk" + }, + { + "files": ["*.md", "toc.yml"] + }, + { + "files": ["*.md"], + "src": ".github/ISSUE_TEMPLATE" + } + ], + "globalMetadata": { + "_appTitle": "MercadoPago official .NET SDK", + "_enableSearch": true + }, + "template": ["statictoc"], + "markdownEngineName": "markdig", + "dest": "docs", + "xrefService": ["https://xref.docs.microsoft.com/query?uid={uid}"] + } +} diff --git a/docs/README.es.html b/docs/README.es.html index 373b4fbf..4b3d1d5b 100644 --- a/docs/README.es.html +++ b/docs/README.es.html @@ -1,84 +1,84 @@ - - - - - - - - Mercado Pago .Net | MercadoPago official .NET SDK - - - - - - - - - - - - - - - -
-
- - - - -
-
- -
-
Search Results for
-
-

-
-
    -
    -
    - + + +
    + + + + + + diff --git a/docs/README.html b/docs/README.html index 6bb54566..847297f8 100644 --- a/docs/README.html +++ b/docs/README.html @@ -1,84 +1,84 @@ - - - - - - - - Mercado Pago .Net | MercadoPago official .NET SDK - - - - - - - - - - - - - - - -
    -
    - - - - -
    -
    - -
    -
    Search Results for
    -
    -

    -
    -
      -
      -
      - + + +
      + + + + + + diff --git a/docs/README.pt.html b/docs/README.pt.html index 7cb43323..8d40cc80 100644 --- a/docs/README.pt.html +++ b/docs/README.pt.html @@ -1,84 +1,84 @@ - - - - - - - - Mercado Pago .Net | MercadoPago official .NET SDK - - - - - - - - - - - - - - - -
      -
      - - - - -
      -
      - -
      -
      Search Results for
      -
      -

      -
      -
        -
        -
        - + + +
        + + + + + + diff --git a/docs/index.html b/docs/index.html index 58a6d668..7142d22a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,84 +1,84 @@ - - - - - - - - Mercado Pago .Net | MercadoPago official .NET SDK - - - - - - - - - - - - - - - -
        -
        - - - - -
        -
        - -
        -
        Search Results for
        -
        -

        -
        -
          -
          -
          - + + +
          + + + + + + diff --git a/docs/index.json b/docs/index.json index 8b44aade..45922078 100644 --- a/docs/index.json +++ b/docs/index.json @@ -27,22 +27,22 @@ "index.html": { "href": "index.html", "title": "Mercado Pago .Net | MercadoPago official .NET SDK", - "keywords": "Mercado Pago .Net Portuguese / Spanish The official Mercado Pago .NET SDK. 💡 Requirements .NET Standard 2.0+ , .NET Core 2.0+ , and .NET Framework 4.6.1+ . If you are using previous versions of .NET Framework in your project, please refer to the older versions of the SDK. 📲 Installation Using the .NET Core command-line interface (CLI) tools dotnet add package mercadopago-sdk Using the NuGet Command Line Interface (CLI) nuget install mercadopago-sdk Using the Package Manager Install-Package mercadopago-sdk From Visual Studio Open the Solution Explorer . Right-click on a project within your solution. Click on Manage NuGet Packages... . Click on the Browse tab and search for \"mercadopago-sdk\". Click on the mercadopago-sdk package, select the appropriate version and click Install. 🌟 Getting Started First time using Mercado Pago? Create your Mercado Pago account . Copy your Access Token in the credentials panel and replace the text YOUR_ACCESS_TOKEN with it. Simple usage To generate a card token read the Checkout API documentation. using System; using System.Threading.Tasks; using MercadoPago.Client.Payment; using MercadoPago.Config; using MercadoPago.Resource.Payment; MercadoPagoConfig.AccessToken = \"YOUR_ACCESS_TOKEN\"; var request = new PaymentCreateRequest { TransactionAmount = 10, Token = \"CARD_TOKEN\", Description = \"Payment description\", Installments = 1, PaymentMethodId = \"visa\", Payer = new PaymentPayerRequest { Email = \"test.payer@email.com\", } }; var client = new PaymentClient(); Payment payment = await client.CreateAsync(request); Console.WriteLine($\"Payment ID: {payment.Id}\"); Per-request configuration All methods that make API calls accept an optional RequestOptions object. This can be used to configure some special options of the request, such as changing credentials or custom headers. using MercadoPago.Client; var requestOptions = new RequestOptions(); requestOptions.AccessToken = \"YOUR_ACCESS_TOKEN\"; // ... var client = new PaymentClient(); Payment payment = await client.CreateAsync(request, requestOptions); Advanced usage Using a proxy server using System.Net; using System.Net.Http; using MercadoPago.Config; using MercadoPago.Http; var handler = new HttpClientHandler { Proxy = new WebProxy(proxyUrl), UseProxy = true, }; var httpClient = new HttpClient(handler); MercadoPagoConfig.HttpClient = new DefaultHttpClient(httpClient); Configuring automatic retries The SDK automatically retries requests on intermittent failures. The default max number of attempts is 2 . using MercadoPago.Config; using MercadoPago.Http; var retryStrategy = new DefaultRetryStrategy(5); MercadoPagoConfig.RetryStrategy = retryStrategy; 📚 Documentation Visit our Developer Site for further information regarding: APIs Checkout Pro Checkout API Web Tokenize Checkout Check our SDK docs to explore all available functionalities. 🤝 Contributing All contributions are welcome, ranging from people wanting to triage issues, others wanting to write documentation, to people wanting to contribute code. Please read and follow our contribution guidelines . Contributions not following this guidelines will be disregarded. The guidelines are in place to make all of our lives easier and make contribution a consistent process for everyone. ❤️ Support If you require technical support, please contact our support team at developers.mercadopago.com . 🏻 License MIT license. Copyright (c) 2021 - Mercado Pago / Mercado Libre For more information, see the LICENSE file." + "keywords": "Mercado Pago .Net Portuguese / Spanish The official Mercado Pago .NET SDK. 💡 Requirements .NET Standard 2.1+ , .NET Core 2.0+ , and .NET Framework 6.0+ . If you are using previous versions of .NET Framework in your project, please refer to the older versions of the SDK. 📲 Installation Using the .NET Core command-line interface (CLI) tools dotnet add package mercadopago-sdk Using the NuGet Command Line Interface (CLI) nuget install mercadopago-sdk Using the Package Manager Install-Package mercadopago-sdk From Visual Studio Open the Solution Explorer . Right-click on a project within your solution. Click on Manage NuGet Packages... . Click on the Browse tab and search for \"mercadopago-sdk\". Click on the mercadopago-sdk package, select the appropriate version and click Install. 🌟 Getting Started First time using Mercado Pago? Create your Mercado Pago account . Copy your Access Token in the credentials panel and replace the text YOUR_ACCESS_TOKEN with it. Simple usage To generate a card token read the Checkout API documentation. using System; using System.Threading.Tasks; using MercadoPago.Client.Payment; using MercadoPago.Config; using MercadoPago.Resource.Payment; MercadoPagoConfig.AccessToken = \"YOUR_ACCESS_TOKEN\"; var request = new PaymentCreateRequest { TransactionAmount = 10, Token = \"CARD_TOKEN\", Description = \"Payment description\", Installments = 1, PaymentMethodId = \"visa\", Payer = new PaymentPayerRequest { Email = \"test.payer@email.com\", } }; var client = new PaymentClient(); Payment payment = await client.CreateAsync(request); Console.WriteLine($\"Payment ID: {payment.Id}\"); Per-request configuration All methods that make API calls accept an optional RequestOptions object. This can be used to configure some special options of the request, such as changing credentials or custom headers. using MercadoPago.Client; var requestOptions = new RequestOptions(); requestOptions.AccessToken = \"YOUR_ACCESS_TOKEN\"; // ... var client = new PaymentClient(); Payment payment = await client.CreateAsync(request, requestOptions); Advanced usage Using a proxy server using System.Net; using System.Net.Http; using MercadoPago.Config; using MercadoPago.Http; var handler = new HttpClientHandler { Proxy = new WebProxy(proxyUrl), UseProxy = true, }; var httpClient = new HttpClient(handler); MercadoPagoConfig.HttpClient = new DefaultHttpClient(httpClient); Configuring automatic retries The SDK automatically retries requests on intermittent failures. The default max number of attempts is 2 . using MercadoPago.Config; using MercadoPago.Http; var retryStrategy = new DefaultRetryStrategy(5); MercadoPagoConfig.RetryStrategy = retryStrategy; 📚 Documentation Visit our Developer Site for further information regarding: APIs Checkout Pro Checkout API Web Tokenize Checkout Check our SDK docs to explore all available functionalities. 🤝 Contributing All contributions are welcome, ranging from people wanting to triage issues, others wanting to write documentation, to people wanting to contribute code. Please read and follow our contribution guidelines . Contributions not following this guidelines will be disregarded. The guidelines are in place to make all of our lives easier and make contribution a consistent process for everyone. ❤️ Support If you require technical support, please contact our support team at developers.mercadopago.com . 🏻 License MIT license. Copyright (c) 2021 - Mercado Pago / Mercado Libre For more information, see the LICENSE file." }, "README.es.html": { "href": "README.es.html", "title": "Mercado Pago .Net | MercadoPago official .NET SDK", - "keywords": "Mercado Pago .Net Inglês / Portugues El SDK oficial de Mercado Pago. 💡 Requisitos .NET Standard 2.0+ , .NET Core 2.0+ , y .NET Framework 4.6.1+ . Si estás utilizando versiones anteriores del .NET Framework en tu proyecto, consulta las versiones anteriores del SDK. 📲 Instalación Usando el .NET Core command-line interface (CLI) tools dotnet add package mercadopago-sdk Usando el NuGet Command Line Interface (CLI) nuget install mercadopago-sdk Usando el Package Manager Install-Package mercadopago-sdk En el Visual Studio Abra el Solution Explorer . Haga clic con el botón derecho en un proyecto de su solución. Haga clic en Manage NuGet Packages... . Haga clic en la tab Browse y busque \"mercadopago-sdk\". Haga clic en el package mercadopago-sdk , seleccione la versión apropiada y haga clic en Install . 🌟 Empezando ¿Primera vez usando Mercado Pago? Crea tu cuenta de Mercado Pago . Copie su Access Token del panel de credenciales y reemplace el texto YOUR_ACCESS_TOKEN con él. Uso simple Para generar un card token lea la documentación del Checkout Transparente . using System; using System.Threading.Tasks; using MercadoPago.Client.Payment; using MercadoPago.Config; using MercadoPago.Resource.Payment; MercadoPagoConfig.AccessToken = \"YOUR_ACCESS_TOKEN\"; var request = new PaymentCreateRequest { TransactionAmount = 10, Token = \"CARD_TOKEN\", Description = \"Payment description\", Installments = 1, PaymentMethodId = \"visa\", Payer = new PaymentPayerRequest { Email = \"test.payer@email.com\", } }; var client = new PaymentClient(); Payment payment = await client.CreateAsync(request); Console.WriteLine($\"Payment ID: {payment.Id}\"); Configuración por solicitud Todos los métodos de los que realizan llamadas a APIs aceptan un objeto RequestOptions opcional. Esto puede ser utilizado para configurar algunas opciones especiales de la solicitud, como el propio cambio de credenciales o headers presonalizados. using MercadoPago.Client; var requestOptions = new RequestOptions(); requestOptions.AccessToken = \"YOUR_ACCESS_TOKEN\"; // ... var client = new PaymentClient(); Payment payment = await client.CreateAsync(request, requestOptions); Uso avanzado Usar un servidor proxy using System.Net; using System.Net.Http; using MercadoPago.Config; using MercadoPago.Http; var handler = new HttpClientHandler { Proxy = new WebProxy(proxyUrl), UseProxy = true, }; var httpClient = new HttpClient(handler); MercadoPagoConfig.HttpClient = new DefaultHttpClient(httpClient); Configurar reintentos automáticos El SDK reintenta automáticamente las solicitudes en caso de fallas intermitentes. El número máximo de intentos default es 2 . using MercadoPago.Config; using MercadoPago.Http; var retryStrategy = new DefaultRetryStrategy(5); MercadoPagoConfig.RetryStrategy = retryStrategy; 📚 Documentación Visite nuestro Developer Site para obtener más información sobre: APIs Checkout Pro Checkout Transparente Web Tokenize Checkout Consulte nuestro SDK docs para explorar todas las funciones disponibles. 🤝 Contribuyendo Todas las contribuciones son bienvenidas, desde personas que deseen filtrar las issues, otras que quieran escribir documentación, hasta personas que quieran contribuir con código. Lea y siga nuestras pautas de contribución . Las contribuciones que no sigan estas pautas no se tendrán en cuenta. Las pautas están establecidas para hacernos la vida más fácil y hacer que la contribución sea un proceso consistente para todos. ❤️ Support Si necesitas asistencia técnica, póngase en contacto con nuestro equipo de asistencia en developers.mercadopago.com . 🏻 Licencia MIT license. Copyright (c) 2021 - Mercado Pago / Mercado Libre Para obtener más información, consulte el archivo LICENSE." + "keywords": "Mercado Pago .Net Inglês / Portugues El SDK oficial de Mercado Pago. 💡 Requisitos .NET Standard 2.1+ , .NET Core 2.0+ , y .NET Framework 6.0+ . Si estás utilizando versiones anteriores del .NET Framework en tu proyecto, consulta las versiones anteriores del SDK. 📲 Instalación Usando el .NET Core command-line interface (CLI) tools dotnet add package mercadopago-sdk Usando el NuGet Command Line Interface (CLI) nuget install mercadopago-sdk Usando el Package Manager Install-Package mercadopago-sdk En el Visual Studio Abra el Solution Explorer . Haga clic con el botón derecho en un proyecto de su solución. Haga clic en Manage NuGet Packages... . Haga clic en la tab Browse y busque \"mercadopago-sdk\". Haga clic en el package mercadopago-sdk , seleccione la versión apropiada y haga clic en Install . 🌟 Empezando ¿Primera vez usando Mercado Pago? Crea tu cuenta de Mercado Pago . Copie su Access Token del panel de credenciales y reemplace el texto YOUR_ACCESS_TOKEN con él. Uso simple Para generar un card token lea la documentación del Checkout Transparente . using System; using System.Threading.Tasks; using MercadoPago.Client.Payment; using MercadoPago.Config; using MercadoPago.Resource.Payment; MercadoPagoConfig.AccessToken = \"YOUR_ACCESS_TOKEN\"; var request = new PaymentCreateRequest { TransactionAmount = 10, Token = \"CARD_TOKEN\", Description = \"Payment description\", Installments = 1, PaymentMethodId = \"visa\", Payer = new PaymentPayerRequest { Email = \"test.payer@email.com\", } }; var client = new PaymentClient(); Payment payment = await client.CreateAsync(request); Console.WriteLine($\"Payment ID: {payment.Id}\"); Configuración por solicitud Todos los métodos de los que realizan llamadas a APIs aceptan un objeto RequestOptions opcional. Esto puede ser utilizado para configurar algunas opciones especiales de la solicitud, como el propio cambio de credenciales o headers presonalizados. using MercadoPago.Client; var requestOptions = new RequestOptions(); requestOptions.AccessToken = \"YOUR_ACCESS_TOKEN\"; // ... var client = new PaymentClient(); Payment payment = await client.CreateAsync(request, requestOptions); Uso avanzado Usar un servidor proxy using System.Net; using System.Net.Http; using MercadoPago.Config; using MercadoPago.Http; var handler = new HttpClientHandler { Proxy = new WebProxy(proxyUrl), UseProxy = true, }; var httpClient = new HttpClient(handler); MercadoPagoConfig.HttpClient = new DefaultHttpClient(httpClient); Configurar reintentos automáticos El SDK reintenta automáticamente las solicitudes en caso de fallas intermitentes. El número máximo de intentos default es 2 . using MercadoPago.Config; using MercadoPago.Http; var retryStrategy = new DefaultRetryStrategy(5); MercadoPagoConfig.RetryStrategy = retryStrategy; 📚 Documentación Visite nuestro Developer Site para obtener más información sobre: APIs Checkout Pro Checkout Transparente Web Tokenize Checkout Consulte nuestro SDK docs para explorar todas las funciones disponibles. 🤝 Contribuyendo Todas las contribuciones son bienvenidas, desde personas que deseen filtrar las issues, otras que quieran escribir documentación, hasta personas que quieran contribuir con código. Lea y siga nuestras pautas de contribución . Las contribuciones que no sigan estas pautas no se tendrán en cuenta. Las pautas están establecidas para hacernos la vida más fácil y hacer que la contribución sea un proceso consistente para todos. ❤️ Soporte Si necesitas asistencia técnica, póngase en contacto con nuestro equipo de asistencia en developers.mercadopago.com . 🏻 Licencia MIT license. Copyright (c) 2021 - Mercado Pago / Mercado Libre Para obtener más información, consulte el archivo LICENSE." }, "README.html": { "href": "README.html", "title": "Mercado Pago .Net | MercadoPago official .NET SDK", - "keywords": "Mercado Pago .Net Portuguese / Spanish The official Mercado Pago .NET SDK. 💡 Requirements .NET Standard 2.0+ , .NET Core 2.0+ , and .NET Framework 4.6.1+ . If you are using previous versions of .NET Framework in your project, please refer to the older versions of the SDK. 📲 Installation Using the .NET Core command-line interface (CLI) tools dotnet add package mercadopago-sdk Using the NuGet Command Line Interface (CLI) nuget install mercadopago-sdk Using the Package Manager Install-Package mercadopago-sdk From Visual Studio Open the Solution Explorer . Right-click on a project within your solution. Click on Manage NuGet Packages... . Click on the Browse tab and search for \"mercadopago-sdk\". Click on the mercadopago-sdk package, select the appropriate version and click Install. 🌟 Getting Started First time using Mercado Pago? Create your Mercado Pago account . Copy your Access Token in the credentials panel and replace the text YOUR_ACCESS_TOKEN with it. Simple usage To generate a card token read the Checkout API documentation. using System; using System.Threading.Tasks; using MercadoPago.Client.Payment; using MercadoPago.Config; using MercadoPago.Resource.Payment; MercadoPagoConfig.AccessToken = \"YOUR_ACCESS_TOKEN\"; var request = new PaymentCreateRequest { TransactionAmount = 10, Token = \"CARD_TOKEN\", Description = \"Payment description\", Installments = 1, PaymentMethodId = \"visa\", Payer = new PaymentPayerRequest { Email = \"test.payer@email.com\", } }; var client = new PaymentClient(); Payment payment = await client.CreateAsync(request); Console.WriteLine($\"Payment ID: {payment.Id}\"); Per-request configuration All methods that make API calls accept an optional RequestOptions object. This can be used to configure some special options of the request, such as changing credentials or custom headers. using MercadoPago.Client; var requestOptions = new RequestOptions(); requestOptions.AccessToken = \"YOUR_ACCESS_TOKEN\"; // ... var client = new PaymentClient(); Payment payment = await client.CreateAsync(request, requestOptions); Advanced usage Using a proxy server using System.Net; using System.Net.Http; using MercadoPago.Config; using MercadoPago.Http; var handler = new HttpClientHandler { Proxy = new WebProxy(proxyUrl), UseProxy = true, }; var httpClient = new HttpClient(handler); MercadoPagoConfig.HttpClient = new DefaultHttpClient(httpClient); Configuring automatic retries The SDK automatically retries requests on intermittent failures. The default max number of attempts is 2 . using MercadoPago.Config; using MercadoPago.Http; var retryStrategy = new DefaultRetryStrategy(5); MercadoPagoConfig.RetryStrategy = retryStrategy; 📚 Documentation Visit our Developer Site for further information regarding: APIs Checkout Pro Checkout API Web Tokenize Checkout Check our SDK docs to explore all available functionalities. 🤝 Contributing All contributions are welcome, ranging from people wanting to triage issues, others wanting to write documentation, to people wanting to contribute code. Please read and follow our contribution guidelines . Contributions not following this guidelines will be disregarded. The guidelines are in place to make all of our lives easier and make contribution a consistent process for everyone. ❤️ Support If you require technical support, please contact our support team at developers.mercadopago.com . 🏻 License MIT license. Copyright (c) 2021 - Mercado Pago / Mercado Libre For more information, see the LICENSE file." + "keywords": "Mercado Pago .Net Portuguese / Spanish The official Mercado Pago .NET SDK. 💡 Requirements .NET Standard 2.1+ , .NET Core 2.0+ , and .NET Framework 6.0+ . If you are using previous versions of .NET Framework in your project, please refer to the older versions of the SDK. 📲 Installation Using the .NET Core command-line interface (CLI) tools dotnet add package mercadopago-sdk Using the NuGet Command Line Interface (CLI) nuget install mercadopago-sdk Using the Package Manager Install-Package mercadopago-sdk From Visual Studio Open the Solution Explorer . Right-click on a project within your solution. Click on Manage NuGet Packages... . Click on the Browse tab and search for \"mercadopago-sdk\". Click on the mercadopago-sdk package, select the appropriate version and click Install. 🌟 Getting Started First time using Mercado Pago? Create your Mercado Pago account . Copy your Access Token in the credentials panel and replace the text YOUR_ACCESS_TOKEN with it. Simple usage To generate a card token read the Checkout API documentation. using System; using System.Threading.Tasks; using MercadoPago.Client.Payment; using MercadoPago.Config; using MercadoPago.Resource.Payment; MercadoPagoConfig.AccessToken = \"YOUR_ACCESS_TOKEN\"; var request = new PaymentCreateRequest { TransactionAmount = 10, Token = \"CARD_TOKEN\", Description = \"Payment description\", Installments = 1, PaymentMethodId = \"visa\", Payer = new PaymentPayerRequest { Email = \"test.payer@email.com\", } }; var client = new PaymentClient(); Payment payment = await client.CreateAsync(request); Console.WriteLine($\"Payment ID: {payment.Id}\"); Per-request configuration All methods that make API calls accept an optional RequestOptions object. This can be used to configure some special options of the request, such as changing credentials or custom headers. using MercadoPago.Client; var requestOptions = new RequestOptions(); requestOptions.AccessToken = \"YOUR_ACCESS_TOKEN\"; // ... var client = new PaymentClient(); Payment payment = await client.CreateAsync(request, requestOptions); Advanced usage Using a proxy server using System.Net; using System.Net.Http; using MercadoPago.Config; using MercadoPago.Http; var handler = new HttpClientHandler { Proxy = new WebProxy(proxyUrl), UseProxy = true, }; var httpClient = new HttpClient(handler); MercadoPagoConfig.HttpClient = new DefaultHttpClient(httpClient); Configuring automatic retries The SDK automatically retries requests on intermittent failures. The default max number of attempts is 2 . using MercadoPago.Config; using MercadoPago.Http; var retryStrategy = new DefaultRetryStrategy(5); MercadoPagoConfig.RetryStrategy = retryStrategy; 📚 Documentation Visit our Developer Site for further information regarding: APIs Checkout Pro Checkout API Web Tokenize Checkout Check our SDK docs to explore all available functionalities. 🤝 Contributing All contributions are welcome, ranging from people wanting to triage issues, others wanting to write documentation, to people wanting to contribute code. Please read and follow our contribution guidelines . Contributions not following this guidelines will be disregarded. The guidelines are in place to make all of our lives easier and make contribution a consistent process for everyone. ❤️ Support If you require technical support, please contact our support team at developers.mercadopago.com . 🏻 License MIT license. Copyright (c) 2021 - Mercado Pago / Mercado Libre For more information, see the LICENSE file." }, "README.pt.html": { "href": "README.pt.html", "title": "Mercado Pago .Net | MercadoPago official .NET SDK", - "keywords": "Mercado Pago .Net Inglês / Espanhol O SDK oficial do Mercado Pago. 💡 Requisitos .NET Standard 2.0+ , .NET Core 2.0+ , e .NET Framework 4.6.1+ . Se você estiver usando versões anteriores do .NET Framework em seu projeto, consulte as versões mais antigas do SDK. 📲 Instalação Usando o .NET Core command-line interface (CLI) tools dotnet add package mercadopago-sdk Usando o NuGet Command Line Interface (CLI) nuget install mercadopago-sdk Usando o Package Manager Install-Package mercadopago-sdk No Visual Studio Abra o Solution Explorer . Clique com o botão direito em um projeto da sua solução. Clique em Manage NuGet Packages... . Clique na tab Browse e busque por \"mercadopago-sdk\". Clique no package mercadopago-sdk , selecione a versãa apropriada e clique em Install . 🌟 Iniciando Primeira vez usando o Mercado Pago? Crie sua conta do Mercado Pago . Copie seu Access Token do painel de credenciais e substitua o texto YOUR_ACCESS_TOKEN com ele. Uso simples Para gerar um card token leia a documentação do Checkout Transparente . using System; using System.Threading.Tasks; using MercadoPago.Client.Payment; using MercadoPago.Config; using MercadoPago.Resource.Payment; MercadoPagoConfig.AccessToken = \"YOUR_ACCESS_TOKEN\"; var request = new PaymentCreateRequest { TransactionAmount = 10, Token = \"CARD_TOKEN\", Description = \"Payment description\", Installments = 1, PaymentMethodId = \"visa\", Payer = new PaymentPayerRequest { Email = \"test.payer@email.com\", } }; var client = new PaymentClient(); Payment payment = await client.CreateAsync(request); Console.WriteLine($\"Payment ID: {payment.Id}\"); Configuração por requisição Todos os métodos que realizam chamadas às APIs aceitam um objeto opcional RequestOptions . Isto pode ser utilizado para configurar algumas opções especiais da requisição, como a alteração das próprias credenciais ou headers personalizados. using MercadoPago.Client; var requestOptions = new RequestOptions(); requestOptions.AccessToken = \"YOUR_ACCESS_TOKEN\"; // ... var client = new PaymentClient(); Payment payment = await client.CreateAsync(request, requestOptions); Uso avançado Usar um servidor de proxy using System.Net; using System.Net.Http; using MercadoPago.Config; using MercadoPago.Http; var handler = new HttpClientHandler { Proxy = new WebProxy(proxyUrl), UseProxy = true, }; var httpClient = new HttpClient(handler); MercadoPagoConfig.HttpClient = new DefaultHttpClient(httpClient); Configurar retentativas automáticas O SDK automaticamente retenta as requisições no caso de falhas intermitentes. O número máximo de tentativas default é 2 . using MercadoPago.Config; using MercadoPago.Http; var retryStrategy = new DefaultRetryStrategy(5); MercadoPagoConfig.RetryStrategy = retryStrategy; 📚 Documentação Visite nosso Developer Site para mais informações sobre: APIs Checkout Pro Checkout Transparente Web Tokenize Checkout Veja nosso SDK docs para explorar todas as funcionalidades disponíveis. 🤝 Contribuindo Todas as contribuições são bem-vindas, desde pessoas que desejam fazer a triagem de issues, outras que desejam escrever documentação, até pessoas que desejam contribuir com código. Por favor, leia e siga nossas diretrizes de contribuição . As contribuições que não seguirem essas diretrizes serão desconsideradas. As diretrizes existem para facilitar todas as nossas vidas e tornar a contribuição um processo consistente para todos. ❤️ Soporte Se você necessita de suporte técnico, por favor entre em contato com nosso time de suporte em developers.mercadopago.com 🏻 Licença MIT license. Copyright (c) 2021 - Mercado Pago / Mercado Libre Para mais informação, veja o arquivo LICENSE." + "keywords": "Mercado Pago .Net Inglês / Espanhol O SDK oficial do Mercado Pago. 💡 Requisitos .NET Standard 2.1+ , .NET Core 2.0+ , e .NET Framework 6.0+ . Se você estiver usando versões anteriores do .NET Framework em seu projeto, consulte as versões mais antigas do SDK. 📲 Instalação Usando o .NET Core command-line interface (CLI) tools dotnet add package mercadopago-sdk Usando o NuGet Command Line Interface (CLI) nuget install mercadopago-sdk Usando o Package Manager Install-Package mercadopago-sdk No Visual Studio Abra o Solution Explorer . Clique com o botão direito em um projeto da sua solução. Clique em Manage NuGet Packages... . Clique na tab Browse e busque por \"mercadopago-sdk\". Clique no package mercadopago-sdk , selecione a versãa apropriada e clique em Install . 🌟 Iniciando Primeira vez usando o Mercado Pago? Crie sua conta do Mercado Pago . Copie seu Access Token do painel de credenciais e substitua o texto YOUR_ACCESS_TOKEN com ele. Uso simples Para gerar um card token leia a documentação do Checkout Transparente . using System; using System.Threading.Tasks; using MercadoPago.Client.Payment; using MercadoPago.Config; using MercadoPago.Resource.Payment; MercadoPagoConfig.AccessToken = \"YOUR_ACCESS_TOKEN\"; var request = new PaymentCreateRequest { TransactionAmount = 10, Token = \"CARD_TOKEN\", Description = \"Payment description\", Installments = 1, PaymentMethodId = \"visa\", Payer = new PaymentPayerRequest { Email = \"test.payer@email.com\", } }; var client = new PaymentClient(); Payment payment = await client.CreateAsync(request); Console.WriteLine($\"Payment ID: {payment.Id}\"); Configuração por requisição Todos os métodos que realizam chamadas às APIs aceitam um objeto opcional RequestOptions . Isto pode ser utilizado para configurar algumas opções especiais da requisição, como a alteração das próprias credenciais ou headers personalizados. using MercadoPago.Client; var requestOptions = new RequestOptions(); requestOptions.AccessToken = \"YOUR_ACCESS_TOKEN\"; // ... var client = new PaymentClient(); Payment payment = await client.CreateAsync(request, requestOptions); Uso avançado Usar um servidor de proxy using System.Net; using System.Net.Http; using MercadoPago.Config; using MercadoPago.Http; var handler = new HttpClientHandler { Proxy = new WebProxy(proxyUrl), UseProxy = true, }; var httpClient = new HttpClient(handler); MercadoPagoConfig.HttpClient = new DefaultHttpClient(httpClient); Configurar retentativas automáticas O SDK automaticamente retenta as requisições no caso de falhas intermitentes. O número máximo de tentativas default é 2 . using MercadoPago.Config; using MercadoPago.Http; var retryStrategy = new DefaultRetryStrategy(5); MercadoPagoConfig.RetryStrategy = retryStrategy; 📚 Documentação Visite nosso Developer Site para mais informações sobre: APIs Checkout Pro Checkout Transparente Web Tokenize Checkout Veja nosso SDK docs para explorar todas as funcionalidades disponíveis. 🤝 Contribuindo Todas as contribuições são bem-vindas, desde pessoas que desejam fazer a triagem de issues, outras que desejam escrever documentação, até pessoas que desejam contribuir com código. Por favor, leia e siga nossas diretrizes de contribuição . As contribuições que não seguirem essas diretrizes serão desconsideradas. As diretrizes existem para facilitar todas as nossas vidas e tornar a contribuição um processo consistente para todos. ❤️ Suporte Se você necessita de suporte técnico, por favor entre em contato com nosso time de suporte em developers.mercadopago.com 🏻 Licença MIT license. Copyright (c) 2021 - Mercado Pago / Mercado Libre Para mais informação, veja o arquivo LICENSE." }, "sdk/MercadoPago.Client.AdvancedPayment.AdvancedPaymentAdditionalInfoPayerRequest.html": { "href": "sdk/MercadoPago.Client.AdvancedPayment.AdvancedPaymentAdditionalInfoPayerRequest.html", diff --git a/index.md b/index.md index 8f92f904..72c47fd4 100644 --- a/index.md +++ b/index.md @@ -11,7 +11,7 @@ The official Mercado Pago .NET SDK. ## 💡 Requirements -**.NET Standard 2.0+**, **.NET Core 2.0+**, and **.NET Framework 4.6.1+**. +**.NET Standard 2.1+**, **.NET Core 2.0+**, and **.NET Framework 6.0+**. If you are using previous versions of .NET Framework in your project, please refer to the [older versions](https://github.com/mercadopago/sdk-dotnet/tree/master-dotnet-framework) of the SDK. diff --git a/src/MercadoPago.Tests/Client/AdvancedPayment/AdvancedPaymentClientTest.cs b/src/MercadoPago.Tests/Client/AdvancedPayment/AdvancedPaymentClientTest.cs index 5ae6870d..239a47cf 100644 --- a/src/MercadoPago.Tests/Client/AdvancedPayment/AdvancedPaymentClientTest.cs +++ b/src/MercadoPago.Tests/Client/AdvancedPayment/AdvancedPaymentClientTest.cs @@ -437,7 +437,7 @@ private async Task CreateAsync(AdvancedPaymentCreateRequest req } else { - throw ex; + throw; } } @@ -462,7 +462,7 @@ private AdvancedPayment Create(AdvancedPaymentCreateRequest request) } else { - throw ex; + throw; } } @@ -553,13 +553,13 @@ private async Task ExecuteAsync(Func> func, Func(Func func, Func shouldRet { if (++attempts == maxAttempts) { - throw ex; + throw; } Thread.Sleep(1000); } else { - throw ex; + throw; } } } diff --git a/src/MercadoPago.Tests/Client/Payment/PaymentClientTest.cs b/src/MercadoPago.Tests/Client/Payment/PaymentClientTest.cs index a7cec3d2..6a785240 100644 --- a/src/MercadoPago.Tests/Client/Payment/PaymentClientTest.cs +++ b/src/MercadoPago.Tests/Client/Payment/PaymentClientTest.cs @@ -245,7 +245,7 @@ public async Task SearchAsync_ByExternalReference_Success() PaymentCreateRequest request = await BuildCreateRequestAsync(true, "approved"); Payment createdPayment = await client.CreateAsync(request); - await Task.Delay(3000); + await Task.Delay(5000); var searchRequest = new AdvancedSearchRequest { diff --git a/src/MercadoPago.Tests/MercadoPago.Tests.csproj b/src/MercadoPago.Tests/MercadoPago.Tests.csproj index c2444610..96a4c012 100644 --- a/src/MercadoPago.Tests/MercadoPago.Tests.csproj +++ b/src/MercadoPago.Tests/MercadoPago.Tests.csproj @@ -1,72 +1,72 @@ - - - - - net5.0;netcoreapp3.1;netcoreapp2.1;net461 - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - + + + + + net6.0;netstandard2.1 + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + diff --git a/src/MercadoPago/MercadoPago.csproj b/src/MercadoPago/MercadoPago.csproj index 647664ce..f3409d29 100644 --- a/src/MercadoPago/MercadoPago.csproj +++ b/src/MercadoPago/MercadoPago.csproj @@ -6,7 +6,7 @@ MercadoPago MercadoPago MercadoPago - Official .NET 4.6.1+ MercadoPago SDK + Official .NET 6.0+ MercadoPago SDK true true 7.3 @@ -17,26 +17,14 @@ mercadopago;payment;credit;card;checkout True snupkg - net5.0;netstandard2.0;net461 - 2.3.10 - 2.3.10 + net6.0;netstandard2.1 + 2.4.0 + 2.4.0 - - - - - - - - - - - - - +