Exemplo n.º 1
0
        public TransactionRegistrationResponse Send(RequestContext context, string vendorTxCode, ShoppingBasket basket,
                                                    Address billingAddress, Address deliveryAddress, string customerEmail)
        {
            string sagePayUrl      = configuration.RegistrationUrl;
            string notificationUrl = urlResolver.BuildNotificationUrl(context);

            var registration = new TransactionRegistration(
                vendorTxCode, basket, notificationUrl,
                billingAddress, deliveryAddress, customerEmail,
                configuration.VendorName);

            var serializer = new HttpPostSerializer();
            var postData   = serializer.Serialize(registration);

            var response = requestSender.SendRequest(sagePayUrl, postData);

            var deserializer = new ResponseSerializer();

            return(deserializer.Deserialize <TransactionRegistrationResponse>(response));
        }
Exemplo n.º 2
0
        public TransactionRegistrationResponse Send(RequestContext context, string vendorTxCode, ShoppingBasket basket,
                                                    Address billingAddress, Address deliveryAddress, string customerEmail, PaymentFormProfile paymentFormProfile = PaymentFormProfile.Normal, string currencyCode = "GBP",
                                                    MerchantAccountType accountType = MerchantAccountType.Ecommerce, TxType txType = TxType.Payment)
        {
            string sagePayUrl      = configuration.RegistrationUrl;
            string notificationUrl = urlResolver.BuildNotificationUrl(context);

            var registration = new TransactionRegistration(
                vendorTxCode, basket, notificationUrl,
                billingAddress, deliveryAddress, customerEmail,
                configuration.VendorName,
                paymentFormProfile, currencyCode, accountType, txType);

            var serializer = new HttpPostSerializer();
            var postData   = serializer.Serialize(registration);

            var response = requestSender.SendRequest(sagePayUrl, postData);

            var deserializer = new ResponseSerializer();

            return(deserializer.Deserialize <TransactionRegistrationResponse>(response));
        }