• Resolved des79

    (@des79)


    Hi there,

    I’m trying to generate e renewal order for subscription via admin but I get this error:

    Fatal error: Uncaught Error: Call to undefined method Braintree\Customer::paymentMethods()
    in /assets/plugins/woocommerce-gateway-paypal-powered-by-braintree/includes/api/responses/class-wc-braintree-api-customer-response.php on line 107
    
    Stack di chiamate:
    
    WC_Braintree_API_Customer_Response::get_payment_tokens()
    assets/plugins/woocommerce-gateway-paypal-powered-by-braintree/vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:677
    SkyVerge\W\P\v\SV_WC_Payment_Gateway_Payment_Tokens_Handler::get_tokens()
    assets/plugins/woocommerce-gateway-paypal-powered-by-braintree/vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:273
    SkyVerge\W\P\v\SV_WC_Payment_Gateway_Payment_Tokens_Handler::get_token()
    assets/plugins/woocommerce-gateway-paypal-powered-by-braintree/vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:906
    SkyVerge\W\P\v\SV_WC_Payment_Gateway_Payment_Tokens_Handler::user_has_token()
    assets/plugins/woocommerce-gateway-paypal-powered-by-braintree/vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:347
    SkyVerge\W\P\v\SV_WC_Payment_Gateway_Integration_Subscriptions::process_renewal_payment()
    wp-includes/class-wp-hook.php:292
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:316
    WP_Hook::do_action()
    wp-includes/plugin.php:484
    do_action()
    assets/plugins/woocommerce-subscriptions/includes/gateways/class-wc-subscriptions-payment-gateways.php:191
    WC_Subscriptions_Payment_Gateways::trigger_gateway_renewal_payment_hook()
    assets/plugins/woocommerce-subscriptions/includes/gateways/class-wc-subscriptions-payment-gateways.php:219
    WC_Subscriptions_Payment_Gateways::gateway_scheduled_subscription_payment()
    wp-includes/class-wp-hook.php:292
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:316
    WP_Hook::do_action()
    wp-includes/plugin.php:484
    do_action()
    assets/plugins/woocommerce-subscriptions/includes/admin/class-wcs-admin-meta-boxes.php:201
    WCS_Admin_Meta_Boxes::process_renewal_action_request()
    wp-includes/class-wp-hook.php:292
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:316
    WP_Hook::do_action()
    wp-includes/plugin.php:484
    do_action()
    assets/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php:139
    WC_Meta_Box_Order_Actions::save()
    wp-includes/class-wp-hook.php:292
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:316
    WP_Hook::do_action()
    wp-includes/plugin.php:484
    do_action()
    assets/plugins/woocommerce/includes/admin/class-wc-admin-meta-boxes.php:220
    WC_Admin_Meta_Boxes::save_meta_boxes()
    wp-includes/class-wp-hook.php:294
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:316
    WP_Hook::do_action()
    wp-includes/plugin.php:484
    do_action()
    wp-includes/post.php:4384
    wp_insert_post()
    wp-includes/post.php:4486
    wp_update_post()
    wp-admin/includes/post.php:419
    edit_post()
    wp-admin/post.php:227

    Braintree for WooCommerce Payment Gateway 2.5.0
    WooCommerce Subscriptions 3.0.13
    Wordpress 5.7

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter des79

    (@des79)

    problem due to opcache

    Thread Starter des79

    (@des79)

    Errata corrige.

    I get this error if I login to myaccount and access to subscriptions menu

    Fatal error: Uncaught Error: Call to undefined method Braintree\Customer::paymentMethods()
    in /public_html/assets/plugins/woocommerce-gateway-paypal-powered-by-braintree/includes/api/responses/class-wc-braintree-api-customer-response.php on line 107

    Stack di chiamate:
    
    WC_Braintree_API_Customer_Response::get_payment_tokens()
    assets/plugins/woocommerce-gateway-paypal-powered-by-braintree/vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:677
    SkyVerge\W\P\v\SV_WC_Payment_Gateway_Payment_Tokens_Handler::get_tokens()
    assets/plugins/woocommerce-gateway-paypal-powered-by-braintree/vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:273
    SkyVerge\W\P\v\SV_WC_Payment_Gateway_Payment_Tokens_Handler::get_token()
    assets/plugins/woocommerce-gateway-paypal-powered-by-braintree/vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:647
    SkyVerge\W\P\v\SV_WC_Payment_Gateway_Integration_Subscriptions::maybe_render_payment_method()
    wp-includes/class-wp-hook.php:292
    WP_Hook::apply_filters()
    wp-includes/plugin.php:212
    apply_filters()
    assets/plugins/woocommerce-subscriptions/includes/class-wc-subscription.php:2029
    WC_Subscription::get_payment_method_to_display()
    assets/plugins/woocommerce-subscriptions/templates/myaccount/my-subscriptions.php:43
    include()
    assets/plugins/woocommerce/includes/wc-core-functions.php:345
    Thread Starter des79

    (@des79)

    to remove error I temporary change

    foreach ( $this->response->paymentMethods() as $method ) {

    with

    foreach ( $this->response->paymentMethods as $method ) {

    paymentMethods() is not defined in response

    Simon

    (@simonskyverge)

    Hey @des79,

    Fantastic work! Thanks so much for raising this issue to us, and solving it in one go!

    You are right, it looks like with our latest release when we upgraded the Braintree SDK, we did not update the paymentMethods() function which was changed to be accessed as an attribute in the new SDK versions.

    I’ve gone ahead and raised this as an issue for our developers who will look to get a fix out as soon as possible.

    Thanks so much again for taking the time to report this to us, it’s very much appreciated! Is there anything else I can help out with in the meantime?

    Cheers,

    Simon.

    Thread Starter des79

    (@des79)

    Hi Simon, it’s a pleasure.

    This is a quickly workaround. In /vendor/braintree/braintree_php/lib/Braintree/Customer.php #367 there is a method paymentMethods that return $his->paymentMethods attribute

        public function paymentMethods()
        {
            return $this->paymentMethods;
        }
    

    I don’t know why this isn’t accessible. I think for response object, I have not had the opportunity to analyze it

    Hey @des79,

    Erica here, stepping in for Simon. Thanks so much for the additional details! I’m going to add this to the issue that Simon raised to our developers to look into as well. We really appreciate this feedback!

    Would you please let me know if there’s anything else I can help out with?

    Best,
    Erica

    Hey @des79,

    It has been a long time since we heard from you, so I’m going to mark this topic as resolved.

    If you’re still experiencing issues please take a look at our documentation for more information and create a new thread if you have further questions.

    Thanks,
    Erica ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal error: Uncaught Error: Call to undefined method Braintree\Customer::payme’ is closed to new replies.