Exemplo n.º 1
0
        public async Task <PaymentConfiguration> UpdatePaymentConfiguration(PaymentConfiguration paymentConfiguration)
        {
            // validate the payment configuration before saving.
            PayPalGateway.ValidateConfiguration(paymentConfiguration);
            PaymentConfiguration paymentConfig = await ApplicationDomain.Instance.PaymentConfigurationRepository.UpdateAsync(paymentConfiguration);

            return(paymentConfig);
        }
Exemplo n.º 2
0
        public async Task <PaymentConfiguration> UpdatePaymentConfiguration(PaymentConfiguration paymentConfiguration)
        {
            // validate the payment configuration before saving.
            PayPalGateway.ValidateConfiguration(paymentConfiguration);

            // check if branding configuration has been setup else don't create web experience profile.
            bool isBrandingConfigured = await ApplicationDomain.Instance.PortalBranding.IsConfiguredAsync();

            if (isBrandingConfigured)
            {
                // create a web experience profile using the branding for the web store.
                BrandingConfiguration brandConfig = await ApplicationDomain.Instance.PortalBranding.RetrieveAsync();

                paymentConfiguration.WebExperienceProfileId = PayPalGateway.CreateWebExperienceProfile(paymentConfiguration, brandConfig, ApplicationDomain.Instance.PortalLocalization.CountryIso2Code);
            }

            // Save the validated & complete payment configuration to repository.
            PaymentConfiguration paymentConfig = await ApplicationDomain.Instance.PaymentConfigurationRepository.UpdateAsync(paymentConfiguration);

            return(paymentConfig);
        }