diff --git a/src/Extension.php b/src/Extension.php index 6f25042..96447ba 100644 --- a/src/Extension.php +++ b/src/Extension.php @@ -616,7 +616,7 @@ public function rcp_membership_payment_profile_cancelled( $success, $gateway, $g * Subscription action links HTML. * * @param string $actions Formatted HTML links. - * @param array $links Links. + * @param array $links Links. * @param int $user_id Current user ID. * @param RCP_Membership $rcp_membership Membership object. * @return string @@ -664,7 +664,7 @@ public function maybe_update_membership_gateway( $post_id ) { return; } - $rcp_membership = \rcp_get_membership( $subscription->get_source_id() ); + $rcp_membership = \rcp_get_membership( (int) $subscription->get_source_id() ); if ( false === $rcp_membership ) { return; diff --git a/src/Gateways/Gateway.php b/src/Gateways/Gateway.php index 9d5fcca..3dfc442 100644 --- a/src/Gateways/Gateway.php +++ b/src/Gateways/Gateway.php @@ -47,7 +47,7 @@ public function init() { // Set supported features based on gateway. $gateway = $this->get_pronamic_gateway(); - if ( null !== $gateway ) { + if ( null !== $gateway && null !== $this->payment_method ) { $payment_method = $gateway->get_payment_method( $this->payment_method ); if ( null !== $payment_method && $payment_method->supports( 'recurring' ) ) { @@ -260,6 +260,10 @@ public function fields() { return ''; } + if ( null === $this->payment_method ) { + return ''; + } + $payment_method = $gateway->get_payment_method( $this->payment_method ); if ( null === $payment_method ) {