diff --git a/README.md b/README.md index 86826a4..69bc448 100644 --- a/README.md +++ b/README.md @@ -1,102 +1,2 @@ ---- -sidebar_label: .NET -pagination_next: null -pagination_prev: null ---- - -# .NET SDK - -The official .NET SDK for the Checkout and ePayment APIs. Supports .NET Standard 2.0+, .NET Core 2.0+ and .NET Framework 4.8+. - -You can install the SDK with Nuget as per [Installation](#installation). -More information about the package can be found on [nuget.org](https://www.nuget.org/packages/Vipps.net). - - -**Features** - -- Serialization/deserialization -- Authentication -- Network retries -- Idempotency - -## Installation - -.NET Core CLI: - -```sh -dotnet add package vipps.net -``` - -## Usage - -```C# -var vippsConfigurationOptions = new VippsConfigurationOptions -{ - ClientId = "CLIENT-ID", - ClientSecret = "CLIENT-SECRET", - MerchantSerialNumber = "MERCHANT-SERIAL-NUMBER", - SubscriptionKey = "SUBSCRIPTION-KEY", - UseTestMode = true -}; - -var vippsApi = new VippsApi(vippsConfigurationOptions) - -var request = new InitiateSessionRequest -{ - MerchantInfo = new PaymentMerchantInfo - { - CallbackAuthorizationToken = Guid.NewGuid().ToString(), - CallbackUrl = "https://your-url-here.com:3000", - ReturnUrl = "https://your-url-here.com:3000", - }, - Transaction = new PaymentTransaction - { - Amount = new Amount { Currency = "NOK", Value = 10000 }, - PaymentDescription = "test", - Reference = Guid.NewGuid().ToString() - } -}; - -var result = await vippsApi.CheckoutService.InitiateSession(request); - -``` - -### Unimplemented parameters and properties - -This SDK offers typed request and response classes. These classes might not be up-to-date if you are on the bleeding edge of our APIs, or if you use features that are not generally available. - -#### Request - -All request objects have a property called `AdditionalProperties`. This is a dictionary that if set will merge with the request object. - -**`AdditionalProperties` example:** - -```c# -InitiateSessionRequest initiateSessionRequest = new() -{ - Transaction = new PaymentTransaction() - { - Amount = new Amount() - { - Currency = "NOK", - Value = 49000 - }, - PaymentDescription = "Hei" - }, - AdditionalProperties = - { - { "Configuration", new { AcceptedPaymentMethods = new[] { "WALLET", "CARD" } } } - } -}; -``` - -#### Response - -All response objects have a property called `RawResponse` that contains the response in the form of a Json Object. - -**`RawResponse` example:** - -```c# -var response = vippsApi.CheckoutService.InitiateSession(initiateSessionRequest); -var cancellationUrl = response.RawResponse["cancellationUrl"].ToString(); -``` +ℹ️ Documentation is available at: +[Vipps MobilePay Technical Documentation](https://developer.vippsmobilepay.com/docs/SDKs/dotnet-sdk).