Luis
Forum Replies Created
-
Hi @mrclayton , thanks.
I’ve just sent the contact form.Hi @mrclayton, sure I’ve checked one of the subscriptions (344682) that was created in Woo, and the _start_date has 2023-02-13 03:22:22.
That subscription was created by a parent order on the 2023-02-12.
The subscription was then renewed in Braintree on 2023-03-13 but that order does not show up in the related WooCommerce Subscription page (and also doesn’t show in the Orders page).
ThanksHi @mrclayton , thanks for the reply.
Yes, we create some subscriptions from another website (directly with BT API). So maybe that’s what those Subscription IDs mean. I know we had these logs entries way before this problem.
As for the WooCommerce orders, you can see attached our Woo Setup, where that option is disabled.
ThanksHi @mrclayton , no they don’t have expiration dates, they are not expected to end.
We have this data on wc-braintree logs from older dates (when everything was working correctly). Always mentions Subscription 0 but there was never any issue.2023-02-15T00:02:06+00:00 INFO Webhook received. Kind: subscription_went_active.
2023-02-15T00:02:06+00:00 INFO Subscription 0 not found in your database.
2023-02-15T00:02:07+00:00 INFO Webhook received. Kind: subscription_charged_successfully.
2023-02-15T00:02:07+00:00 INFO Subscription 0 not found in your database.Hi @mrclayton ,
Yes we’re using the built in Subscriptions, and it’s happening for all subscriptions.
Thanks
Hi @mrclayton , thanks for the reply.
We were using 3.2.41 until the update, and I confirmed in our logs that this error is not shown prior to the update.We are not using HPOS.
Thanks
Hi @mrclayton ok thanks I will!
Hi @mrclayton ,
The most frequent is “Error processing payment. Reason: Declined”.We are having some problems because sometimes when the transaction fails, the subscription is still created as Pending.
After 1 month, the subscription tries another charge on the card and it succeeds, and we end up receiving complaints because the client doesn’t know why he is being charged if the subscription was never started (he didn’t have access to the product during the first month).So we have to manually cancel all subscriptions that are started from failed transactions to avoid this. That’s like we would like to, at least, automate deleting the subscription for these transactions, until the plugin is redesigned.
We will probably try the
woocommerce_order_status_failedhook, but maybe there was a better hook on the plugin that we could use instead.Thanks!
Hi @mrclayton,
thanks for the response.Yes you’re right, the initial issue is the same.
On that thread we found out the webhooks were not working and I thought fixing that issue could also solve this situation, but unfortunately it didn’t.
That’s why this new thread was to find if there is anything we can do as a workaround until that is fixed on the core.
Is there a hook we can use after the payment is failed, where we can remove any subscription that may have been created by it?
Thanks!
Hi @mrclayton thanks for fixing so quickly!
Hi @mrclayton, thanks.
I’ve done a few tests with the webhooks and we were able to have the webhooks being triggered after adding these lines to the ‘process_webhook’ function.
After this, if we cancel a BT subscription (in BT account) the subscription in Woo was updated to Cancelled too.
It’s seems the wc_braintree_notification parameter was not sending any values. Only by parsing the signature and payload, was I able to get the notification object.
Is it possible BrainTree changed something on the webhooks args?
Here’s the code I’ve added.
$notification = $request->get_param( 'wc_braintree_notification' ); // FIX START $bt_signature = $request->get_param( 'bt_signature' ); $bt_payload = $request->get_param( 'bt_payload' ); $notification = braintree()->gateway()->webhookNotification()->parse( $bt_signature, $bt_payload ); // FIX END try { // developers can use this hook to process webhooks to suite business needs. do_action( 'wc_braintree_webhook_notification_' . $notification->kind, $notification, $request );Thanks!
Hi @mrclayton thanks again for the explanation details.
That behavior makes sense (not duplicating subscriptions on a failed payment).
I believe we may have problems with webhooks, because we are not receiving any events from BrainTree (although we have the correct url and events setup in BT). This could maybe explain the duplication of subscriptions on failed payments.
For example:
– If we cancel a subscription in BT, the WooCommerce subscription remains Active. But if we cancel in Woo then it’s cancelled in BT.I’ve checked the logs but it only logs the transaction from Woo to BT.
Is there a way to see any logs for the webhooks ?Thanks again for you help!
Thanks for the quick reply.
Shouldn’t the subscription just be created in BrainTree if the shop_order is successful?
We are having some use cases where a client does this:
- Places the first order but it failed (refused credit card for example)
- Places a second order and succeeds
This creates 2 (pending) subscriptions for that client.
One for the failed payment.
One for the success payment.And we have to go to BT to manually cancel the subscription from the first failed order.
Do you see any reason for having the first subscription be created, because we never receive any payment from the customer (and when the renewal comes it will also fail).
Thanks again for your help!
Forum: Plugins
In reply to: [Payment Plugins Braintree For WooCommerce] Subscriptions Pendingthanks @mrclayton that was a great help!