It is possible to get PHP notices about integration_type
Notice: Undefined index: integration_type in commerce_stripe_commerce_payment_method_info() (line 76 of commerce_stripe/commerce_stripe.module).
This patch prevents that issue as well as:
- New administrative messages about integration_type not being set and Stripe.js being default.
- Provides link if any issues are found to the configure payment methods screen in Commerce.
This line is awfully long so I'll submit a 2nd version with alternate logic option:
$stripe_integration = !empty($action->settings['payment_method']['settings']['integration_type']) ? $action->settings['payment_method']['settings']['integration_type'] : STRIPE_DEFAULT_INTEGRATION;
The change on line 694 is so we don't waste resources loading settings for non-privileged users.
Patch in next comment.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | commerce-stripe-undefined-integration_type-2646194-2.patch | 2.45 KB | jwjoshuawalker |
| #2 | commerce-stripe-undefined-integration_type-2646194-1.patch | 2.97 KB | jwjoshuawalker |
Comments
Comment #2
jwjoshuawalker commentedPatch 1 with the long inline-if condition.
Comment #3
jwjoshuawalker commentedAlternate code styling patch.
Both accomplish same goals.
Comment #4
echoz commentedI got this notice on the final update screen when updating from 7.x-1.0 to 7.x-1.1
I downgraded holding out for more understanding (if not everyone sees this) and a settled on solution. Thanks for your work on this.
Comment #6
aviindub commentedthanks for the patch!