Example #1
0
        public async Task <GetMerchantPaymentMethodsResponse> GetMerchantPaymentMethods(
            string clientRequestId,
            string currencyCode           = null,
            string countryCode            = null,
            string languageCode           = null,
            string type                   = null,
            string userId                 = null,
            DeviceDetails deviceDetails   = null,
            string rebillingType          = null,
            string authenticationTypeOnly = null,
            SubMerchant subMerchant       = null,
            Addendums addendums           = null)
        {
            var request = new GetMerchantPaymentMethodsRequest(
                merchantInfo,
                sessionToken,
                clientRequestId)
            {
                CurrencyCode           = currencyCode,
                CountryCode            = countryCode,
                LanguageCode           = languageCode,
                Type                   = type,
                UserId                 = userId,
                DeviceDetails          = deviceDetails,
                RebillingType          = rebillingType,
                AuthenticationTypeOnly = authenticationTypeOnly,
                SubMerchant            = subMerchant,
                Addendums              = addendums
            };

            return(await safechargeRequestExecutor.GetMerchantPaymentMethods(request));
        }
Example #2
0
        public async Task <GetCardDetailsResponse> GetCardDetails(
            string clientUniqueId,
            string cardNumber,
            string userId = null,
            DeviceDetails deviceDetails   = null,
            string rebillingType          = null,
            string authenticationTypeOnly = null,
            SubMerchant subMerchant       = null,
            Addendums addendums           = null)
        {
            var request = new GetCardDetailsRequest(
                merchantInfo,
                sessionToken,
                clientUniqueId,
                cardNumber)
            {
                UserId                 = userId,
                DeviceDetails          = deviceDetails,
                RebillingType          = rebillingType,
                AuthenticationTypeOnly = authenticationTypeOnly,
                SubMerchant            = subMerchant,
                Addendums              = addendums
            };

            return(await safechargeRequestExecutor.GetCardDetails(request));
        }
Example #3
0
        public async Task <Authorize3dResponse> Authorize3d(
            string currency,
            string amount,
            PaymentOption paymentOption,
            string relatedTransactionId,
            List <Item> items                   = null,
            string userTokenId                  = null,
            string clientUniqueId               = null,
            string clientRequestId              = null,
            int?isRebilling                     = null,
            AmountDetails amountDetails         = null,
            DeviceDetails deviceDetails         = null,
            CashierUserDetails userDetails      = null,
            UserAddress shippingAddress         = null,
            UserAddress billingAddress          = null,
            DynamicDescriptor dynamicDescriptor = null,
            MerchantDetails merchantDetails     = null,
            Addendums addendums                 = null,
            UrlDetails urlDetails               = null,
            string customSiteName               = null,
            string productId                    = null,
            string customData                   = null,
            string transactionType              = null,
            bool autoPayment3D                  = default,
            string userId                 = null,
            string rebillingType          = null,
            string authenticationTypeOnly = null,
            SubMerchant subMerchant       = null)
        {
            var request = new Authorize3dRequest(merchantInfo, sessionToken, currency, amount, paymentOption, relatedTransactionId)
            {
                Items                  = items,
                UserTokenId            = userTokenId,
                ClientRequestId        = clientRequestId,
                ClientUniqueId         = clientUniqueId,
                IsRebilling            = isRebilling,
                AmountDetails          = amountDetails,
                DeviceDetails          = deviceDetails,
                UserDetails            = userDetails,
                ShippingAddress        = shippingAddress,
                BillingAddress         = billingAddress,
                DynamicDescriptor      = dynamicDescriptor,
                MerchantDetails        = merchantDetails,
                Addendums              = addendums,
                UrlDetails             = urlDetails,
                CustomSiteName         = customSiteName,
                ProductId              = productId,
                CustomData             = customData,
                TransactionType        = transactionType,
                AutoPayment3D          = autoPayment3D,
                UserId                 = userId,
                RebillingType          = rebillingType,
                AuthenticationTypeOnly = authenticationTypeOnly,
                SubMerchant            = subMerchant
            };

            return(await safechargeRequestExecutor.Authorize3d(request));
        }
Example #4
0
        public async Task <SettleTransactionResponse> SettleTransaction(
            string currency,
            string amount,
            string relatedTransactionId,
            string clientUniqueId               = null,
            string clientRequestId              = null,
            string userId                       = null,
            Addendums addendums                 = null,
            string descriptorMerchantName       = null,
            string descriptorMerchantPhone      = null,
            DynamicDescriptor dynamicDescriptor = null,
            UrlDetails urlDetails               = null,
            string authCode                     = null,
            string customData                   = null,
            string comment                      = null,
            string customSiteName               = null,
            string productId                    = null,
            DeviceDetails deviceDetails         = null,
            string rebillingType                = null,
            string authenticationTypeOnly       = null,
            SubMerchant subMerchant             = null)
        {
            var request = new SettleTransactionRequest(
                merchantInfo,
                sessionToken,
                currency,
                amount,
                relatedTransactionId)
            {
                AuthCode                = authCode,
                ClientUniqueId          = clientUniqueId,
                ClientRequestId         = clientRequestId,
                UserId                  = userId,
                Addendums               = addendums,
                DescriptorMerchantName  = dynamicDescriptor?.MerchantName ?? descriptorMerchantName,
                DescriptorMerchantPhone = dynamicDescriptor?.MerchantPhone ?? descriptorMerchantPhone,
                UrlDetails              = urlDetails,
                CustomData              = customData,
                Comment                 = comment,
                CustomSiteName          = customSiteName,
                ProductId               = productId,
                DeviceDetails           = deviceDetails,
                RebillingType           = rebillingType,
                AuthenticationTypeOnly  = authenticationTypeOnly,
                SubMerchant             = subMerchant
            };

            return(await safechargeRequestExecutor.SettleTransaction(request));
        }
Example #5
0
        private static List <IOfficialDocument> GetAddendums(IOfficialDocument document)
        {
            var addendaList = new List <IOfficialDocument>()
            {
            };
            var leadingDocuments = new List <IOfficialDocument>()
            {
                document
            };

            while (Addendums.GetAll(a => leadingDocuments.Contains(a.LeadingDocument)).Any())
            {
                leadingDocuments = OfficialDocuments.GetAll(a => Addendums.Is(a) && leadingDocuments.Contains(a.LeadingDocument)).ToList();
                addendaList.AddRange(leadingDocuments);
            }

            return(addendaList);
        }
Example #6
0
        public async Task <PayoutResponse> Payout(
            string userTokenId,
            string clientUniqueId,
            string amount,
            string currency,
            UserPaymentOption userPaymentOption,
            string comment = null,
            DynamicDescriptor dynamicDescriptor = null,
            MerchantDetails merchantDetails     = null,
            UrlDetails urlDetails       = null,
            DeviceDetails deviceDetails = null,
            CardData cardData           = null,
            string userId                 = null,
            string rebillingType          = null,
            string authenticationTypeOnly = null,
            SubMerchant subMerchant       = null,
            Addendums addendums           = null)
        {
            var request = new PayoutRequest(
                merchantInfo,
                sessionToken,
                userTokenId,
                clientUniqueId,
                amount,
                currency,
                userPaymentOption)
            {
                Comment                = comment,
                DynamicDescriptor      = dynamicDescriptor,
                MerchantDetails        = merchantDetails,
                UrlDetails             = urlDetails,
                DeviceDetails          = deviceDetails,
                CardData               = cardData,
                UserId                 = userId,
                RebillingType          = rebillingType,
                AuthenticationTypeOnly = authenticationTypeOnly,
                SubMerchant            = subMerchant,
                Addendums              = addendums
            };

            return(await safechargeRequestExecutor.Payout(request));
        }
Example #7
0
        public async Task <Verify3dResponse> Verify3d(
            string currency,
            string amount,
            Verify3dPaymentOption paymentOption,
            string relatedTransactionId,
            string clientUniqueId           = null,
            string clientRequestId          = null,
            UserAddress billingAddress      = null,
            string customData               = null,
            string customSiteName           = null,
            MerchantDetails merchantDetails = null,
            SubMerchant subMerchant         = null,
            string userId                 = null,
            string userTokenId            = null,
            DeviceDetails deviceDetails   = null,
            string rebillingType          = null,
            string authenticationTypeOnly = null,
            Addendums addendums           = null)
        {
            var request = new Verify3dRequest(merchantInfo, sessionToken, currency, amount, paymentOption, relatedTransactionId)
            {
                UserId                 = userId,
                UserTokenId            = userTokenId,
                ClientRequestId        = clientRequestId,
                ClientUniqueId         = clientUniqueId,
                SubMerchant            = subMerchant,
                BillingAddress         = billingAddress,
                MerchantDetails        = merchantDetails,
                CustomSiteName         = customSiteName,
                CustomData             = customData,
                DeviceDetails          = deviceDetails,
                RebillingType          = rebillingType,
                AuthenticationTypeOnly = authenticationTypeOnly,
                Addendums              = addendums
            };

            return(await safechargeRequestExecutor.Verify3d(request));
        }
Example #8
0
        public async Task <InitPaymentResponse> InitPayment(
            string currency,
            string amount,
            InitPaymentPaymentOption paymentOption,
            string userTokenId          = null,
            string clientUniqueId       = null,
            string clientRequestId      = null,
            DeviceDetails deviceDetails = null,
            UrlDetails urlDetails       = null,
            string customData           = null,
            UserAddress billingAddress  = null,
            string userId                 = null,
            string rebillingType          = null,
            string authenticationTypeOnly = null,
            SubMerchant subMerchant       = null,
            Addendums addendums           = null,
            string orderId                = null)
        {
            var request = new InitPaymentRequest(merchantInfo, sessionToken, currency, amount, paymentOption)
            {
                UserTokenId            = userTokenId,
                ClientRequestId        = clientRequestId,
                ClientUniqueId         = clientUniqueId,
                DeviceDetails          = deviceDetails,
                UrlDetails             = urlDetails,
                CustomData             = customData,
                BillingAddress         = billingAddress,
                UserId                 = userId,
                RebillingType          = rebillingType,
                AuthenticationTypeOnly = authenticationTypeOnly,
                SubMerchant            = subMerchant,
                Addendums              = addendums,
                OrderId                = orderId
            };

            return(await safechargeRequestExecutor.InitPayment(request));
        }
 public static IAddendum Create()
 {
     return(Addendums.Create());
 }
Example #10
0
 public virtual void CompaniesRfcEmitterAddendumsPost([FromRoute] string rfcEmitter, [FromBody] Addendums body)
 {
     throw new NotImplementedException();
 }
Example #11
0
        public async Task <OpenOrderResponse> OpenOrder(

            string currency,
            string amount,
            List <Item> items = null,
            OpenOrderPaymentOption paymentOption = null,
            UserPaymentOption userPaymentOption  = null,
            string paymentMethod                = null,
            string userTokenId                  = null,
            string clientUniqueId               = null,
            string clientRequestId              = null,
            string userId                       = null,
            string authenticationTypeOnly       = null,
            AmountDetails amountDetails         = null,
            DeviceDetails deviceDetails         = null,
            CashierUserDetails userDetails      = null,
            UserAddress shippingAddress         = null,
            UserAddress billingAddress          = null,
            DynamicDescriptor dynamicDescriptor = null,
            MerchantDetails merchantDetails     = null,
            Addendums addendums                 = null,
            UrlDetails urlDetails               = null,
            string customSiteName               = null,
            string productId                    = null,
            string customData                   = null,
            string transactionType              = null,
            string isMoto                       = null,
            string isRebilling                  = null,
            string rebillingType                = null,
            SubMerchant subMerchant             = null)
        {
            var request = new OpenOrderRequest(merchantInfo, sessionToken, currency, amount)
            {
                Items                  = items,
                PaymentOption          = paymentOption,
                UserPaymentOption      = userPaymentOption,
                PaymentMethod          = paymentMethod,
                UserTokenId            = userTokenId,
                ClientRequestId        = clientRequestId,
                ClientUniqueId         = clientUniqueId,
                UserId                 = userId,
                AuthenticationTypeOnly = authenticationTypeOnly,
                AmountDetails          = amountDetails,
                DeviceDetails          = deviceDetails,
                UserDetails            = userDetails,
                ShippingAddress        = shippingAddress,
                BillingAddress         = billingAddress,
                DynamicDescriptor      = dynamicDescriptor,
                MerchantDetails        = merchantDetails,
                Addendums              = addendums,
                UrlDetails             = urlDetails,
                CustomSiteName         = customSiteName,
                ProductId              = productId,
                CustomData             = customData,
                TransactionType        = transactionType,
                IsMoto                 = isMoto,
                IsRebilling            = isRebilling,
                RebillingType          = rebillingType,
                SubMerchant            = subMerchant
            };

            return(await safechargeRequestExecutor.OpenOrder(request));
        }
Example #12
0
 public Addendum GetAddendumById(int id)
 {
     return(Addendums
            .Single(a => a.Id == id));
 }
Example #13
0
 public IEnumerable <Addendum> GetAddendums()
 {
     return(Addendums
            .ToList());
 }
        public void TestGetAndSetModelAddendums()
        {
            var addendums = new Addendums
            {
                LocalPayment = new AddendumsLocalPayment
                {
                    NationalId            = "FRA",
                    DebitType             = "instalments",
                    FirstInstallment      = "11",
                    PeriodicalInstallment = "11",
                    NumberOfInstallments  = "121"
                },
                CardPresentPointOfSale = new AddendumsCardPresentPointOfSale
                {
                    TerminalId           = "",
                    TrackData            = "",
                    TrackType            = "",
                    Icc                  = "",
                    PinData              = "",
                    EntryMode            = "",
                    TerminalCapability   = "",
                    TerminalAttendance   = "",
                    CardSequenceNum      = "",
                    OfflineResCode       = "",
                    LocalTime            = "",
                    LocalDate            = "",
                    CvMethod             = "",
                    CvEntity             = "",
                    OutputCapability     = "",
                    AutoReversal         = "",
                    AutoReversalAmount   = "",
                    AutoReversalCurrency = "",
                    Channel              = "",
                    SuppressAuth         = "",
                    TerminalCity         = "",
                    TerminalAddress      = "",
                    TerminalCountry      = "",
                    TerminalZip          = "",
                    TerminalState        = "",
                    TerminalModel        = "",
                    TerminalManufacturer = "",
                    TerminalMacAddress   = "",
                    TerminalKernel       = "",
                    TerminalImei         = "",
                    MobileTerminal       = "",
                    TerminalType         = "",
                    SecurityControl      = ""
                },
                Airlines = new AddendumsAirlines
                {
                    ReservationDetails = new AddendumsAirlinesReservationDetails
                    {
                        AddendumSent                  = "",
                        PnrCode                       = "",
                        BookingSystemUniqueId         = "",
                        ComputerizedReservationSystem = "",
                        TicketNumber                  = "",
                        DocumentType                  = "",
                        FlightDateUTC                 = "",
                        IssueDate                     = "",
                        TravelAgencyCode              = "",
                        TravelAgencyName              = "",
                        TravelAgencyInvoiceNumber     = "",
                        TravelAgencyPlanName          = "",
                        RestrictedTicketIndicator     = "",
                        IssuingCarrierCode            = "",
                        IsCardholderTraveling         = "",
                        PassengersCount               = "",
                        InfantsCount                  = "",
                        PayerPassportId               = "",
                        TotalFare                     = "",
                        TotalTaxes                    = "",
                        TotalFee                      = "",
                        BoardingFee                   = "",
                        TicketIssueAddress            = "",
                        PassengerDetails              = new List <AddendumsAirlinesPassengerDetails>
                        {
                            new AddendumsAirlinesPassengerDetails
                            {
                                PassangerId       = "",
                                PassportNumber    = "",
                                CustomerCode      = "",
                                FrequentFlyerCode = "",
                                Title             = "",
                                FirstName         = "",
                                LastName          = "",
                                MiddleName        = "",
                                DateOfBirth       = "",
                                PhoneNumber       = ""
                            }
                        },
                        FlightLegDetails = new List <AddendumsAirlinesFlightLegDetails>
                        {
                            new AddendumsAirlinesFlightLegDetails
                            {
                                FlightLegId        = "",
                                AirlineCode        = "",
                                FlightNumber       = "",
                                DepartureDate      = "",
                                ArrivalDate        = "",
                                DepartureCountry   = "",
                                DepartureCity      = "",
                                DepartureAirport   = "",
                                DestinationCountry = "",
                                DestinationCity    = "",
                                DestinationAirport = "",
                                Type                    = "",
                                FlightType              = "",
                                TicketDeliveryMethod    = "",
                                TicketDeliveryRecipient = "",
                                FareBasisCode           = "",
                                ServiceClass            = "",
                                SeatClass               = "",
                                StopOverCode            = "",
                                DepartureTaxAmount      = "",
                                DepartureTaxCurrency    = "",
                                FareAmount              = "",
                                FeeAmount               = "",
                                TaxAmount               = "",
                                LayoutIntegererval      = ""
                            }
                        }
                    }
                }
            };

            var paymentRequest = new PaymentRequest(merchantInfo, sessionToken, currency, amount, paymentOptionCard)
            {
                Addendums = addendums
            };
            var paymentResponse = requestExecutor.Payment(paymentRequest).GetAwaiter().GetResult();

            Assert.IsNotNull(paymentResponse);
            Assert.IsEmpty(paymentResponse.Reason);
            Assert.AreEqual(ResponseStatus.Success, paymentResponse.Status);
        }