Skip to Content Skip to Menu

Auto Action that is triggered on recurring payments

  • ricco1
  • ricco1
  • OFFLINE
  • Posts: 310
  • Thanks: 8
  • Karma: -7
9 years 3 months ago #276946 by ricco1
Hi,

I need an auto action that will be triggered when a recurring payment is received.

I know how to trigger an auto action when the first payment is received, like so:

Triggers: onCPayAfterPaymentStatusUpdateEvent
Conditional: [var4] Equal To Completed

But could tell me if this will also trigger when the next recurring payment is received? If not, what is the equivalent of this for a received recurring payment?

Thank you

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 49143
  • Thanks: 8398
  • Karma: 1461
9 years 3 months ago #276955 by krileon
onCPayAfterPaymentStatusUpdateEvent is used for all payment events. Below is the phpdoc for that trigger.

Code:
/** * Event handler for onCPayAfterPaymentStatusUpdateEvent, called each time an update occurs to the payment status of the payment basket * * Paypal status mappings: * CB Unified status Paypal status * Completed <-- Completed * Processed <-- Processed, Canceled_Reversal * Denied <-- Denied, Expired, Failed, Voided * Refunded <-- Reversed, Refunded, Partially-Refunded * Pending <-- Pending, In-Progress * RegistrationCancelled <-- A new cb registration got cancelled by user (e.g. paypal cancel payment button) * * @param UserTable $user User paying the payment basket * @param cbpaidPaymentBasket $paymentBasket Payment basket * @param cbpaidSomething[] $subscriptions Subscriptions in the basket * @param string $unifiedStatus New Unified status (see above) * @param string $previousUnifiedStatus Previous Unified status (see above) * @param string $eventType type of event (paypal type): 'web_accept', 'subscr_payment', 'subscr_signup', 'subscr_modify', 'subscr_eot', 'subscr_cancel', 'subscr_failed' * @return void */ public function onCPayAfterPaymentStatusUpdateEvent( &$user, &$paymentBasket, &$subscriptions, $unifiedStatus, $previousUnifiedStatus, $eventType )

So you need to check that $eventType is equal to subscr_payment for a recurring payment. This is var6 so you'd have the following conditional.

[var6] Equal To subscr_payment


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: ricco1

Please Log in or Create an account to join the conversation.

  • ricco1
  • ricco1
  • OFFLINE
  • Posts: 310
  • Thanks: 8
  • Karma: -7
9 years 3 months ago - 9 years 3 months ago #276971 by ricco1
Thanks for the info.

Will that fire also on first payments or only on next recurring payments?

How to set it so that it fires only on recurring payments but not on the first one please?
Last edit: 9 years 3 months ago by ricco1.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 49143
  • Thanks: 8398
  • Karma: 1461
9 years 3 months ago #276976 by krileon
It fires on every payment.

How to set it so that it fires only on recurring payments but not on the first one please?

Please re-read my reply as have already explained how to condition against recurring payments.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: ricco1

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum