public async Task <IActionResult> RequestDemo(ConfigurationModel model)
        {
            if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManagePaymentMethods))
            {
                return(AccessDeniedView());
            }

            try
            {
                var customer = await _workContext.GetCurrentCustomerAsync();

                var fullName = await _customerService.GetCustomerFullNameAsync(customer);

                var request = new MerchantInfoRequest
                {
                    Email      = model.MerchantEmail,
                    ClientName = fullName,
                    Plugin     = Defaults.Api.UserAgent
                };
                var response = await _yuansferApi.RequestDemoAsync(request);

                _notificationService.SuccessNotification(await _localizationService.GetResourceAsync("Plugins.Payments.Yuansfer.Fields.MerchantEmail.Success"));
            }
            catch (Exception exception)
            {
                await _notificationService.ErrorNotificationAsync(exception);
            }

            return(await Configure());
        }
コード例 #2
0
        public Task <ApiResponse <MerchantInfoPayload> > RequestDemoAsync(MerchantInfoRequest request)
        {
            if (request is null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            return(PostAsync <ApiResponse <MerchantInfoPayload> >(Defaults.Api.RequestDemoUrl, request));
        }