示例#1
0
        private async Task <ResponseGateway> InsertPaymentGateway(Payment valPayment)
        {
            ResponseGateway vResult = new ResponseGateway();

            try {
                PaymentGateway vPaymentGateway = InstanceTransaction();
                GatewayService vGatewayService = new GatewayService();
                ICurrencyData  vCurrency       = new CurrencyData();
                vPaymentGateway.transaction.creditCard.name                          = valPayment.FirstName + " " + valPayment.LastName;
                vPaymentGateway.transaction.creditCard.name                          = "APPROVED";
                vPaymentGateway.transaction.creditCard.number                        = valPayment.CardNumber;
                vPaymentGateway.transaction.creditCard.expirationDate                = valPayment.Year + "/" + valPayment.Month;
                vPaymentGateway.transaction.creditCard.securityCode                  = valPayment.SecurityCode;
                vPaymentGateway.transaction.order.additionalValues.TX_VALUE.value    = valPayment.TotalMount;
                vPaymentGateway.transaction.order.additionalValues.TX_VALUE.value    = 100;
                vPaymentGateway.transaction.order.additionalValues.TX_VALUE.currency = vCurrency.SelectById(valPayment.IdCurrency).Code;
                //vPaymentGateway.transaction.order.additionalValues.TX_VALUE.currency = vCurrency.SelectById(Guid.Parse("2AC154DA-120F-4BBA-B4E2-DB728AC89DA0")).Code;
                vPaymentGateway.transaction.paymentMethod = valPayment.PayMethod;
                //vPaymentGateway.transaction.paymentMethod = "VISA";
                vResult = await vGatewayService.Create(vPaymentGateway);
            } catch (Exception) {
            }
            return(vResult);
        }