public bool Pay(Order order, Payment payment)
        {
            var apiKey        = ConfigurationManager.GetValue("apiKey");
            var encriptionKey = ConfigurationManager.GetValue("encriptionKey");
            var serviceKey    = PaypalGateway.GetPaypalServiceKey(apiKey, encriptionKey);
            var cardHashKey   = PaypalGateway.GetCardHashKey(serviceKey, payment.CreditCard);
            var paymentResult = PaypalGateway.CommitTransaction(cardHashKey, order.ID.ToString(), payment.Value);

            return(paymentResult);
        }
コード例 #2
0
        public bool ExecutePayment(Order order, Payment payment)
        {
            var apiKey = _configurationManager.GetApiKey();
            var encKey = _configurationManager.GetEncriptionKey();

            var serviceKey  = _paypalGateway.GetServiceKey(apiKey, encKey);
            var cardHashKey = _paypalGateway.GetCardHashKey(serviceKey, payment.CreditCard);

            var paymentResult = _paypalGateway.CommitTransaction(cardHashKey, order.Id.ToString(), payment.Value);

            return(paymentResult);
        }