Base solution for your next web application

Activities of "poolman"

Hi guys!

I know this is an old question, but it does not seem to have ever been addressed. The answer of "There is not server stats info in dashboard anymore" is obviously not a fix to the problem. I am trying to add an expanding/collapsing porlet to my application and I get the same issue as @mmukkara. I downloaded metronic from the downloads tab and copied over a porlet that expands/collapses correctly from the download, but does nothing on my dashboard. Any insight?

Answer

<ins>First few steps:</ins>

Using NuGet Package Manager install Stripe.net on the <ins>Core</ins> project We are using version 11.9.0

Adjust <ins>Web.Mvc</ins> Startup.cs to add StripeConfiguration

using Stripe;
...
public IServiceProvider ConfigureServices(IServiceCollection services)
{
      ...
      //Recaptcha
      services.AddRecaptcha(new RecaptchaOptions
      {
            SiteKey = _appConfiguration["Recaptcha:SiteKey"],
            SecretKey = _appConfiguration["Recaptcha:SecretKey"]
      });

      StripeConfiguration.SetApiKey(_appConfiguration["Payment:Stripe:ClientSecret"]);

      ...
}

Adjust <ins>Web.Mvc</ins> appsettings.json to allow for storage of keys You will add a section for Stripe under the Payment section. It will include a ClientId and a ClientSecret.

"Payment": {
    "PayPal": {
      "Environment": "sandbox",
      "BaseUrl": "https://api.sandbox.paypal.com/v1",
      "ClientId": "",
      "ClientSecret": "",
      "DemoUsername": "",
      "DemoPassword": ""
    },
    "Stripe": {
      "Environment": "sandbox",
      "ClientId": "<REPLACE>",
      "ClientSecret": "<REPLACE>"
    }
  }

Add to <ins>Core</ins> a MultiTenancy/Payments/Stripe/StripeConfiguration.cs

namespace WD2c.MultiTenancy.Payments.Stripe
{
    public class StripeConfiguration : ITransientDependency
    {
        private readonly IConfigurationRoot _appConfiguration;

        public string Environment => _appConfiguration["Payment:Stripe:Environment"];

        public string ClientId => _appConfiguration["Payment:Stripe:ClientId"];

        public string ClientSecret => _appConfiguration["Payment:Stripe:ClientSecret"];

        public StripeConfiguration(IAppConfigurationAccessor configurationAccessor)
        {
            _appConfiguration = configurationAccessor.Configuration;
        }
    }
}
Question

Hello all!

I have seen many people post about wanting an automatic recurring payment integration. We built one in ANZ using Stripe that allows for a choice between using Stripe and PayPal that is currently provided. Since I work for a startup, we decided to share some of our code and experience in doing this with the ANZ community (hopefully some other startups). Over the next few days I will post the code we used to make this happen.

We are currently using ANZ version 5.0.4 jQuery & MVC (seems to work with Core and 4.6.1). We have not done any work with the angular version. We have also switched our setup to use MySQL, so if you see code related to that it can be safely ignored (we will try to pull it out when posting).

We also assume you know how to set up a Stripe account, and therefore we will not cover that.

Please note: While we have spent some time working on this project, it is not yet in use on our production system. It seems to work, but there might be a few bugs floating around that we have not found yet. Since we are being nice enough to share our code with the community, if you find a bug please let us know. :D

You need to modify your VS2017 installation to include "Mobile development with .NET" which will install Xamarin.

@Mdonogma and @bolenton: Was busy the past 2 days, and just got a chance to look at my stripe integration. I need to make a few tweaks to use version ANZ v5, as it was originally developed on 4.1 and there are a few things that need to be adjusted. I will let you know when it is working so I can figure out a good way to share some code.

@ismcagdas: Stripe is a free product (comparable to PayPal). If you guys are interested, I'd be willing to talk with you about using my code to speed up a Stripe integration in your next sprint.

I agree about PayPal being useless without recurring. I wrote an integration into Stripe, which supports recurring payments, and allows you to choose between PayPal and Stripe in the Host admin. It was pretty simple, and collecting the payment and recurring billing is working, I just need to finish displaying the data back to the customer invoices.

I'd be willing to provide some guidance, or even share some of my code, assuming I can actually get my ANZ v5 to actually work so I can finish the last few pieces.

Can anybody actually log in with 5.0.2? Mine is a fresh download, and all it returns is a JSON string, but does't do the redirect.

{"result":null,"targetUrl":"/Account/ResetPassword?TenantId=1&UserId=2&ResetCode=4344B38F1D&ReturnUrl=%2FApp","success":true,"error":null,"unAuthorizedRequest":false,"__abp":true}

I have the same issue, but unclear if it actually has any impact. I usually just hit F5 to continue, and it seems to load the site with out any issues.

-Chris

<cite>ismcagdas: </cite> @strix20 is right. You can also use AutoMap attribute which provides two way binding.

Thank you both! I knew it was something stupid. :oops:

I am getting the following error when trying to edit my entity Customer"

AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.

Mapping types:
Customer -> CustomerEditDto

App Service

public async Task<GetCustomerForEditOutput> GetCustomerForEdit(NullableIdDto<Guid> input)
{
    var output = new GetCustomerForEditOutput{ };
    if (!input.Id.HasValue)
    {
        //Creating a new customer
        output.Customer = new CustomerEditDto
        {
            IsActive = true
        };
    }
    else
    {
        //Editing an existing customer
        var customer = await _customerRepository.GetAsync(input.Id.Value);
        output.Customer = ObjectMapper.Map<CustomerEditDto>(customer);
    }
    return output;
}

GetCustomerForEditOutput

public class GetCustomerForEditOutput
{
    public CustomerEditDto Customer { get; set; }
}

CustomerEditDto

[AutoMapTo(typeof(Customer))]
public class CustomerEditDto : IPassivable
{
    /// <summary>
    /// Set null to create a new customer. Set customer's Id to update a customer
    /// </summary>
    public Guid? Id { get; set; }

    [Required]
    [MaxLength(Customer.MaxFirstNameLength)]
    public virtual string FirstName { get; set; }

    [Required]
    [MaxLength(Customer.MaxLastNameLength)]
    public virtual string LastName { get; set; }

    [Required]
    [MaxLength(Customer.MaxEmailAddressLength)]
    public virtual string EmailAddress { get; set; }

    [Required]
    [MaxLength(Customer.MaxPhoneLength)]
    public virtual string Phone { get; set; }

    public bool IsActive { get; set; }
}

I have a feeling it is something stupid, but I just can't see it. Any help would be appreciated. :D

Showing 1 to 10 of 11 entries