aboutsummaryrefslogtreecommitdiffstats
path: root/src/IOL.VippsEcommerce/Models/Api
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2021-03-31 18:00:22 +0200
committerivarlovlie <git@ivarlovlie.no>2021-03-31 18:00:22 +0200
commite6ca7a484d9cc213fb00c34ebf7cb55ace892c04 (patch)
treee885d823c224d55503286b1dab207fcc7c5c68d1 /src/IOL.VippsEcommerce/Models/Api
downloaddotnet-vipps-ecommerce-e6ca7a484d9cc213fb00c34ebf7cb55ace892c04.tar.xz
dotnet-vipps-ecommerce-e6ca7a484d9cc213fb00c34ebf7cb55ace892c04.zip
Initial commit
Diffstat (limited to 'src/IOL.VippsEcommerce/Models/Api')
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/EErrorGroupEnum.cs47
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/EStatusEnum.cs25
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/ETransactionStatus.cs22
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/TAdditionalTransactionData.cs42
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/TCustomerInfo.cs14
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/TMerchantInfo.cs65
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/TMerchantInfoPayment.cs15
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/TShippingDetails.cs32
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/TTransaction.cs21
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/TTransactionInfo.cs15
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/TTransactionInfoInitiate.cs57
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/TTransactionSummary.cs42
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/VippsAuthorizationTokenResponse.cs58
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/VippsErrorResponse.cs39
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/VippsForceApproveRequest.cs21
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/VippsGetPaymentDetailsResponse.cs125
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/VippsInitiatePaymentRequest.cs27
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/VippsInitiatePaymentResponse.cs21
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/VippsPaymentActionRequest.cs19
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/VippsPaymentActionResponse.cs34
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/VippsPaymentInitiationCallbackResponse.cs119
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/VippsRequestException.cs18
22 files changed, 878 insertions, 0 deletions
diff --git a/src/IOL.VippsEcommerce/Models/Api/EErrorGroupEnum.cs b/src/IOL.VippsEcommerce/Models/Api/EErrorGroupEnum.cs
new file mode 100644
index 0000000..8c6bf2f
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/EErrorGroupEnum.cs
@@ -0,0 +1,47 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ /// <summary>
+ /// The error group. See: https://github.com/vippsas/vipps-ecom-api/blob/master/vipps-ecom-api.md#error-groups
+ /// </summary>
+ public enum EErrorGroupEnum
+ {
+ /// <summary>
+ /// Enum Authentication for value: Authentication
+ /// </summary>
+ [JsonPropertyName("Authentication")]
+ AUTHENTICATION = 1,
+
+ /// <summary>
+ /// Enum Payments for value: Payments
+ /// </summary>
+ [JsonPropertyName("Payments")]
+ PAYMENTS = 2,
+
+ /// <summary>
+ /// Enum InvalidRequest for value: InvalidRequest
+ /// </summary>
+ [JsonPropertyName("InvalidRequest")]
+ INVALID_REQUEST = 3,
+
+ /// <summary>
+ /// Enum VippsError for value: VippsError
+ /// </summary>
+ [JsonPropertyName("VippsError")]
+ VIPPS_ERROR = 4,
+
+ /// <summary>
+ /// Enum User for value: User
+ /// </summary>
+ [JsonPropertyName("User")]
+ USER = 5,
+
+ /// <summary>
+ /// Enum Merchant for value: Merchant
+ /// </summary>
+ [JsonPropertyName("Merchant")]
+ MERCHANT = 6
+
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/EStatusEnum.cs b/src/IOL.VippsEcommerce/Models/Api/EStatusEnum.cs
new file mode 100644
index 0000000..bf579a4
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/EStatusEnum.cs
@@ -0,0 +1,25 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public enum EStatusEnum
+ {
+ /// <summary>
+ /// Enum Cancelled for value: Cancelled
+ /// </summary>
+ [JsonPropertyName("Cancelled")]
+ CANCELLED = 1,
+
+ /// <summary>
+ /// Enum Captured for value: Captured
+ /// </summary>
+ [JsonPropertyName("Captured")]
+ CAPTURED = 2,
+
+ /// <summary>
+ /// Enum Refund for value: Refund
+ /// </summary>
+ [JsonPropertyName("Refund")]
+ REFUND = 3
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/ETransactionStatus.cs b/src/IOL.VippsEcommerce/Models/Api/ETransactionStatus.cs
new file mode 100644
index 0000000..303a4e9
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/ETransactionStatus.cs
@@ -0,0 +1,22 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public enum ETransactionStatus
+ {
+ [JsonPropertyName("RESERVED")]
+ RESERVED,
+ [JsonPropertyName("SALE")]
+ SALE,
+ [JsonPropertyName("CANCELLED")]
+ CANCELLED,
+ [JsonPropertyName("REJECTED")]
+ REJECTED,
+ [JsonPropertyName("AUTO_CANCEL")]
+ AUTO_CANCEL,
+ [JsonPropertyName("SALE_FAILED")]
+ SALE_FAILED,
+ [JsonPropertyName("RESERVE_FAILED")]
+ RESERVE_FAILED
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/TAdditionalTransactionData.cs b/src/IOL.VippsEcommerce/Models/Api/TAdditionalTransactionData.cs
new file mode 100644
index 0000000..692c7be
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/TAdditionalTransactionData.cs
@@ -0,0 +1,42 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class TAdditionalTransactionData
+ {
+ /// <summary>
+ /// Passenger name, initials, and a title.
+ /// </summary>
+ /// <value>Passenger name, initials, and a title.</value>
+ [JsonPropertyName("passengerName")]
+ public string PassengerName { get; set; }
+
+ /// <summary>
+ /// IATA 3-digit accounting code (PAX); numeric. It identifies the carrier. eg KLM &#x3D; 074
+ /// </summary>
+ /// <value>IATA 3-digit accounting code (PAX); numeric. It identifies the carrier. eg KLM &#x3D; 074</value>
+ [JsonPropertyName("airlineCode")]
+ public string AirlineCode { get; set; }
+
+ /// <summary>
+ /// IATA 2-letter accounting code (PAX); alphabetical. It identifies the carrier. Eg KLM &#x3D; KL
+ /// </summary>
+ /// <value>IATA 2-letter accounting code (PAX); alphabetical. It identifies the carrier. Eg KLM &#x3D; KL</value>
+ [JsonPropertyName("airlineDesignatorCode")]
+ public string AirlineDesignatorCode { get; set; }
+
+ /// <summary>
+ /// The ticket&#x27;s unique identifier.
+ /// </summary>
+ /// <value>The ticket&#x27;s unique identifier.</value>
+ [JsonPropertyName("ticketNumber")]
+ public string TicketNumber { get; set; }
+
+ /// <summary>
+ /// Reference number for the invoice, issued by the agency.
+ /// </summary>
+ /// <value>Reference number for the invoice, issued by the agency.</value>
+ [JsonPropertyName("agencyInvoiceNumber")]
+ public string AgencyInvoiceNumber { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/TCustomerInfo.cs b/src/IOL.VippsEcommerce/Models/Api/TCustomerInfo.cs
new file mode 100644
index 0000000..a558638
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/TCustomerInfo.cs
@@ -0,0 +1,14 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class TCustomerInfo
+ {
+ /// <summary>
+ /// Mobile number of the user who has to pay for the transation from Vipps. Allowed format: xxxxxxxx. No country code.
+ /// </summary>
+ /// <value>Mobile number of the user who has to pay for the transation from Vipps. Allowed format: xxxxxxxx. No country code.</value>
+ [JsonPropertyName("mobileNumber")]
+ public string MobileNumber { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/TMerchantInfo.cs b/src/IOL.VippsEcommerce/Models/Api/TMerchantInfo.cs
new file mode 100644
index 0000000..881bc16
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/TMerchantInfo.cs
@@ -0,0 +1,65 @@
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class TMerchantInfo
+ {
+ /// <summary>
+ /// Authorization token that the merchant could share to make callbacks more secure. If provided this token will be returned as an &#x60;Authorization&#x60; header for our callbacks. This includes shipping details and callback.
+ /// </summary>
+ /// <value>Authorization token that the merchant could share to make callbacks more secure. If provided this token will be returned as an &#x60;Authorization&#x60; header for our callbacks. This includes shipping details and callback.</value>
+ //[JsonPropertyName("authToken")]
+ //public string AuthToken { get; set; }
+
+ /// <summary>
+ /// This is an URL for Vipps to call at the merchant&#x27;s server to provide updated information about the order after the payment request. Domain name and context path should be provided by merchant as the value for this parameter. Vipps will add &#x60;/v2/payments/{orderId}&#x60; to the end or this URL. URLs passed to Vipps must validate with the Apache Commons [UrlValidator](https://commons.apache.org/proper/commons-validator/apidocs/org/apache/commons/validator/routines/UrlValidator.html). We don&#x27;t send requests to all ports, so to be safe use common ports such as: 80, 443, 8080.
+ /// </summary>
+ /// <value>This is an URL for Vipps to call at the merchant&#x27;s server to provide updated information about the order after the payment request. Domain name and context path should be provided by merchant as the value for this parameter. Vipps will add &#x60;/v2/payments/{orderId}&#x60; to the end or this URL. URLs passed to Vipps must validate with the Apache Commons [UrlValidator](https://commons.apache.org/proper/commons-validator/apidocs/org/apache/commons/validator/routines/UrlValidator.html). We don&#x27;t send requests to all ports, so to be safe use common ports such as: 80, 443, 8080.</value>
+ [JsonPropertyName("callbackPrefix")]
+ public string CallbackPrefix { get; set; }
+
+ /// <summary>
+ /// Required for Vipps Hurtigkasse (express checkout) payments. This callback URL will be used by Vipps to inform the merchant that the user has revoked his/her consent: This Vipps user does do not want the merchant to store or use his/her personal information anymore. Required by GDPR. Vipps will add &#x60;/v2/consents/{userId}&#x60; to the end or this URL. URLs passed to Vipps should be URL-encoded, and must validate with the Apache Commons [UrlValidator](https://commons.apache.org/proper/commons-validator/apidocs/org/apache/commons/validator/routines/UrlValidator.html). We don&#x27;t send requests to all ports, so to be safe use common ports such as: 80, 443, 8080.
+ /// </summary>
+ /// <value>Required for Vipps Hurtigkasse (express checkout) payments. This callback URL will be used by Vipps to inform the merchant that the user has revoked his/her consent: This Vipps user does do not want the merchant to store or use his/her personal information anymore. Required by GDPR. Vipps will add &#x60;/v2/consents/{userId}&#x60; to the end or this URL. URLs passed to Vipps should be URL-encoded, and must validate with the Apache Commons [UrlValidator](https://commons.apache.org/proper/commons-validator/apidocs/org/apache/commons/validator/routines/UrlValidator.html). We don&#x27;t send requests to all ports, so to be safe use common ports such as: 80, 443, 8080.</value>
+ //[JsonPropertyName("consentRemovalPrefix")]
+ //public string ConsentRemovalPrefix { get; set; }
+
+ /// <summary>
+ /// Vipps will use the fallBack URL to redirect the Vipps user to the merchant’s confirmation page once the payment is completed in Vipps. This is normally the “success page”, although the “fallback” name is ambiguous (the same URL is also used if payment was not successful). In other words: This is the URL Vipps sends the Vipps user back to. URLs passed to Vipps must validate with the Apache Commons [UrlValidator](https://commons.apache.org/proper/commons-validator/apidocs/org/apache/commons/validator/routines/UrlValidator.html).
+ /// </summary>
+ /// <value>Vipps will use the fallBack URL to redirect the Vipps user to the merchant’s confirmation page once the payment is completed in Vipps. This is normally the “success page”, although the “fallback” name is ambiguous (the same URL is also used if payment was not successful). In other words: This is the URL Vipps sends the Vipps user back to. URLs passed to Vipps must validate with the Apache Commons [UrlValidator](https://commons.apache.org/proper/commons-validator/apidocs/org/apache/commons/validator/routines/UrlValidator.html).</value>
+ [JsonPropertyName("fallBack")]
+ public string FallBack { get; set; }
+
+ /// <summary>
+ /// This parameter indicates whether payment request is triggered from Mobile App or Web browser. Based on this value, response will be redirect URL for Vipps landing page or deeplink URL to connect vipps App. When isApp is set to true, URLs passed to Vipps will not be validated as regular URLs.
+ /// </summary>
+ /// <value>This parameter indicates whether payment request is triggered from Mobile App or Web browser. Based on this value, response will be redirect URL for Vipps landing page or deeplink URL to connect vipps App. When isApp is set to true, URLs passed to Vipps will not be validated as regular URLs.</value>
+ [JsonPropertyName("isApp")]
+ public bool? IsApp { get; set; }
+
+ /// <summary>
+ /// Unique id for this merchant&#x27;s sales channel: website, mobile app etc. Short name: MSN.
+ /// </summary>
+ /// <value>Unique id for this merchant&#x27;s sales channel: website, mobile app etc. Short name: MSN.</value>
+ [JsonPropertyName("merchantSerialNumber")]
+ public string MerchantSerialNumber { get; set; }
+
+
+ /// <summary>
+ /// In case of Vipps Hurtigkasse (express checkout) payment, merchant should pass this prefix to let Vipps fetch shipping cost and method related details. Vipps will add &#x60;/v2/payments/{orderId}/shippingDetails&#x60; to the end or this URL. We don&#x27;t send requests to all ports, so to be safe use common ports such as: 80, 443, 8080.
+ /// </summary>
+ /// <value>In case of Vipps Hurtigkasse (express checkout) payment, merchant should pass this prefix to let Vipps fetch shipping cost and method related details. Vipps will add &#x60;/v2/payments/{orderId}/shippingDetails&#x60; to the end or this URL. We don&#x27;t send requests to all ports, so to be safe use common ports such as: 80, 443, 8080.</value>
+ [JsonPropertyName("shippingDetailsPrefix")]
+ public string ShippingDetailsPrefix { get; set; }
+
+ /// <summary>
+ /// If shipping method and cost are always a fixed value, for example 50 NOK, then the method and price can be provided during the initiate call. The shippingDetailsPrefix callback will not be used if this value is provided. This will result in a faster checkout and a better customer experience.
+ /// </summary>
+ /// <value>If shipping method and cost are always a fixed value, for example 50 NOK, then the method and price can be provided during the initiate call. The shippingDetailsPrefix callback will not be used if this value is provided. This will result in a faster checkout and a better customer experience.</value>
+ [JsonPropertyName("staticShippingDetails")]
+ public List<TShippingDetails> StaticShippingDetails { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/TMerchantInfoPayment.cs b/src/IOL.VippsEcommerce/Models/Api/TMerchantInfoPayment.cs
new file mode 100644
index 0000000..ce0cbc3
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/TMerchantInfoPayment.cs
@@ -0,0 +1,15 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class TMerchantInfoPayment
+ {
+
+ /// <summary>
+ /// Unique id for this merchant&#x27;s sales channel: website, mobile app etc. Short name: MSN.
+ /// </summary>
+ /// <value>Unique id for this merchant&#x27;s sales channel: website, mobile app etc. Short name: MSN.</value>
+ [JsonPropertyName("merchantSerialNumber")]
+ public string MerchantSerialNumber { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/TShippingDetails.cs b/src/IOL.VippsEcommerce/Models/Api/TShippingDetails.cs
new file mode 100644
index 0000000..72ac7f2
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/TShippingDetails.cs
@@ -0,0 +1,32 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class TShippingDetails
+ {
+ /// <summary>
+ /// Gets or Sets Priority
+ /// </summary>
+ [JsonPropertyName("priority")]
+ public int? Priority { get; set; }
+
+ /// <summary>
+ /// Gets or Sets ShippingCost
+ /// </summary>
+ [JsonPropertyName("shippingCost")]
+ public double? ShippingCost { get; set; }
+
+ /// <summary>
+ /// Shipping method. Max length: 256 characters. Recommended length for readability on most screens: 25 characters.
+ /// </summary>
+ /// <value>Shipping method. Max length: 256 characters. Recommended length for readability on most screens: 25 characters.</value>
+ [JsonPropertyName("shippingMethod")]
+ public string ShippingMethod { get; set; }
+
+ /// <summary>
+ /// Gets or Sets ShippingMethodId
+ /// </summary>
+ [JsonPropertyName("shippingMethodId")]
+ public string ShippingMethodId { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/TTransaction.cs b/src/IOL.VippsEcommerce/Models/Api/TTransaction.cs
new file mode 100644
index 0000000..9e09758
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/TTransaction.cs
@@ -0,0 +1,21 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class TTransaction
+ {
+ /// <summary>
+ /// Amount in øre, if amount is 0 or not provided then full capture will be performed. 32 Bit Integer (2147483647)
+ /// </summary>
+ /// <value>Amount in øre, if amount is 0 or not provided then full capture will be performed. 32 Bit Integer (2147483647)</value>
+ [JsonPropertyName("amount")]
+ public int? Amount { get; set; }
+
+ /// <summary>
+ /// Transaction text to be displayed in Vipps
+ /// </summary>
+ /// <value>Transaction text to be displayed in Vipps</value>
+ [JsonPropertyName("transactionText")]
+ public string TransactionText { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/TTransactionInfo.cs b/src/IOL.VippsEcommerce/Models/Api/TTransactionInfo.cs
new file mode 100644
index 0000000..30e62f9
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/TTransactionInfo.cs
@@ -0,0 +1,15 @@
+using System.Text.Json.Serialization;
+using IOL.VippsEcommerce.Models.Api;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class TTransactionInfo
+ {
+ /// <summary>
+ /// Status which gives the current state of the payment within Vipps. See the [API guide](https://github.com/vippsas/vipps-ecom-api/blob/master/vipps-ecom-api.md#responses-from-requests) for more information.
+ /// </summary>
+ /// <value>Status which gives the current state of the payment within Vipps. See the [API guide](https://github.com/vippsas/vipps-ecom-api/blob/master/vipps-ecom-api.md#responses-from-requests) for more information.</value>
+ [JsonPropertyName("status")]
+ public EStatusEnum Status { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/TTransactionInfoInitiate.cs b/src/IOL.VippsEcommerce/Models/Api/TTransactionInfoInitiate.cs
new file mode 100644
index 0000000..7ad989b
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/TTransactionInfoInitiate.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class TTransactionInfoInitiate
+ {
+ /// <summary>
+ /// Amount in øre. 32 bit Integer (2147483647). Must be non-zero.
+ /// </summary>
+ /// <value>Amount in øre. 32 bit Integer (2147483647). Must be non-zero.</value>
+ [JsonPropertyName("amount")]
+ public int? Amount { get; set; }
+
+ /// <summary>
+ /// Id which uniquely identifies a payment. Maximum length is 50 alphanumeric characters: a-z, A-Z, 0-9 and &#x27;-&#x27;.
+ /// </summary>
+ /// <value>Id which uniquely identifies a payment. Maximum length is 50 alphanumeric characters: a-z, A-Z, 0-9 and &#x27;-&#x27;.</value>
+ [JsonPropertyName("orderId")]
+ public string OrderId { get; set; }
+
+ /// <summary>
+ /// ISO formatted date time string.
+ /// </summary>
+ /// <value>ISO formatted date time string.</value>
+ [JsonPropertyName("timeStamp")]
+ public string TimeStamp { get; set; }
+
+ /// <summary>
+ /// Transaction text to be displayed in Vipps
+ /// </summary>
+ /// <value>Transaction text to be displayed in Vipps</value>
+ [JsonPropertyName("transactionText")]
+ public string TransactionText { get; set; }
+
+ /// <summary>
+ /// Skips the landing page for whitelisted sale units. Requires a valid customerInfo.mobileNumber.
+ /// </summary>
+ /// <value>Skips the landing page for whitelisted sale units. Requires a valid customerInfo.mobileNumber.</value>
+ [JsonPropertyName("skipLandingPage")]
+ public bool? SkipLandingPage { get; set; }
+
+
+ /// <summary>
+ /// Gets or Sets AdditionalData
+ /// </summary>
+ [JsonPropertyName("additionalData")]
+ public TAdditionalTransactionData AdditionalData { get; set; }
+
+ /// <summary>
+ /// Use the extended UX flow for express checkout which forces users to confirm their address and shipping choices
+ /// </summary>
+ /// <value>Use the extended UX flow for express checkout which forces users to confirm their address and shipping choices</value>
+ [JsonPropertyName("useExplicitCheckoutFlow")]
+ public bool? UseExplicitCheckoutFlow { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/TTransactionSummary.cs b/src/IOL.VippsEcommerce/Models/Api/TTransactionSummary.cs
new file mode 100644
index 0000000..786bcaa
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/TTransactionSummary.cs
@@ -0,0 +1,42 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class TTransactionSummary
+ {
+ /// <summary>
+ /// Total amount captured
+ /// </summary>
+ /// <value>Total amount captured</value>
+ [JsonPropertyName("capturedAmount")]
+ public int? CapturedAmount { get; set; }
+
+ /// <summary>
+ /// Total refunded amount of the order
+ /// </summary>
+ /// <value>Total refunded amount of the order</value>
+ [JsonPropertyName("refundedAmount")]
+ public int? RefundedAmount { get; set; }
+
+ /// <summary>
+ /// Total remaining amount to capture
+ /// </summary>
+ /// <value>Total remaining amount to capture</value>
+ [JsonPropertyName("remainingAmountToCapture")]
+ public int? RemainingAmountToCapture { get; set; }
+
+ /// <summary>
+ /// Total remaining amount to refund
+ /// </summary>
+ /// <value>Total remaining amount to refund</value>
+ [JsonPropertyName("remainingAmountToRefund")]
+ public int? RemainingAmountToRefund { get; set; }
+
+ /// <summary>
+ /// Bank Identification Number, first 6 digit of card number
+ /// </summary>
+ /// <value>Bank Identification Number, first 6 digit of card number</value>
+ [JsonPropertyName("bankIdentificationNumber")]
+ public string BankIdentificationNumber { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/VippsAuthorizationTokenResponse.cs b/src/IOL.VippsEcommerce/Models/Api/VippsAuthorizationTokenResponse.cs
new file mode 100644
index 0000000..b870ddb
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/VippsAuthorizationTokenResponse.cs
@@ -0,0 +1,58 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ /// <summary>
+ /// AuthorizationTokenResponse
+ /// </summary>
+ public class VippsAuthorizationTokenResponse
+ {
+ /// <summary>
+ /// String containing the type for the Access Token.
+ /// </summary>
+ /// <value>String containing the type for the Access Token.</value>
+ [JsonPropertyName("token_type")]
+ public string TokenType { get; set; }
+
+ /// <summary>
+ /// Token expiry time in seconds.
+ /// </summary>
+ /// <value>Token expiry time in seconds.</value>
+ [JsonPropertyName("expires_in")]
+ public string ExpiresIn { get; set; }
+
+ /// <summary>
+ /// Extra time added to expiry time. Currently disabled.
+ /// </summary>
+ /// <value>Extra time added to expiry time. Currently disabled.</value>
+ [JsonPropertyName("ext_expires_in")]
+ public string ExtExpiresIn { get; set; }
+
+ /// <summary>
+ /// Token expiry time in epoch time format.
+ /// </summary>
+ /// <value>Token expiry time in epoch time format.</value>
+ [JsonPropertyName("expires_on")]
+ public string ExpiresOn { get; set; }
+
+ /// <summary>
+ /// Token creation time in epoch time format.
+ /// </summary>
+ /// <value>Token creation time in epoch time format.</value>
+ [JsonPropertyName("not_before")]
+ public string NotBefore { get; set; }
+
+ /// <summary>
+ /// A common resource object. Not used in token validation
+ /// </summary>
+ /// <value>A common resource object. Not used in token validation</value>
+ [JsonPropertyName("resource")]
+ public string Resource { get; set; }
+
+ /// <summary>
+ /// Gets or Sets AccessToken
+ /// </summary>
+ [JsonPropertyName("access_token")]
+ public string AccessToken { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/VippsErrorResponse.cs b/src/IOL.VippsEcommerce/Models/Api/VippsErrorResponse.cs
new file mode 100644
index 0000000..6471913
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/VippsErrorResponse.cs
@@ -0,0 +1,39 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ /// <summary>
+ /// VippsErrorResponse
+ /// </summary>
+ public class VippsErrorResponse
+ {
+ /// <summary>
+ /// The error group. See: https://github.com/vippsas/vipps-ecom-api/blob/master/vipps-ecom-api.md#error-groups
+ /// </summary>
+ /// <value>The error group. See: https://github.com/vippsas/vipps-ecom-api/blob/master/vipps-ecom-api.md#error-groups</value>
+ [JsonPropertyName("errorGroup")]
+ public EErrorGroupEnum ErrorGroup { get; }
+
+
+ /// <summary>
+ /// The error code. See: https://github.com/vippsas/vipps-ecom-api/blob/master/vipps-ecom-api.md#error-codes
+ /// </summary>
+ /// <value>The error code. See: https://github.com/vippsas/vipps-ecom-api/blob/master/vipps-ecom-api.md#error-codes</value>
+ [JsonPropertyName("errorCode")]
+ public string ErrorCode { get; }
+
+ /// <summary>
+ /// A description of what went wrong. See https://github.com/vippsas/vipps-ecom-api/blob/master/vipps-ecom-api.md#errors
+ /// </summary>
+ /// <value>A description of what went wrong. See https://github.com/vippsas/vipps-ecom-api/blob/master/vipps-ecom-api.md#errors</value>
+ [JsonPropertyName("errorMessage")]
+ public string ErrorMessage { get; }
+
+ /// <summary>
+ /// A unique id for this error, useful for searching in logs
+ /// </summary>
+ /// <value>A unique id for this error, useful for searching in logs</value>
+ [JsonPropertyName("contextId")]
+ public string ContextId { get; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/VippsForceApproveRequest.cs b/src/IOL.VippsEcommerce/Models/Api/VippsForceApproveRequest.cs
new file mode 100644
index 0000000..6a539c2
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/VippsForceApproveRequest.cs
@@ -0,0 +1,21 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class VippsForceApproveRequest
+ {
+ /// <summary>
+ /// Target customer phone number. 8 digits.
+ /// </summary>
+ /// <value>Target customer phone number. 8 digits.</value>
+ [JsonPropertyName("customerPhoneNumber")]
+ public string CustomerPhoneNumber { get; set; }
+
+ /// <summary>
+ /// The token value recieved in the &#x60;url&#x60; property in the Initiate response
+ /// </summary>
+ /// <value>The token value recieved in the &#x60;url&#x60; property in the Initiate response</value>
+ [JsonPropertyName("token")]
+ public string Token { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/VippsGetPaymentDetailsResponse.cs b/src/IOL.VippsEcommerce/Models/Api/VippsGetPaymentDetailsResponse.cs
new file mode 100644
index 0000000..844ac88
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/VippsGetPaymentDetailsResponse.cs
@@ -0,0 +1,125 @@
+using System;
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class VippsGetPaymentDetailsResponse
+ {
+ [JsonPropertyName("orderId")]
+ public string OrderId { get; set; }
+
+ [JsonPropertyName("shippingDetails")]
+ public ShippingDetails ShippingDetails { get; set; }
+
+ [JsonPropertyName("transactionLogHistory")]
+ public TransactionLogHistory[] TransactionLogHistory { get; set; }
+
+ [JsonPropertyName("transactionSummary")]
+ public TransactionSummary TransactionSummary { get; set; }
+
+ [JsonPropertyName("userDetails")]
+ public UserDetails UserDetails { get; set; }
+ }
+
+ public class ShippingDetails
+ {
+ [JsonPropertyName("address")]
+ public Address Address { get; set; }
+
+ [JsonPropertyName("shippingCost")]
+ public long ShippingCost { get; set; }
+
+ [JsonPropertyName("shippingMethod")]
+ public string ShippingMethod { get; set; }
+
+ [JsonPropertyName("shippingMethodId")]
+ public string ShippingMethodId { get; set; }
+ }
+
+ public class Address
+ {
+ [JsonPropertyName("addressLine1")]
+ public string AddressLine1 { get; set; }
+
+ [JsonPropertyName("addressLine2")]
+ public string AddressLine2 { get; set; }
+
+ [JsonPropertyName("city")]
+ public string City { get; set; }
+
+ [JsonPropertyName("country")]
+ public string Country { get; set; }
+
+ [JsonPropertyName("postCode")]
+ public string PostCode { get; set; }
+ }
+
+ public class TransactionLogHistory
+ {
+ [JsonPropertyName("amount")]
+ public long Amount { get; set; }
+
+ [JsonPropertyName("operation")]
+ public string Operation { get; set; }
+
+ [JsonPropertyName("operationSuccess")]
+ public bool OperationSuccess { get; set; }
+
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; }
+
+ [JsonPropertyName("timeStamp")]
+ public DateTime TimeStamp { get; set; }
+
+ [JsonPropertyName("transactionId")]
+ public string TransactionId { get; set; }
+
+ [JsonPropertyName("transactionText")]
+ public string TransactionText { get; set; }
+ }
+
+ public class TransactionSummary
+ {
+ [JsonPropertyName("capturedAmount")]
+ public long CapturedAmount { get; set; }
+
+ [JsonPropertyName("refundedAmount")]
+ public long RefundedAmount { get; set; }
+
+ [JsonPropertyName("remainingAmountToCapture")]
+ public long RemainingAmountToCapture { get; set; }
+
+ [JsonPropertyName("remainingAmountToRefund")]
+ public long RemainingAmountToRefund { get; set; }
+
+ [JsonPropertyName("bankIdentificationNumber")]
+ public long BankIdentificationNumber { get; set; }
+ }
+
+ public class UserDetails
+ {
+ [JsonPropertyName("bankIdVerified")]
+ public string BankIdVerified { get; set; }
+
+ [JsonPropertyName("dateOfBirth")]
+ public string DateOfBirth { get; set; }
+
+ [JsonPropertyName("email")]
+ public string Email { get; set; }
+
+ [JsonPropertyName("firstName")]
+ public string FirstName { get; set; }
+
+ [JsonPropertyName("lastName")]
+ public string LastName { get; set; }
+
+ [JsonPropertyName("mobileNumber")]
+ public long MobileNumber { get; set; }
+
+ [JsonPropertyName("ssn")]
+ public string Ssn { get; set; }
+
+ [JsonPropertyName("userId")]
+ public string UserId { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/VippsInitiatePaymentRequest.cs b/src/IOL.VippsEcommerce/Models/Api/VippsInitiatePaymentRequest.cs
new file mode 100644
index 0000000..2e8a040
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/VippsInitiatePaymentRequest.cs
@@ -0,0 +1,27 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class VippsInitiatePaymentRequest
+ {
+ /// <summary>
+ /// Gets or Sets CustomerInfo
+ /// </summary>
+ [JsonPropertyName("customerInfo")]
+ public TCustomerInfo CustomerInfo { get; set; }
+
+ /// <summary>
+ /// Gets or Sets MerchantInfo
+ /// </summary>
+ ///
+ [JsonPropertyName("merchantInfo")]
+ public TMerchantInfo MerchantInfo { get; set; }
+
+ /// <summary>
+ /// Gets or Sets Transaction
+ /// </summary>
+ [JsonPropertyName("transaction")]
+ public TTransactionInfoInitiate Transaction { get; set; }
+
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/VippsInitiatePaymentResponse.cs b/src/IOL.VippsEcommerce/Models/Api/VippsInitiatePaymentResponse.cs
new file mode 100644
index 0000000..471133a
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/VippsInitiatePaymentResponse.cs
@@ -0,0 +1,21 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class VippsInitiatePaymentResponse
+ {
+ /// <summary>
+ /// Id which uniquely identifies a payment. Maximum length is 50 alphanumeric characters: a-z, A-Z, 0-9 and &#x27;-&#x27;.
+ /// </summary>
+ /// <value>Id which uniquely identifies a payment. Maximum length is 50 alphanumeric characters: a-z, A-Z, 0-9 and &#x27;-&#x27;.</value>
+ [JsonPropertyName("orderId")]
+ public string OrderId { get; set; }
+
+ /// <summary>
+ /// URL to redirect the user to Vipps landing page or a deeplink URL to open Vipps app, if &#x60;isApp&#x60; was set as true. The landing page will also redirect a user to the app if the user is using a mobile browser. This link will timeout after 5 minutes. This example is a shortened deeplink URL. The URL received fromn Vipps should not be changed, and the format may change without notice.
+ /// </summary>
+ /// <value>URL to redirect the user to Vipps landing page or a deeplink URL to open Vipps app, if &#x60;isApp&#x60; was set as true. The landing page will also redirect a user to the app if the user is using a mobile browser. This link will timeout after 5 minutes. This example is a shortened deeplink URL. The URL received fromn Vipps should not be changed, and the format may change without notice.</value>
+ [JsonPropertyName("url")]
+ public string Url { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/VippsPaymentActionRequest.cs b/src/IOL.VippsEcommerce/Models/Api/VippsPaymentActionRequest.cs
new file mode 100644
index 0000000..f336bce
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/VippsPaymentActionRequest.cs
@@ -0,0 +1,19 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class VippsPaymentActionRequest
+ {
+ /// <summary>
+ /// Gets or Sets MerchantInfo
+ /// </summary>
+ [JsonPropertyName("merchantInfo")]
+ public TMerchantInfoPayment MerchantInfo { get; set; }
+
+ /// <summary>
+ /// Gets or Sets Transaction
+ /// </summary>
+ [JsonPropertyName("transaction")]
+ public TTransaction Transaction { get; set; }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/VippsPaymentActionResponse.cs b/src/IOL.VippsEcommerce/Models/Api/VippsPaymentActionResponse.cs
new file mode 100644
index 0000000..90b4389
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/VippsPaymentActionResponse.cs
@@ -0,0 +1,34 @@
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class VippsPaymentActionResponse
+ {
+ /// <summary>
+ /// Text which describes what instrument was used to complete the payment. Not included until a user has chosen and approved in the app.
+ /// </summary>
+ /// <value>Text which describes what instrument was used to complete the payment. Not included until a user has chosen and approved in the app.</value>
+ [JsonPropertyName("paymentInstrument")]
+ public string PaymentInstrument { get; set; }
+
+ /// <summary>
+ /// Id which uniquely identifies a payment. Maximum length is 50 alphanumeric characters: a-z, A-Z, 0-9 and &#x27;-&#x27;.
+ /// </summary>
+ /// <value>Id which uniquely identifies a payment. Maximum length is 50 alphanumeric characters: a-z, A-Z, 0-9 and &#x27;-&#x27;.</value>
+ [JsonPropertyName("orderId")]
+ public string OrderId { get; set; }
+
+ /// <summary>
+ /// Gets or Sets TransactionInfo
+ /// </summary>
+ [JsonPropertyName("transactionInfo")]
+ public TTransactionInfo TransactionInfo { get; set; }
+
+ /// <summary>
+ /// Gets or Sets TransactionSummary
+ /// </summary>
+ [JsonPropertyName("transactionSummary")]
+ public TTransactionSummary TransactionSummary { get; set; }
+
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/VippsPaymentInitiationCallbackResponse.cs b/src/IOL.VippsEcommerce/Models/Api/VippsPaymentInitiationCallbackResponse.cs
new file mode 100644
index 0000000..3b02536
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/VippsPaymentInitiationCallbackResponse.cs
@@ -0,0 +1,119 @@
+using System;
+using System.Text.Json.Serialization;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ public class VippsPaymentInitiationCallbackResponse
+ {
+ [JsonPropertyName("merchantSerialNumber")]
+ public string MerchantSerialNumber { get; set; }
+
+ [JsonPropertyName("orderId")]
+ public string OrderId { get; set; }
+
+ // [JsonPropertyName("shippingDetails")]
+ // public TShippingDetails? ShippingDetails { get; set; }
+
+ [JsonPropertyName("transactionInfo")]
+ public TTransactionInfo TransactionInfo { get; set; }
+
+ // [JsonPropertyName("userDetails")]
+ // public UserDetails? UserDetails { get; set; }
+ //
+ // [JsonPropertyName("errorInfo")]
+ // public TErrorInfo? ErrorInfo { get; set; }
+
+
+ public class TErrorInfo
+ {
+ [JsonPropertyName("errorGroup")]
+ public string ErrorGroup { get; set; }
+
+ [JsonPropertyName("errorCode")]
+ public string ErrorCode { get; set; }
+
+ [JsonPropertyName("errorMessage")]
+ public string ErrorMessage { get; set; }
+
+ [JsonPropertyName("contextId")]
+ public Guid ContextId { get; set; }
+ }
+
+ public class TShippingDetails
+ {
+ [JsonPropertyName("address")]
+ public TAddress Address { get; set; }
+
+ [JsonPropertyName("shippingCost")]
+ public int ShippingCost { get; set; }
+
+ [JsonPropertyName("shippingMethod")]
+ public string ShippingMethod { get; set; }
+
+ [JsonPropertyName("shippingMethodId")]
+ public string ShippingMethodId { get; set; }
+ }
+
+ public class TAddress
+ {
+ [JsonPropertyName("addressLine1")]
+ public string AddressLine1 { get; set; }
+
+ [JsonPropertyName("addressLine2")]
+ public string AddressLine2 { get; set; }
+
+ [JsonPropertyName("city")]
+ public string City { get; set; }
+
+ [JsonPropertyName("country")]
+ public string Country { get; set; }
+
+ [JsonPropertyName("zipCode")]
+ public string ZipCode { get; set; }
+ }
+
+ public class TTransactionInfo
+ {
+ [JsonPropertyName("amount")]
+ public int Amount { get; set; }
+
+ [JsonPropertyName("status")]
+ public string Status { get; set; }
+
+ public ETransactionStatus StatusEnum() => Enum.Parse<ETransactionStatus>(Status);
+
+ [JsonPropertyName("timeStamp")]
+ public DateTime TimeStamp { get; set; }
+
+ [JsonPropertyName("transactionId")]
+ public string TransactionId { get; set; }
+ }
+
+ public class TUserDetails
+ {
+ [JsonPropertyName("bankIdVerified")]
+ public string BankIdVerified { get; set; }
+
+ [JsonPropertyName("dateOfBirth")]
+ public string DateOfBirth { get; set; }
+
+ [JsonPropertyName("email")]
+ public string Email { get; set; }
+
+ [JsonPropertyName("firstName")]
+ public string FirstName { get; set; }
+
+ [JsonPropertyName("lastName")]
+ public string LastName { get; set; }
+
+ [JsonPropertyName("mobileNumber")]
+ public string MobileNumber { get; set; }
+
+ [JsonPropertyName("ssn")]
+ public string Ssn { get; set; }
+
+ [JsonPropertyName("userId")]
+ public string UserId { get; set; }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/IOL.VippsEcommerce/Models/Api/VippsRequestException.cs b/src/IOL.VippsEcommerce/Models/Api/VippsRequestException.cs
new file mode 100644
index 0000000..3a9b62a
--- /dev/null
+++ b/src/IOL.VippsEcommerce/Models/Api/VippsRequestException.cs
@@ -0,0 +1,18 @@
+using System;
+
+namespace IOL.VippsEcommerce.Models.Api
+{
+ [Serializable]
+ public class VippsRequestException : Exception
+ {
+ public VippsRequestException() { }
+
+ public VippsRequestException(string message)
+ : base(message) { }
+
+ public VippsRequestException(string message, Exception inner)
+ : base(message, inner) { }
+
+ public VippsErrorResponse ErrorResponse { get; set; }
+ }
+} \ No newline at end of file