I am unable to test the events module with a real PayPal account at the time being, but looking through the source code I cannot find where the event gets approved.
Clicking the purchase link enrolls the user into the event, but does not yet approve it. But when the user is taken back to the DNN site from paypal, they aren't approved either...?
In the cmdPurchase_Click event handler, there is this:
objEventSignups = New EventSignupsInfo
objEventSignups.EventID = objEvent.EventID
objEventSignups.ModuleID = objEvent.ModuleID
objEventSignups.UserID = UserId
objEventSignups.PayPalStatus = "none"
objEventSignups.PayPalReason = "PayPal call initiated..."
objEventSignups.PayPalPaymentDate = DateTime.Now
objEventSignups.EventTimeBegin = CType(Me.lblStartDate.Text, DateTime)
objEventSignups.Approved = False
objEventSignups = objCtlEventSignups.EventsSignupsSave(objEventSignups)
Obviously the EventSignup is saved, and the Approved status is False. In that same event handler, the following are passed to PayPal as the Return and Cancel redirect URLs:
Dim returnURL As String = NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "signupid=" & CType(objEventSignups.SignupID, String), "status=enrolled")
Dim cancelURL As String = NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "signupid=" & CType(objEventSignups.SignupID, String), "status=cancelled")
Here's where my discrepency lies. At this point the user is redirected to PayPal, and there is no way PayPal can modify anything about the EventSignup. So when they are redirected back to the DNN site, the following code is passed:
If Request.Params("status") = "enrolled" Then
' User has been successfully enrolled for this event (paid enrollment)
Me.lblPurchase.Text = Localization.GetString("lblComplete", LocalResourceFile)
Me.cmdPurchase.Visible = False
Me.cancelButton.Visible = False
Me.cmdReturn.Visible = True
ElseIf Request.Params("status") = "cancelled" Then
' User has been cancelled paid enrollment
Me.lblPurchase.Text = Localization.GetString("lblCancel", LocalResourceFile)
Me.cmdPurchase.Visible = False
Me.cancelButton.Visible = False
Me.cmdReturn.Visible = True
' Make sure we delete the signup
objCtlEventSignups.EventsSignupsDelete(SignupID)
End If
If the user cancels the payment, then great, the EventSignup is deleted. But if they actually pay, the only thing that happens is that labels' text is set and the cmd links are set. Is the user really in Approval limbo right now? Or is there something else going on somewhere that I am not seeing?
Like I said, I am unable to actually test using paypal right now, but I do know that once redirected to PayPal, the user is enrolled but not approved.