-
Notifications
You must be signed in to change notification settings - Fork 48
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
Cannot access protected property #247
Comments
Verified. |
Hey @adam-devapp, could you possibly walk me through how to trigger this error? Personally, I never used this workflow, so I just have no idea. Thanks for the suggestion! I hope that works. If so, using the ReflectionClass could be a better bet in the long run for maintaining this code instead of extending a subclass every time this happens. Apparently, to access this protected _paymentProcessors array, we'd have to extend CRM/Contribute/Form/AbstractEditPayment.php. |
The way that I was seeing it (and we are no longer using this workflow), was to go and create a new contribution for, say, $500 and mark it "Pending (from pay later)" by marking it as pending status with a pay by check method or something (in my case it was a custom payment method called "pledge to be paid"). Then go and try to, through the back end, record a credit card payment, and it whitescreens there. |
Thanks @chrisfromredfin, I see now this is a new feature in 4.7. Are you guys using any unmerged patches by chance? With a fresh 4.7.31 install I'm getting "Stripe.js token not passed". |
@adam-devapp @chrisfromredfin @h-c-c You may wish to try my branch which completely does away with the CRM/Core/Form.php hack that this issue is caused by as well as resolving all known "Stripe.js token not passed" issues: https://github.com/mattwire/com.drastikbydesign.stripe/tree/4.7-mjwconsulting-dev-squashed |
Hey @mattwire. Thanks for pointing us at this. I had a chance to take a quick glance over it, and was wondering if you could talk about your approach. I saw that you're overriding all CC fields, but wasn't sure how that helps. I guess the question I want to ask is this. Did you find something in common relating to all the known causes of "Stripe.js token not passed."? |
@h-c-c Hey, as you've probably seen it's a fairly substantial rewrite of parts of the extension. The "Stripe.js token not passed" is caused by a whole range of different things (eg. failing to include stripe.js, failing to submit token values if payment form is loaded via ajax etc). |
( ! ) Fatal error: Uncaught Error: Cannot access protected property CRM_Contribute_Form_AdditionalPayment::$_paymentProcessors in ...../civicrm/ext/com.drastikbydesign.stripe/CRM/Core/Form/Stripe.php on line 13
( ! ) Error: Cannot access protected property CRM_Contribute_Form_AdditionalPayment::$_paymentProcessors in .....//civicrm/ext/com.drastikbydesign.stripe/CRM/Core/Form/Stripe.php on line 13
This occurs when attempting to record a CC payment against an existing offline contribution.
CiviCRM appear to have changed access to the variables used, so obtaining the variables from the class doesn't work.
Potential work around is using a function like:
function dashboard_civicrm_accessProtected($obj, $prop) {
$reflection = new ReflectionClass($obj);
$property = $reflection->getProperty($prop);
$property->setAccessible(true);
return $property->getValue($obj);
}
The text was updated successfully, but these errors were encountered: