PayPal plugin improvement contribution

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 năm cách đây
The PayPal Direct plugin doesn't currently have expire month and year as required. Code required

Nop.Plugin.Payments.PayPalDirect\Controllers\PaymentPayPalDirectController.cs
-Changes in bold
  [NonAction]
        public override IList<string> ValidatePaymentForm(FormCollection form)
        {
            var warnings = new List<string>();

            //validate
            var validator = new PaymentInfoValidator(_localizationService);
            var model = new PaymentInfoModel()
            {
                CardholderName = form["CardholderName"],
                CardNumber = form["CardNumber"],
                CardCode = form["CardCode"],
                ExpireMonth = form["ExpireMonth"],
                ExpireYear = form["ExpireYear"]

                
            };
            var validationResult = validator.Validate(model);
            if (!validationResult.IsValid)
                foreach (var error in validationResult.Errors)
                    warnings.Add(error.ErrorMessage);
            return warnings;
        }



Nop.Plugin.Payments.PayPalDirect\Validators\PaymentInfoValidator.cs
-Add these 2 rules
RuleFor(x => x.ExpireMonth).NotEmpty() .WithMessage(localizationService.GetResource("Payment.ExpireMonth.Required"));
            RuleFor(x => x.ExpireYear).NotEmpty() .WithMessage(localizationService.GetResource("Payment.ExpireYear.Required"));
13 năm cách đây
Thanks a lot, Darren! Although server-side validation is good, but these values are already always entered (because appropriate dropdownlists are filled with months and years)

UPDATE: BTW, some of the existing third-party payment plugins do not require expiry date to be entered. Applying this change will break these plugins. I'll create a work item and think about how it's better to do it
13 năm cách đây
a.m. wrote:
Thanks a lot, Darren! Although server-side validation is good, but these values are already always entered (because appropriate dropdownlists are filled with months and years)

UPDATE: BTW, some of the existing third-party payment plugins do not require expiry date to be entered. Apply this change will break this plugin. I'll create a work item and think about how it's better to do it


Yes we added a blank option at the top of month and year. This was to force people to select an option in each, otherwise they often forget and the card is declined.

These changes are in the PayPal Direct plugin only. Shouldn't affect other plugins. PayPal payment methods all require expiry date as far as I can see.

Cheers
13 năm cách đây
wunpac wrote:
These changes are in the PayPal Direct plugin only. Shouldn't affect other plugins.

Sure. I thought that PaymentInfoValidator class is shared between plugins (forgot about it).
P.S. Need some rest =))
13 năm cách đây
Done. Please see changeset f1026b4dd1ce
13 năm cách đây
a.m. wrote:

P.S. Need some rest =))


I'm not surprised. I don't know how you keep the pace of dev up as much as you do.

Don't rest though! We're hungry for new features :-)
13 năm cách đây
One suggestion regarding the naming conventions on these plugins.  I suggest they be called what Paypal calls them.  There is some confusion within hte community.  Payments.PaypalDirect does not map to anything offered by Paypal.  It took us quite some time to figure out how to implement Paypal Advanced, the official name for Paypal's Merchant Account Services we have selected.  Not compeltely sure it is workign correctly yet. This is different from Paypal Standard, the free basic service Paypal offers. A How To on this topic would be helpful. Just a suggestion.

Mark
13 năm cách đây
GoodsonKrewe wrote:


It took us quite some time to figure out how to implement Paypal Advanced, the official name for Paypal's Merchant Account Services we have selected.

Mark


Did you get the Nopcommerce Paypal Direct plugin to work with the Paypal Advanced plan?  I thought that you needed the Paypal Pro plan.  I would be interested in hearing...

Thanks!
13 năm cách đây
Can anybody help me how to setup paypal advance with nopcommerce 2.65. I really need it as soon as possible.

Thanks.
13 năm cách đây
@marifkhan  ...did you get a solution for the ADVANCED PayPal ??
I would love to know if you have one.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.