### Install GlobalPayments.Api via dotnet CLI Source: https://github.com/globalpayments/dotnet-sdk/blob/master/README.md Adds the GlobalPayments.Api package to your .NET project using the .NET Core command-line interface. ```Bash dotnet add package GlobalPayments.Api ``` -------------------------------- ### Install GlobalPayments.Api via NuGet Manager Console Source: https://github.com/globalpayments/dotnet-sdk/blob/master/README.md Installs the GlobalPayments.Api package into your .NET solution using the NuGet Package Manager Console. ```PowerShell PM> Install-Package GlobalPayments.Api ``` -------------------------------- ### Clone Global Payments .NET SDK Repository Source: https://github.com/globalpayments/dotnet-sdk/blob/master/README.md Clones the Global Payments .NET SDK repository from GitHub to your local machine, allowing for project reference installation. ```Bash git clone https://github.com/globalpayments/dotnet-sdk ``` -------------------------------- ### Git Workflow for Contributing to .NET SDK Source: https://github.com/globalpayments/dotnet-sdk/blob/master/README.md Provides a step-by-step guide for developers to contribute to the GlobalPayments .NET SDK, covering branching, committing, and pushing changes, and preparing a pull request. It outlines the essential Git commands for feature development. ```Shell git checkout -b my-new-feature git commit -am 'Add some feature' git push origin my-new-feature ``` -------------------------------- ### JavaScript Example: Displaying Test Results Source: https://github.com/globalpayments/dotnet-sdk/blob/master/tests/GlobalPayments.Api.Tests/Terminals/UPA/FileExamples/UDDataFile.html This JavaScript snippet demonstrates how to prepare a JSON object containing a command result and then display it using a 'display.onScreenResult' function. It's typically used in testing environments to visualize the outcome of an operation. ```JavaScript var dataStr = JSON.stringify({ 'cmdResult': { 'result':'Success' } }); display.onScreenResult(dataStr); ``` -------------------------------- ### Process a Payment with Global Payments .NET SDK Source: https://github.com/globalpayments/dotnet-sdk/blob/master/README.md Demonstrates how to process a credit card payment using the Global Payments .NET SDK. It initializes card data, attempts a charge with currency, and includes basic error handling for API exceptions. ```C# var card = new CreditCardData { Number = "4263970000005262", ExpMonth = 12, ExpYear = 2025, Cvn = "131", CardHolderName = "James Mason" }; try { var response = card.Charge(129.99m) .WithCurrency("EUR") .Execute(); var result = response.ResponseCode; // 00 == Success var message = response.ResponseMessage; // [ test system ] AUTHORISED } catch (ApiException e) { // handle errors } ``` -------------------------------- ### Handle Exceptions in Global Payments .NET SDK Source: https://github.com/globalpayments/dotnet-sdk/blob/master/README.md Illustrates how to implement comprehensive error handling for various exception types (Builder, Configuration, Gateway, UnsupportedTransaction, API) that can occur when interacting with the Global Payments .NET SDK, allowing for specific error management. ```C# try { var response = card.Charge(5.00m) .WithCurrency("USD") .WithAddress(address) .Execute(); } catch (BuilderException e) { // handle builder errors } catch (ConfigurationException e) { // handle errors related to your services configuration } catch (GatewayException e) { // handle gateway errors/exceptions } catch (UnsupportedTransactionException e) { // handle errors when the configured gateway doesn't support // desired transaction } catch (ApiException e) { // handle all other errors } ``` -------------------------------- ### Global Payments Test Card Data Source: https://github.com/globalpayments/dotnet-sdk/blob/master/README.md Provides a list of test credit card numbers and details for various card types (Visa, MasterCard, Discover, Amex, JCB, Diners Club) to simulate different transaction scenarios in the sandbox environment. ```APIDOC Name | Number | Exp Month | Exp Year | CVN ----------- | ---------------- | --------- | -------- | ---- Visa | 4263970000005262 | 12 | 2025 | 123 MasterCard | 2223000010005780 | 12 | 2019 | 900 MasterCard | 5425230000004415 | 12 | 2025 | 123 Discover | 6011000000000087 | 12 | 2025 | 123 Amex | 374101000000608 | 12 | 2025 | 1234 JCB | 3566000000000000 | 12 | 2025 | 123 Diners Club | 36256000000725 | 12 | 2025 | 123 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.