Search code examples
c#dotnetnukepaypal-ipn

DNN PayPal settings checking receiver_email


On one of the pages of my DNN website I've set up a BuyNow button inside a HTML/Text module. The button does a POST on submit to the PayPal Sandbox URL. I've also set up a REST based service which PayPal is going to post the IPN information to.

In this service I'm sending a POST with the cmd_notify parameter and get back the information associated to the transaction.

At this point I would like to check whether the receiver_email parameter which PayPal sends coincides with my seller email adress from inside the Sandbox account. However I don't want to hardcode the value for the latter. I've noticed that DNN has a "Payment Settings" section under Admin->Advanced Settings.

[TL;DR]

How can I programatically access the PayPal email address info stored at Admin->Advanced Settings->Payment Settings from back-end webservice C# code? Is this possible?


Solution

  • This is stored in the HostSettings table as a setting key named "ProcessorUserId":

     select * from hostsettings where settingname='ProcessorUserId'
    

    Programmatically, if you're inside DNN you can access it through:

     DotNetNuke.Common.Globals.HostSettings(KEY)
    

    that is:

     string pid= DotNetNuke.Common.Globals.HostSettings("ProcessorUserId");
    

    Hope it helps, al.