strangerstudios / pmpro-failed-payment-limit

Cancel members subscriptions after X failed payments. Set X in plugin code.
5 stars 6 forks source link

Failed Payments via Stripe #2

Open woodwardmatt opened 7 years ago

woodwardmatt commented 7 years ago

Hi there,

I'm just trying to piece the "Failed Payment" process together and spotted this code on Line 271 of paid-memberships-pro/services/stripe-webhook.php:

    `elseif($pmpro_stripe_event->type` == "charge.failed")

Having looked at the data sent back by Stripe (for me) as part of the webhook, I'm just wondering if this should this be

    `elseif($pmpro_stripe_event->type` == "invoice.payment_failed")

(Or maybe cater for both?)...

    `elseif($pmpro_stripe_event->type` == "charge.failed" || $pmpro_stripe_event->type` == "invoice.payment_failed")

Otherwise the failed payment (where an invoice is being raised / paid) would never trigger the "pmpro_subscription_payment_failed" action within this plugin for PMP to cancel the membership?

Have I missed something? :) TYIA :)

StevieDC commented 4 years ago

Hi, I'm just about to use this plugin and also use Stripe. Did you establish whether that change is ok/required? Thanks.

woodwardmatt commented 4 years ago

Hey @StevieDC sorry for the slow response. I've just done a quick sanity check, and I don't believe we use this plugin for this purpose now.

We currently use the failed payment settings through Stripe, and have the subscription cancelled from there if all retries fail. This still occurs via PMPRO and works fine :)

Hope that helps!

DBAD24 commented 3 months ago

Hey @StevieDC sorry for the slow response. I've just done a quick sanity check, and I don't believe we use this plugin for this purpose now.

We currently use the failed payment settings through Stripe, and have the subscription cancelled from there if all retries fail. This still occurs via PMPRO and works fine :)

Hope that helps!

Stripe are saying its our site cancelling the members after one failed attempt. Our Stripe settings are to try 3 times.