8000 Braintree subscriptions: duplicate process payment · Issue #2103 · angelleye/paypal-woocommerce · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Braintree subscriptions: duplicate process payment #2103
Open
@peterjohnhunt

Description

@peterjohnhunt

On the current v4.5.21 version of the plugin Braintree subscription renewals are attempting to duplicate charge the payment method.

The plugin currently attaches to the woocommerce_payment_gateways hook twice which registers the payment methods twice:

add_filter('woocommerce_payment_gateways', array($this, 'angelleye_add_paypal_pro_gateway'), 1000);
AngellEye_PayPal_PPCP_Apple_Domain_Validation::instance();
AngellEye_Session_Manager::instance();
add_filter('woocommerce_payment_gateways', array($this, 'angelleye_add_paypal_pro_gateway'), 3);

This in turn causes the woocommerce_scheduled_subscription_payment_braintree hook to be attached twice and runs process_subscription_payment twice.

add_action('woocommerce_scheduled_subscription_payment_' . $this->id, array($this, 'scheduled_subscription_payment'), 10, 2);
add_filter('woocommerce_subscription_payment_meta', array($this, 'add_subscription_payment_meta'), 10, 2);
add_filter('woocommerce_subscription_validate_payment_meta', array($this, 'validate_subscription_payment_meta'), 10, 2);
add_action('wcs_resubscribe_order_created', array($this, 'delete_resubscribe_meta'), 10);
add_action('woocommerce_subscription_failing_payment_method_updated_' . $this->id, array($this, 'update_failing_payment_method'), 10, 2);

The second payment fails due to being a duplicate and causes the order to be marked as failed.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0