From 0467ad377f83f13c730a5d0e7b5def01fd9ef95e Mon Sep 17 00:00:00 2001 From: Iulian Masar Date: Fri, 12 Jul 2024 17:14:04 +0300 Subject: [PATCH] added new params --- MangoPay.SDK.Tests/BaseTest.cs | 2 ++ MangoPay.SDK/Entities/GET/CardPreAuthorizationDTO.cs | 7 +++++++ MangoPay.SDK/Entities/GET/CardValidationDTO.cs | 7 +++++++ MangoPay.SDK/Entities/GET/PayInCardDirectDTO.cs | 7 +++++++ MangoPay.SDK/Entities/GET/RefundDTO.cs | 6 ++++++ .../Entities/POST/CardPreAuthorizationPostDTO.cs | 11 ++++++++++- MangoPay.SDK/Entities/POST/CardValidationPostDTO.cs | 10 +++++++++- MangoPay.SDK/Entities/POST/PayInCardDirectPostDTO.cs | 12 +++++++++++- MangoPay.SDK/Entities/POST/RefundPayInPostDTO.cs | 10 +++++++++- 9 files changed, 68 insertions(+), 4 deletions(-) diff --git a/MangoPay.SDK.Tests/BaseTest.cs b/MangoPay.SDK.Tests/BaseTest.cs index 4dd17b9..7b92d6b 100644 --- a/MangoPay.SDK.Tests/BaseTest.cs +++ b/MangoPay.SDK.Tests/BaseTest.cs @@ -494,6 +494,8 @@ protected async Task GetNewPayInCardDirectWithBilling(string var payIn = await GetPayInCardDirectPost(userId, idempotencyKey); payIn.Billing = billing; + payIn.PaymentCategory = "ECommerce"; + return await this.Api.PayIns.CreateCardDirectAsync(payIn); } diff --git a/MangoPay.SDK/Entities/GET/CardPreAuthorizationDTO.cs b/MangoPay.SDK/Entities/GET/CardPreAuthorizationDTO.cs index 75116c8..58cfb43 100644 --- a/MangoPay.SDK/Entities/GET/CardPreAuthorizationDTO.cs +++ b/MangoPay.SDK/Entities/GET/CardPreAuthorizationDTO.cs @@ -87,5 +87,12 @@ public class CardPreAuthorizationDTO : EntityBase public string Applied3DSVersion { get; set; } public CardInfo CardInfo { get; set; } + + /// + /// The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments: + /// ECommerce – Payment received online. + /// TelephoneOrder – Payment received via mail order or telephone order (MOTO). + /// + public string PaymentCategory { get; set; } } } diff --git a/MangoPay.SDK/Entities/GET/CardValidationDTO.cs b/MangoPay.SDK/Entities/GET/CardValidationDTO.cs index a5438a7..d12092b 100644 --- a/MangoPay.SDK/Entities/GET/CardValidationDTO.cs +++ b/MangoPay.SDK/Entities/GET/CardValidationDTO.cs @@ -62,5 +62,12 @@ public class CardValidationDTO : EntityBase /// Secure mode. [JsonConverter(typeof(StringEnumConverter))] public SecureMode? SecureMode { get; set; } + + /// + /// The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments: + /// ECommerce – Payment received online. + /// TelephoneOrder – Payment received via mail order or telephone order (MOTO). + /// + public string PaymentCategory { get; set; } } } \ No newline at end of file diff --git a/MangoPay.SDK/Entities/GET/PayInCardDirectDTO.cs b/MangoPay.SDK/Entities/GET/PayInCardDirectDTO.cs index 1576c5d..e7e3a1f 100644 --- a/MangoPay.SDK/Entities/GET/PayInCardDirectDTO.cs +++ b/MangoPay.SDK/Entities/GET/PayInCardDirectDTO.cs @@ -40,5 +40,12 @@ public class PayInCardDirectDTO : PayInDTO public string IpAddress { get; set; } public CardInfo CardInfo { get; set; } + + /// + /// The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments: + /// ECommerce – Payment received online. + /// TelephoneOrder – Payment received via mail order or telephone order (MOTO). + /// + public string PaymentCategory { get; set; } } } diff --git a/MangoPay.SDK/Entities/GET/RefundDTO.cs b/MangoPay.SDK/Entities/GET/RefundDTO.cs index 05724e5..01f1bbe 100644 --- a/MangoPay.SDK/Entities/GET/RefundDTO.cs +++ b/MangoPay.SDK/Entities/GET/RefundDTO.cs @@ -63,5 +63,11 @@ public class RefundDTO : EntityBase public RefundReason RefundReason { get; set; } public string Reference { get; set; } + + /// + /// Custom description to appear on the user’s bank statement along with the platform name. + /// Note that a particular bank may show more or less information. + /// + public string StatementDescriptor { get; set; } } } diff --git a/MangoPay.SDK/Entities/POST/CardPreAuthorizationPostDTO.cs b/MangoPay.SDK/Entities/POST/CardPreAuthorizationPostDTO.cs index d71fc4f..68a57f5 100644 --- a/MangoPay.SDK/Entities/POST/CardPreAuthorizationPostDTO.cs +++ b/MangoPay.SDK/Entities/POST/CardPreAuthorizationPostDTO.cs @@ -8,7 +8,8 @@ namespace MangoPay.SDK.Entities.POST /// Card pre-authorization POST entity. public class CardPreAuthorizationPostDTO : EntityPostBase { - public CardPreAuthorizationPostDTO(string authorId, Money debitedFunds, SecureMode secureMode, string cardId, string secureModeReturnURL, string statementDescriptor = null) + public CardPreAuthorizationPostDTO(string authorId, Money debitedFunds, SecureMode secureMode, string cardId, + string secureModeReturnURL, string statementDescriptor = null, string paymentCategory = null) { AuthorId = authorId; DebitedFunds = debitedFunds; @@ -16,6 +17,7 @@ public CardPreAuthorizationPostDTO(string authorId, Money debitedFunds, SecureMo CardId = cardId; SecureModeReturnURL = secureModeReturnURL; StatementDescriptor = statementDescriptor; + PaymentCategory = paymentCategory; } /// Author identifier. @@ -60,5 +62,12 @@ public CardPreAuthorizationPostDTO(string authorId, Money debitedFunds, SecureMo public string IpAddress { get; set; } public string Requested3DSVersion { get; set; } + + /// + /// The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments: + /// ECommerce – Payment received online. + /// TelephoneOrder – Payment received via mail order or telephone order (MOTO). + /// + public string PaymentCategory { get; set; } } } diff --git a/MangoPay.SDK/Entities/POST/CardValidationPostDTO.cs b/MangoPay.SDK/Entities/POST/CardValidationPostDTO.cs index d073507..8a89db5 100644 --- a/MangoPay.SDK/Entities/POST/CardValidationPostDTO.cs +++ b/MangoPay.SDK/Entities/POST/CardValidationPostDTO.cs @@ -7,7 +7,7 @@ namespace MangoPay.SDK.Entities.POST public class CardValidationPostDTO: EntityPostBase { public CardValidationPostDTO(string authorId, string secureModeReturnUrl, string ipAddress, BrowserInfo browserInfo, - string tag = null, SecureMode? secureMode = null) + string tag = null, SecureMode? secureMode = null, string paymentCategory = null) { AuthorId = authorId; SecureModeReturnUrl = secureModeReturnUrl; @@ -15,6 +15,7 @@ public CardValidationPostDTO(string authorId, string secureModeReturnUrl, string BrowserInfo = browserInfo; Tag = tag; SecureMode = secureMode; + PaymentCategory = paymentCategory; } /// The unique identifier of the user at the source of the transaction. @@ -33,5 +34,12 @@ public CardValidationPostDTO(string authorId, string secureModeReturnUrl, string /// Secure mode. [JsonConverter(typeof(StringEnumConverter))] public SecureMode? SecureMode { get; set; } + + /// + /// The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments: + /// ECommerce – Payment received online. + /// TelephoneOrder – Payment received via mail order or telephone order (MOTO). + /// + public string PaymentCategory { get; set; } } } \ No newline at end of file diff --git a/MangoPay.SDK/Entities/POST/PayInCardDirectPostDTO.cs b/MangoPay.SDK/Entities/POST/PayInCardDirectPostDTO.cs index 6410d40..f4d76cb 100644 --- a/MangoPay.SDK/Entities/POST/PayInCardDirectPostDTO.cs +++ b/MangoPay.SDK/Entities/POST/PayInCardDirectPostDTO.cs @@ -9,7 +9,9 @@ namespace MangoPay.SDK.Entities.POST /// PayIn card direct POST entity. public class PayInCardDirectPostDTO : EntityPostBase { - public PayInCardDirectPostDTO(string authorId, string creditedUserId, Money debitedFunds, Money fees, string creditedWalletId, string secureModeReturnURL, string cardId, string statementDescriptor = null, Billing billing = null, BrowserInfo bInfo = null) + public PayInCardDirectPostDTO(string authorId, string creditedUserId, Money debitedFunds, Money fees, + string creditedWalletId, string secureModeReturnURL, string cardId, string statementDescriptor = null, + Billing billing = null, BrowserInfo bInfo = null, string paymentCategory = null) { AuthorId = authorId; CreditedUserId = creditedUserId; @@ -21,6 +23,7 @@ public PayInCardDirectPostDTO(string authorId, string creditedUserId, Money debi StatementDescriptor = statementDescriptor; Billing = Billing; BrowserInfo = bInfo; + PaymentCategory = paymentCategory; } /// Author identifier. @@ -70,5 +73,12 @@ public PayInCardDirectPostDTO(string authorId, string creditedUserId, Money debi public string IpAddress { get; set; } public string Requested3DSVersion { get; set; } + + /// + /// The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments: + /// ECommerce – Payment received online. + /// TelephoneOrder – Payment received via mail order or telephone order (MOTO). + /// + public string PaymentCategory { get; set; } } } diff --git a/MangoPay.SDK/Entities/POST/RefundPayInPostDTO.cs b/MangoPay.SDK/Entities/POST/RefundPayInPostDTO.cs index f54684e..435f08d 100644 --- a/MangoPay.SDK/Entities/POST/RefundPayInPostDTO.cs +++ b/MangoPay.SDK/Entities/POST/RefundPayInPostDTO.cs @@ -14,12 +14,14 @@ public RefundPayInPostDTO(string authorId) AuthorId = authorId; } - public RefundPayInPostDTO(string authorId, Money fees, Money debitedFunds, string reference = null) + public RefundPayInPostDTO(string authorId, Money fees, Money debitedFunds, string reference = null, + string statementDescriptor = null) { AuthorId = authorId; Fees = fees; DebitedFunds = debitedFunds; Reference = reference; + StatementDescriptor = statementDescriptor; } /// Author identifier. @@ -32,5 +34,11 @@ public RefundPayInPostDTO(string authorId, Money fees, Money debitedFunds, strin public Money Fees { get; set; } public string Reference { get; set; } + + /// + /// Custom description to appear on the user’s bank statement along with the platform name. + /// Note that a particular bank may show more or less information. + /// + public string StatementDescriptor { get; set; } } }