Internal Payment Methods vs. External Payment Methods

Aaron Hayon asked on June 10, 2015 22:10

I am looking for a way to allow for users of the Orders application to select different payment methods than those available through the shopping cart payment selector. Essentially we have orders that we will allow to be paid in cash on pickup but this is not an option we want external users to see and use.

In looking at the Orders Web Part in the Web Part Application, I noticed on the properties tab the Payment Method has an advanced edit control setting called DisplayOnlyEnabled. This however is unchecked by default and still only those that are enabled are showing up in the Orders Application. Is this a bug, or does this setting no longer work?

I currently have the Cash option setup in payment methods as disabled and it still does not show with this control setting unchecked.

If the DisplayOnlyEnabled no longer works, is there another way that I can accomplish having different payment methods for internal users vs external users?

Recent Answers


Joshua Adams answered on June 10, 2015 22:46

Why don't you just create a custom control by cloning the original control and then add your where clause to it to not show that payment method? Then you can leave all of them as enabled and the back end will work as expected.

0 votesVote for this answer Mark as a Correct answer

Aaron Hayon answered on June 11, 2015 14:46

Joshua,

Thanks for you input. This actually helped me go down another path. What I ended up having to do is the following...

  1. I added a custom field to the PaymentOptions class called IsInternalOnly.

  2. I updated my payment methods to have IsInternalOnly set for those that I wanted only displayed internally. This was done through the Modules Application -> E-commerce -> Classes -> Payment Methods -> Fields.

  3. I took your advice and cloned the PaymentSelector and added a property to the form control called AllowInternalPaymentMethods and had it default to false. I also updated the where clause to evaluate AllowInternalPaymentMethods and if this was false, I added "IsInternalOnly = 0" to. This was done through the Form Controls -> Payment Selector Custom -> Properties.

  4. In order to account for Internal Only Payment methods, I updated the field OrderPaymentOptionID in the Order Application to use my new Form control Payment Selector Custom. This was done by going to Module -> E-commerce -> Classes -> Order -> Alternate Forms -> Update Billing. Once there I selected the OrderPaymentMethodID field and set the form control to my new Payment Selector Custom control.

  5. So step 4 allowed users who have access to the Orders Application to now use Cash as an option. For external users I needed to clone the web part PaymentMethodSelector. This was done through the Web Parts application.

  6. Once I cloned PaymentSelectorMethod web part to create PaymentSelectorMethodCustom, I was able to set this ascx control to utilize my new PaymentSelectorCustom control created in step 3.

  7. Finally, I replaced the standard PaymentMethodSelector web part with my custom web part PaymentMethodSelectorCustom within my checkout step page type that was part of the shopping cart. This was done through the Pages application and selecting my payment method page that is part of the checkout process.

I know this is a lot to digest but this finally got me the solution I needed of having different payment methods for internal users and external users.

My only question on this is if anything I did here would cause issues in an upgrade? I did everything through the UI through cloning and fields so I think I should be good here but thought I would ask.

0 votesVote for this answer Mark as a Correct answer

Joshua Adams answered on June 11, 2015 15:00

That should work pretty well for you. Your implementation seems a bit better than just cloning the control, because it is more integrated. As far as upgrades, all you will need to do is winmerge or move over changes that kentico makes on the payment selector to your custom control. I don't think that these controls change very often if at all, but I could be wrong. Either way, as long as you remember during upgrades that you have to make sure any changes are brought over to your custom control, you should be good to go.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.