aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorivar <i@oiee.no>2024-04-28 22:32:17 +0200
committerivar <i@oiee.no>2024-04-28 22:32:17 +0200
commit2cdb9549dda574fc91f44aecefe6c4620257f050 (patch)
tree47db78563681e51212bdba9e63ba55d2d61d54f4
parentd2ce924bb1575a6e56ee14b3b7a8a26006003398 (diff)
downloaddotnet-vipps-ecommerce-2cdb9549dda574fc91f44aecefe6c4620257f050.tar.xz
dotnet-vipps-ecommerce-2cdb9549dda574fc91f44aecefe6c4620257f050.zip
Remove unsupported fields
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/TMerchantInfo.cs14
-rw-r--r--src/IOL.VippsEcommerce/Models/Api/VippsPaymentInitiationCallbackResponse.cs154
2 files changed, 72 insertions, 96 deletions
diff --git a/src/IOL.VippsEcommerce/Models/Api/TMerchantInfo.cs b/src/IOL.VippsEcommerce/Models/Api/TMerchantInfo.cs
index 20b67b7..688dba9 100644
--- a/src/IOL.VippsEcommerce/Models/Api/TMerchantInfo.cs
+++ b/src/IOL.VippsEcommerce/Models/Api/TMerchantInfo.cs
@@ -6,13 +6,6 @@ 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>
@@ -20,13 +13,6 @@ public class TMerchantInfo
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>
diff --git a/src/IOL.VippsEcommerce/Models/Api/VippsPaymentInitiationCallbackResponse.cs b/src/IOL.VippsEcommerce/Models/Api/VippsPaymentInitiationCallbackResponse.cs
index 749dd66..8c612b8 100644
--- a/src/IOL.VippsEcommerce/Models/Api/VippsPaymentInitiationCallbackResponse.cs
+++ b/src/IOL.VippsEcommerce/Models/Api/VippsPaymentInitiationCallbackResponse.cs
@@ -5,114 +5,104 @@ namespace IOL.VippsEcommerce.Models.Api;
public class VippsPaymentInitiationCallbackResponse
{
- [JsonPropertyName("merchantSerialNumber")]
- public string MerchantSerialNumber { get; set; }
+ [JsonPropertyName("merchantSerialNumber")]
+ public string MerchantSerialNumber { get; set; }
- [JsonPropertyName("orderId")]
- public string OrderId { get; set; }
+ [JsonPropertyName("orderId")]
+ public string OrderId { get; set; }
- // [JsonPropertyName("shippingDetails")]
- // public TShippingDetails? ShippingDetails { get; set; }
+ [JsonPropertyName("transactionInfo")]
+ public TTransactionInfo TransactionInfo { get; set; }
- [JsonPropertyName("transactionInfo")]
- public TTransactionInfo TransactionInfo { get; set; }
+ public class TErrorInfo
+ {
+ [JsonPropertyName("errorGroup")]
+ public string ErrorGroup { get; set; }
- // [JsonPropertyName("userDetails")]
- // public UserDetails? UserDetails { get; set; }
- //
- // [JsonPropertyName("errorInfo")]
- // public TErrorInfo? ErrorInfo { get; set; }
+ [JsonPropertyName("errorCode")]
+ public string ErrorCode { get; set; }
+ [JsonPropertyName("errorMessage")]
+ public string ErrorMessage { get; set; }
- public class TErrorInfo
- {
- [JsonPropertyName("errorGroup")]
- public string ErrorGroup { get; set; }
+ [JsonPropertyName("contextId")]
+ public Guid ContextId { get; set; }
+ }
- [JsonPropertyName("errorCode")]
- public string ErrorCode { get; set; }
+ public class TShippingDetails
+ {
+ [JsonPropertyName("address")]
+ public TAddress Address { get; set; }
- [JsonPropertyName("errorMessage")]
- public string ErrorMessage { get; set; }
+ [JsonPropertyName("shippingCost")]
+ public int ShippingCost { get; set; }
- [JsonPropertyName("contextId")]
- public Guid ContextId { get; set; }
- }
+ [JsonPropertyName("shippingMethod")]
+ public string ShippingMethod { get; set; }
- public class TShippingDetails
- {
- [JsonPropertyName("address")]
- public TAddress Address { get; set; }
+ [JsonPropertyName("shippingMethodId")]
+ public string ShippingMethodId { get; set; }
+ }
- [JsonPropertyName("shippingCost")]
- public int ShippingCost { get; set; }
+ public class TAddress
+ {
+ [JsonPropertyName("addressLine1")]
+ public string AddressLine1 { get; set; }
- [JsonPropertyName("shippingMethod")]
- public string ShippingMethod { get; set; }
+ [JsonPropertyName("addressLine2")]
+ public string AddressLine2 { get; set; }
- [JsonPropertyName("shippingMethodId")]
- public string ShippingMethodId { get; set; }
- }
+ [JsonPropertyName("city")]
+ public string City { get; set; }
- public class TAddress
- {
- [JsonPropertyName("addressLine1")]
- public string AddressLine1 { get; set; }
+ [JsonPropertyName("country")]
+ public string Country { get; set; }
- [JsonPropertyName("addressLine2")]
- public string AddressLine2 { get; set; }
+ [JsonPropertyName("zipCode")]
+ public string ZipCode { get; set; }
+ }
- [JsonPropertyName("city")]
- public string City { get; set; }
+ public class TTransactionInfo
+ {
+ [JsonPropertyName("amount")]
+ public int Amount { get; set; }
- [JsonPropertyName("country")]
- public string Country { get; set; }
+ [JsonPropertyName("status")]
+ public string Status { get; set; }
- [JsonPropertyName("zipCode")]
- public string ZipCode { get; set; }
- }
+ public ETransactionStatus StatusEnum() => Enum.Parse<ETransactionStatus>(Status);
- public class TTransactionInfo
- {
- [JsonPropertyName("amount")]
- public int Amount { get; set; }
+ [JsonPropertyName("timeStamp")]
+ public DateTime TimeStamp { get; set; }
- [JsonPropertyName("status")]
- public string Status { get; set; }
+ [JsonPropertyName("transactionId")]
+ public string TransactionId { get; set; }
+ }
- public ETransactionStatus StatusEnum() => Enum.Parse<ETransactionStatus>(Status);
+ public class TUserDetails
+ {
+ [JsonPropertyName("bankIdVerified")]
+ public string BankIdVerified { get; set; }
- [JsonPropertyName("timeStamp")]
- public DateTime TimeStamp { get; set; }
+ [JsonPropertyName("dateOfBirth")]
+ public string DateOfBirth { get; set; }
- [JsonPropertyName("transactionId")]
- public string TransactionId { get; set; }
- }
+ [JsonPropertyName("email")]
+ public string Email { get; set; }
- public class TUserDetails
- {
- [JsonPropertyName("bankIdVerified")]
- public string BankIdVerified { get; set; }
+ [JsonPropertyName("firstName")]
+ public string FirstName { get; set; }
- [JsonPropertyName("dateOfBirth")]
- public string DateOfBirth { get; set; }
+ [JsonPropertyName("lastName")]
+ public string LastName { get; set; }
- [JsonPropertyName("email")]
- public string Email { get; set; }
+ [JsonPropertyName("mobileNumber")]
+ public string MobileNumber { get; set; }
- [JsonPropertyName("firstName")]
- public string FirstName { get; set; }
+ [JsonPropertyName("ssn")]
+ public string Ssn { 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; }
- }
+ [JsonPropertyName("userId")]
+ public string UserId { get; set; }
+ }
} \ No newline at end of file