Skip to Content Skip to Menu

[SOLVED] PAP integration long after first registration

  • activha
  • activha
  • OFFLINE
  • Posts: 2327
  • Thanks: 117
  • Karma: 13
10 years 11 months ago #237266 by activha
Replied by activha on topic PAP integration long after first registration
Thanks we'll use the auto action, it keeps compatibility when you 'll change something :-)

Is it php (eval) ?

This leads me to my other post relative to field modification while registering with the problem of afteruserregistration trigger when there is a payment to be made and the user is not yet activated

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48482
  • Thanks: 8283
  • Karma: 1443
10 years 11 months ago #237272 by krileon
Replied by krileon on topic PAP integration long after first registration

Is it php (eval) ?

A lot of hosts disable eval, but if your host hasn't disabled it then use it. If they have then use create_function. In almost all cases at least 1 of those methods should work.


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.

  • activha
  • activha
  • OFFLINE
  • Posts: 2327
  • Thanks: 117
  • Karma: 13
10 years 11 months ago #237299 by activha
Replied by activha on topic PAP integration long after first registration
We tried

cbimport( 'cb.session' );
CBCookie::setcookie( 'PAPVisitorId', '[cb_codeparrainpartenaire]' );

with onCPayBeforeStorePaymentBasketUpdated trigger but it seems that :

- fields are not correctly substituted in cbsubs , the cookie set is only a session cookie with
%5Bcb_codeparrainpartenaire%5D inside, not the real value

- the cookie set is for the domain, not the .domain

- the cookie is not overwriting the previous PAPVisitorId set by PAP earlier

Could you help ? any problem with cbsubs ?

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

  • activha
  • activha
  • OFFLINE
  • Posts: 2327
  • Thanks: 117
  • Karma: 13
10 years 11 months ago #237304 by activha
Replied by activha on topic PAP integration long after first registration
After long checks it seems like the fields are not understood by cbsubs and cbsubs integrations.
Core fields and adresses fields work well, but other are not substituted

So the code :
$user = CBuser::getMyUserDataInstance()

if ( $user->get( 'cb_refid' ) ) {
$affiliateID = $user->get( 'cb_refid' );
} else {
$affiliateID = stripslashes( cbGetParam( $_COOKIE, 'PAPVisitorId', null ) );
}
does not work neither in the integration.

Maybe a bug somewhere ??

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48482
  • Thanks: 8283
  • Karma: 1443
10 years 11 months ago #237333 by krileon
Replied by krileon on topic PAP integration long after first registration
Your cookie isn't setting the right value because there's no user object to act on during registration for that user. The best I can suggest is try to access the POST value if the field is on registration. Example as follows.

Code:
cbimport( 'cb.session' ); CBCookie::setcookie( 'PAPVisitorId', '[post_cb_codeparrainpartenaire]' );

As for the domain being incorrect that's entirely up to PAP as I have no idea what domain they're setting the cookie to. The setcookie function CBs session library provides is as follows, which you can specify a different domain and path as needed.

Code:
static function setcookie( $name, $value = '', $expire = false, $path = null, $domain = null, $secure = false, $httponly = false ) {

Your code isn't going to work because your trying to get "MyUser". This is the viewing user (the logged in user). In the case of registration one does not exist. So it's not going to do anything unless the user is already logged in. Please understand I am providing you with examples. They are not working code as I have not tested them; we do not provide custom coding 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 or Create an account to join the conversation.

  • activha
  • activha
  • OFFLINE
  • Posts: 2327
  • Thanks: 117
  • Karma: 13
10 years 11 months ago #237385 by activha
Replied by activha on topic PAP integration long after first registration
OK in fact we kept the set cookie for users already registered and went to a solution to reinit PAP cookies for all domains with CBCookie and trigger a new tracking with PAP and the correct cb_codeparrainpartenaire after.

Thanks a lot for your help on this :-)
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum