public override ProcessPaymentRequest GetPaymentInfo(FormCollection form)
        {
            var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext);
            var settings   = _settingService.LoadSetting <PayPalPlusBrasilPaymentSettings>(storeScope);
            var customer   = _customerService.GetCustomerById(_workContext.CurrentCustomer.Id);

            var paymentInfo = new ProcessPaymentRequest();

            paymentInfo.CustomValues = new Dictionary <string, object>();

            if (settings.Log)
            {
                _logger.InsertLog(LogLevel.Information, "Nop.Plugin.Payments.PayPalPlusBrasil.PaymentListenerResponse", form["ReturnPaymentPayPal"], customer);
            }

            var paymentListenerResponse = PaymentListenerResponse.FromJson(form["ReturnPaymentPayPal"]);

            if (!string.IsNullOrWhiteSpace(paymentListenerResponse.ResultListener.Term.MonthlyPayment.Value))
            {
                paymentInfo.CustomValues.Add("Parcelamento", paymentListenerResponse.ResultListener.Term.TermTerm.ToString() + "- X");
                paymentInfo.CustomValues.Add("Valor Parcela", paymentListenerResponse.ResultListener.Term.MonthlyPayment.Value);
                paymentInfo.CustomValues.Add("MOEDA", paymentListenerResponse.ResultListener.Term.MonthlyPayment.Currency);
            }

            paymentInfo.CustomValues.Add("PayerIdPayPal", paymentListenerResponse.ResultListener.Payer.PayerInfo.PayerId);
            paymentInfo.CustomValues.Add("PaymentIdPayPal", form["PaymentIdPayPal"]);

            AtualizarRememberedCard(paymentListenerResponse);

            return(paymentInfo);
        }
        private void AtualizarRememberedCard(PaymentListenerResponse paymentListenerResponse)
        {
            var customer = _customerService.GetCustomerById(_workContext.CurrentCustomer.Id);

            var customerPayPalPlus = _payPalPlusCustomerService.GetCustomerPayPalPlus(customer);

            if (customerPayPalPlus == null)
            {
                customerPayPalPlus = new CustomerPayPalPlus();
            }

            customerPayPalPlus.RememberedCards = paymentListenerResponse.ResultListener.RememberedCards;
            customerPayPalPlus.CustomerId      = _workContext.CurrentCustomer.Id;

            if (customerPayPalPlus.Id > 0)
            {
                _payPalPlusCustomerService.UpdateCustomer(customerPayPalPlus);
            }
            else
            {
                _payPalPlusCustomerService.InsertCustomer(customerPayPalPlus);
            }
        }