Skip to Content Skip to Menu

Auto Actions Trigger Code on CBSubs Donation Transaction

7 years 1 month ago - 7 years 1 month ago #293355 by jamesmoeller
Yeah, I've fixed the quotes around the [var4]. I don't think that really changes the code at all because of the automatic type casting of PHP.

Additionally, I did have the $vars correct. When I copies my code into the forum, your text groomer took it out. So I've now fixed the code above with your forum's editor <code> tag. So the code above shows much cleaner.

Can you address my other questions in my previous post?

Jim
Last edit: 7 years 1 month ago by jamesmoeller.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 68607
  • Thanks: 9108
  • Karma: 1434
7 years 1 month ago #293369 by krileon

How does the communication flow between the website and PayPal? I’ve set the IPN and PDT (Payment Data Transfer) correctly back at PayPal, but I noticed that the URLs set within PayPal don’t seem to matter in the communication flow or return of payment data with CBSubs.

PayPal sends limited information with a PDT and IPN POST. We use API to request most of the payment data. Don't see how this is relevant to your usage however.

In addition, with the first site not being public, how does the PayPal information get received by this website? Should the PayPal transaction even work correctly with a non-public site? I don’t fully understand how it worked in the past and returned correctly to my private website from PayPal.

The gateway endpoint needs to be reachable. So as long as you're not locking that aspect of your site down it's fine. This means the CB extension and CBSubs plugin need to be publicly accessible.

When exactly does the onCPayAfterPaymentStatusUpdateEvent get triggered…when the customer returns to my site from PayPal in their browser?

Anytime the payment status of the basket is changed. Could be when they're returned for a PDT payment or could be when the IPN pays the basket. Don't see how this is relevant to your usage however.

How does the browser session factor into this functionality? I seem to get inconsistent results if I run transactions on my websites from different tabs within the same browser, and seemingly consistent results if I run transactions on my sites from completely different browsers (Chrome, Firefox, etc.)

Browser session is entirely irrelevant. Once sent to the gateway the PDT return or IPN will pay it. Doesn't matter what browser you're using, if you're logged out, etc..You'll need to clarify what you mean by inconsistent results for me to understand what issue you're having.


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 or Create an account to join the conversation.

7 years 1 month ago #293388 by jamesmoeller
Ultimately, I'm just trying to understand this better with the aim of just characterizing the odd execution I'm seeing and determine if its a test setup issue or a core functional / code issue...and maybe ask more specific questions after that.

What I see right now is that the PayPal transaction gets executed very consistently and works great. However, it looks like the triggering of onCPayAfterPaymentStatusUpdateEvent isn't consistent. I have other debugging code in my Auto Action that writes to a local file when the event is triggered. Sometimes the event gets triggered and my code executes, and sometimes it doesn't get triggered.

That's the motivation for the questions in my previous post.

Any thoughts?

Jim

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 68607
  • Thanks: 9108
  • Karma: 1434
7 years 1 month ago - 7 years 1 month ago #293401 by krileon
The onCPayAfterPaymentStatusUpdateEvent event should always trigger if the payment status is changed. You should be checking for "Completed" or "Processed" status, but your code is only checking for "Completed" and is probably where your inconsistency is coming from.

We've several affiliate tracking integrations that are using this event. I recommend reviewing how they're doing things carefully. Specifically the below.

components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/plugin/cbsubsidevaf/cbsubs.idevaf.php

components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/plugin/cbsubsgoogleanalytics/cbsubs.googleanalytics.php

components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/plugin/cbsubspostafpro/cbsubs.postafpro.php


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.
Last edit: 7 years 1 month ago by krileon.

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

7 years 1 month ago #293415 by jamesmoeller
I have a follow-up question in regard to implementation on a non-public website, which may be related to my onCPayAfterPaymentStatusUpdateEvent trigger issue.

As I mentioned, I have a test website that is not publically accessible, only accessible on my private LAN, but like anything on my LAN, it has access to the Internet via my firewall/router. I'm 100% certain that I had PayPal transactions working with the donation plan on this website. I can see the payments under CBSubs >> Payments.

At least that was the case up until a few days ago when I went into my PayPal account and adjusted / verified that my IPN and PDT settings were as described in the text CBSubs >> Gateways >> PayPal. Now whenever I attempt to checkout via this website (before I get to the basket page), I get an error that says. "We cannot process this transaction because there is a problem with the PayPal email address supplied by the seller."

The CBSubs settings for the PayPal payment gateway for "PayPal Account and PDT Identity token" haven't changed and are the same as public sites that are working correctly.

Did something get updated where it will no longer work on a private website?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 68607
  • Thanks: 9108
  • Karma: 1434
7 years 1 month ago #293418 by krileon
Your payments maybe working due to the PDT. I don't see how IPNs could be working unless you setup routing for PayPal IP addresses through your firewall. Regarding the "We cannot process this transaction because there is a problem with the PayPal email address supplied by the seller." error that typically means the "PayPal Main receiver account (email) (if Business is different from your main account)" configured in your gateway does not match the primary email address in your PayPal account.


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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum

Facebook Twitter LinkedIn