Generate invoice in pdf

6 years 2 months ago #302173 by activha
Replied by activha on topic Generate invoice in pdf

Acting on onCPayAfterPaymentBasketUpdated and checking for payment_status of NotInitiated. This is when the basket is first created before a payment method is even selected.

We need to check the reverse : that a payment method has been selected and that the basket is marked : pending, completed, processed or whatever

Then we want to receive only one email when the basked is marked, and not several emails for pending, then processed, then completed.

If we check onCPayAfterPaymentBasketUpdated Not Egal To Notinitiated, we would receive an email at each different state ?
So how can we trigger only one auto action (for emailing) when onCPayAfterPaymentBasketUpdated Not Egal To Notinitiated and Basket is either Pending, processed, completed ?

Please Log in to join the conversation.

6 years 2 months ago #302178 by krileon
Replied by krileon on topic Generate invoice in pdf

We need to check the reverse : that a payment method has been selected and that the basket is marked : pending, completed, processed or whatever

Such a state doesn't exist. The basket isn't updated when clicking the payment button. It's only updated after the payment processor has done something (e.g. payment is coming through). A pending basket means the basket has been processed and payment from the processor is pending. For 99% of payment processors it will never go payment since card payments are instant.

If we check onCPayAfterPaymentBasketUpdated Not Egal To Notinitiated, we would receive an email at each different state ?

You'll receive an email anytime that trigger fires and the basket payment_status is set to NotInitiated. I've no idea how many times that might be. You'll need to test that.

So how can we trigger only one auto action (for emailing) when onCPayAfterPaymentBasketUpdated Not Egal To Notinitiated and Basket is either Pending, processed, completed ?

For offline payments it can be in a pending state. For other gateways it likely will never go pending. You can probably have 2 auto actions to cover both scenarios. 1 for offline payments and 1 for card payments. Example conditions for these actions as follows.

Action 1 (Offline) Conditions
1: [var1_payment_status] Equal To Pending
2: [var1_gateway_account] Equal To OFFLINE_GATEWAY_ID_HERE

Action 2 (Cards) Conditions
1: [var1_payment_status] Equal To Completed
2: [var1_gateway_account] Equal To CARD_GATEWAY_ID_HERE


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.

Please Log in to join the conversation.

6 years 2 months ago #302189 by activha
Replied by activha on topic Generate invoice in pdf
Very well, thank you

If we want to cover two gateways is it possible to separate them with a | like :
[var1_gateway_account] Equal To OFFLINE_GATEWAY_ID_1|OFFLINE_GATEWAY_ID_2

Please Log in to join the conversation.

6 years 2 months ago #302191 by krileon
Replied by krileon on topic Generate invoice in pdf

If we want to cover two gateways is it possible to separate them with a | like :
[var1_gateway_account] Equal To OFFLINE_GATEWAY_ID_1|OFFLINE_GATEWAY_ID_2

Yes, but you need to change the usage to REGEXP as follows.

[var1_gateway_account] Is REGEX /ID_1|ID_2/


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: activha

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.307 seconds

Facebook Twitter LinkedIn