Quote Originally Posted by mc12345678 View Post
If there is its a miracle that the code works on my test site without an error. There are 4 opening and 4 closing parentheses, and they are matched such that a close always closes an open one.

The assignment of $classPay is not as important as the function called to assign it. The variable could likely be unset at the end of the code or not assigned to begin with, but wanted to leave the maximum potential functionality without impacting existing code by otherwise reusing a variable (though somewhat too late in using $paypalwpp_module variable.
Oops! That "missing" closing paren snuck in as the very last (undisplayed) line of the code.

It's still unclear to me what the instantiation of the paypalwpp payment-class is adding to the mix.