Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsStoreStoreIntegrating Cybersouce Hosted Order PageIntegrating Cybersouce Hosted Order Page
Previous
 
Next
New Post
11/19/2008 8:05 AM
 

I guess there was interest after all.  Sorry for the slow response.

We got the original code from CyberSource via the Hosted Order Page Security page with the keys and other info already embedded in the code.  This code is necessary for CyberSource to validate your transaction. 

Configure the CyberSource Hosted Order Page Settings Receipt Page and Decline Page settings to point to the URL of your receipt.aspx page.

The checkout.aspx page is hosted in an iFrame within DNN.  Configure DNN to pass the current UserID and PortalID values as query string parameters to checkout page.

In the code behind for the checkout page, method named insertSignature3, create a custom field (See the Hosted Order Page User Guide, Chapter3, Custom Fields) containing the PortalID and the UserID separated by a delimiter.  I used a comma.  This value will be passed to CyberSource and returned in the response page.  The values are integers passed as plain text in a hidden field.  Pick a very generic name for the field and the values should be safe.

When the order transaction is completed, the custom field is returned in the HttpRequest object and is used by the verifyTransactionSignature method in the code behind.

Be sure to validate the Reason Code returned from CyberSource to determine if the transaction is valid.

Use PortalID value and the name of the role you want to assign to call the RoleController.GetRoleByName method

Use the RoleID returned from the GetRoleByName method along with the PortalID and UserID to call the RollController.AddUserRole method.

Here is the code to do all this:

Private m_Role As RoleInfo
Private m_PortalID As Integer
Private m_UserID As Integer

insertSignature3 Method:

sb.Append("'><input type='hidden' name='mycustomfield' value='")
sb.Append(String.format("{0},{1}", Request.QueryString("PortalID"), Request.QueryString("UserID")))

verifyTransactionSignature Method:

'Retrieve the Portal ID and User ID from the Custom field passed to CyberSource from the Checkout process. format is <PortalID>,<UserID>
Dim parm() As String = Split(map.form.Get("mycustomfield"), ",")
m_PortalID = CInt(parm(0))
m_UserID = CInt(parm(1))

'Add the subscriber role to the user making the payment.
Dim objRoles As New RoleController

'Get the Role object for the DNN Role named XXX
m_Role = objRoles.GetRoleByName(m_PortalID, "XXX")

'Add the User to the XXX role, Effective date is today, Expiry date is 365 days from today.
objRoles.AddUserRole(m_Role.PortalID, m_UserID, m_Role.RoleID, Date.Now, DateAdd(DateInterval.Day, 365, Date.Now))

 

I hope this helps

 
New Post
12/17/2008 12:59 PM
 

Hi,

I need that solution as well for our CyberSource integration.

 

Thanks

 

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsStoreStoreIntegrating Cybersouce Hosted Order PageIntegrating Cybersouce Hosted Order Page


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out