-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If credit card payment is declined for membership product, user account is still assigned the DNN security role. #189
Comments
It seems this is because the MembershipTask() runs within the LoadProcessNewOrderTasks() workflow. This workflow runs when the order is moved from 'New' to 'TODO' state. In DnnWorkflowFactory.cs: protected override Task[] LoadProcessNewOrderTasks()
{
return new Task[]
{
new WorkflowNote("Starting Process Order Workflow"),
new UpdateOrder(),
new CheckForZeroDollarOrders(),
new DnnCreateUserAccountForNewCustomer(),
new AssignOrderToUser(),
new AssignOrderNumber(),
new MakeOrderAddressUsersCurrentAddress(),
new AddUserAddressesToAddressBook(),
new UpdateLineItemsForSave(),
new UpdateOrder(),
new DnnMakePlacedOrder(),
new WorkflowNote("Finished Process Order Workflow"),
new UpdateOrder(),
// Added to handle "membership" products
new MembershipTask()
};
} Moving the MembershipTask() to run within the LoadProcessNewOrderAfterPaymentsTasks() workflow would make more sense, since the latter is the workflow that runs after successful payment is applied. Adding an override to DnnWorkflowFactory.cs for the LoadProcessNewOrderAfterPaymentsTasks() and removing MembershipTask() from LoadProcessNewOrderTasks() fixes the issue, as shown below. protected override Task[] LoadProcessNewOrderTasks()
{
return new Task[]
{
new WorkflowNote("Starting Process Order Workflow"),
new UpdateOrder(),
new CheckForZeroDollarOrders(),
new DnnCreateUserAccountForNewCustomer(),
new AssignOrderToUser(),
new AssignOrderNumber(),
new MakeOrderAddressUsersCurrentAddress(),
new AddUserAddressesToAddressBook(),
new UpdateLineItemsForSave(),
new UpdateOrder(),
new DnnMakePlacedOrder(),
new WorkflowNote("Finished Process Order Workflow"),
new UpdateOrder()
};
}
protected override Task[] LoadProcessNewOrderAfterPaymentsTasks()
{
return new Task[]
{
new WorkflowNote("Starting Order After Payment Workflow"),
new UpdateOrder(),
new LocalFraudCheck(),
new MarkCompletedWhenShippedAndPaid(),
new EmailOrder("Customer"),
new EmailOrder("Admin"),
new MembershipTask(),
new WorkflowNote("Finished Order After Payment Workflow"),
new UpdateOrder()
};
} I'd be happy to create a pull request if you agree. |
This looks good. I agree. :) If you can get it done within the next few weeks, I'll push this into the 03.02.02 milestone. Thanks! |
Can you please create a pull request when you're ready? :) |
@hismightiness all done, please refer to #192 :) |
TO-DO
|
Issue #189 - Assign membership only after successful payment
Added missing updates to completely resolve Issue #189
I just tested this update and now a membership product is assigned upon authorization. So, the customer gets assigned before the funds are actually captured. Membership-based stores are probably less likely to be configured this way, but that is still a problem. This has otherwise tested to resolve the issue described here. |
Describe the bug
When purchasing a membership type product and payment is declined, the user account is still assigned the DNN security role.
Software Versions
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The order should be created in Hotcakes and marked as unpaid. The user should be directed to the Checkout/action/paymenterror page to be prompted to update their billing address and payment details. The Testmember security role should NOT YET be assigned to the customer user account, until after they have paid.
Actual behavior
The order is created in Hotcakes and marked as unpaid. The user is redirected to the Checkout/action/paymenterror page and prompted to update their billing address and payment details. The Testmember role is automatically assigned to the customer user account. The customer receives a DNN email confirming that the role has been assigned.
The text was updated successfully, but these errors were encountered: