Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › Integration with JROX Jam Affiliate Manager
- This topic has 30 replies, 4 voices, and was last updated 14 years, 10 months ago by amin007.
-
AuthorPosts
-
December 17, 2009 at 11:10 pm #577wisconsinMember
Hi, I am using JROX JAM Affiliate manager and per their instructions I need to:
Add the following lines of hidden code to your buy now or checkout buttons.
Only works for unencrypted Paypal buttons.
<input type=”hidden” name=”notify_url” value=”http://www.yourdomain.net/affiliates/plugins/payments/paypal/plugin_paypal_payments.php”> <script language=”JavaScript” type=”text/javascript” src=”http://www.yourdomain.net/affiliates/showaff.php?id=paypal”></script>
Can you please tell me what file and what line I should insert this into?
Thanks,
Chris
December 18, 2009 at 7:17 am #16824amin007ParticipantI am guessing you want to use that with the WP eStore plugin? If yes then note that the WP eStore plugin already uses the IPN (instant payment notification) feature of PayPal to do the post payment processing stuff (eg. deliver the digital products). PayPal only sends IPN to one script so if you add that bit of code it will send the IPN to the JROX Jam affiliate software instead of the eStore plugin and the WP eStore won’t be able to do any post payment processing work.
If they have an integration option like the iDev Affiliate software whereby you can call a PHP function for the commission award then I can accommodate that.
December 18, 2009 at 11:25 am #16825wisconsinMemberYes. The eStore plugin. I have this too…
$JAMIntegrate = file_get_contents(“http://www.yourdomainname.net/affiliates/sale.php?amount=”.$paypal_amount.”&trans_id=”.$txn_id.”&custom_mid=”.$_COOKIE.””);
What would I do with it?
Here are the instructions from JROX Jam Affiliate Manager:
System Integration using a PHP script
To integrate JAM into your website / application using a PHP Script, use the following directions:
1. Your landing or thank you page must be written in PHP.
2. Click on Settings>System Integration, select PHP Script on the Integration Type drop down list.
3. Enter the variable name set by your payment processor for amount as the Sale Amount variable to use.
4. Enter the variable name set by your payment processor for transaction or order ID as the Transaction ID variable to use.
5. Enable and enter any more custom variables you want to record as specified by your payment processor. These may include product ID, customer ID, etc. You can name up to 5 different custom variables of your choice.
6. Click Save Integration Settings.
7. Open up your php landing or thank you page, and copy and paste the PHP Code into your web page. Make sure that all variables are correct.
December 18, 2009 at 1:49 pm #16826wisconsinMemberOK a couple of things. I am hoping that one way or another we can come up with a solution.
1) Following the JROX instructions In the last post, I created a thank you page and put the php code there (I am using the exec-php plugin). That script does call for &custom_mid=”.$_COOKIE. which I realize paypal has no clue about. Any Idea how I can get paypal to get and send that cookie back to my thank you page?
OR
2) According to this post http://forums.jrox.com/index.php/topic,1416.msg6047.html#msg6125 “apparently we CAN have more than one script using paypal IPN the trick is to code the IPN into the actual BUY NOW button using
notify_url right in the code”. Please see the comment from JROX admin following that. Does this mean that I can use the method from my first post? If so where would I put that code?
…and currently my paypal ipn is http://www.mydomainname.net/affiliates/plugins/payments/paypal/plugin_paypal_payments.php
does any of this affect that setting.
Your help would be greatly appreciated as I did not anticipate this delay because I was able to make JROX work with the simple shopping cart and I am due to launch my affiliate program this evening on a conference call.
thanks
chris
December 18, 2009 at 3:03 pm #16827wisconsinMemberOne more thing I found related to your script, but I am not clear about what it is suggesting. Can you translate for me?
http://forums.jrox.com/index.php/topic,3716.0.html
I did ad the 2nd “$output” to eStore_cart.php but I am not clear on which code I need to put where related to the “php_coin” example in the referenced post.
$output .= ‘<input type=”image” src=”‘.$checkout_button.'” name=”submit” class=”eStore_paypal_checkout_button” alt=”Checkout” />’;
$output .= ‘<script language=”JavaScript” type=”text/javascript” src=”http://WWW.DOMAIN.COM/AFFILIATES/showaff.php?id=paypal”></script>’;
$output .= ‘</form>’;
…at the end of the day I just need a quick solution…
Please help!
December 19, 2009 at 2:11 am #16828amin007Participantokay lots of information for me (given I am not very familiar with the JROX Jam affiliate program I will try to answer as best as I can.
1) You can use the “custom” variable of PayPal to pass the cookie variable. custom variable is a pass thru variable.
2) Yes you can have more than one script using the IPN but not at the same time. What is means is that PayPal won’t send the IPN to two scripts after the payment for a particular payment. You can specify the IPN URL in your profile but as soon as you use the “notify_url” variable specifying the IPN URL for a button it will get overriden (eStore does this).
3) The simple shopping cart doesn’t use the IPN feature as it doesn’t do any post payment processing work. You can turn of the IPN in eStore so it acts like the simple shopping cart but you won’t get all the features of eStore (eg. automatic delivery of digital products via email).
I think one of these two methods might be a feasible integration option:
a) System Integration using a PHP script.
b) Forward the IPN received by eStore to the JROX system. (http://jam.jrox.com/docs/index.php?article=114)
step (a) sounds easier. Here are the name of the variables that you will need.
total amount = mc_gross
transaction ID = txn_id
The “mc_gross” field will have the total amount and the “txn_id” field will have the transaction id.
Is there example code available for this integration option from the JROX Jam affiliate program?
December 19, 2009 at 5:47 am #16829wisconsinMemberThanks for the response and the effort put into understanding JROX. If I use the php script method the code placed in my “Thank you” page would be:
$JAMIntegrate = file_get_contents(“http://www.prontopage.net/affiliates/sale.php?amount=”.$mc_gross.”&trans_id=”.$txn_id.”&custom_mid=”.$_COOKIE.””);
The missing piece is the “&custom_mid=”.$_COOKIE. portion… do you know how would I get the cookie from eStore to PayPal and back?
Regarding examples: First JROX purports that they integrate with just about everything… http://jam.jrox.com/compatibility/
They list examples of all here… http://jam.jrox.com/docs/index.php?category=11
I think that if we can get the cookie piece we’ll be ok…
If you want to see what this all looks like you can use the JAM demo here.
>Login to the Admin area
>click “Settings” in the upper right corner
>click “System Integration” in the lower left corner
>Under “Integration Type” you can select the various drop downs to see the various codes generated for integration.
Thanks for helping with this,
Chris
December 19, 2009 at 11:36 pm #16830amin007ParticipantThe following bit of code that you are putting is on the “Thank You” page:
$JAMIntegrate = file_get_contents(“http://www.prontopage.net/affiliates/sale.php?amount=”.$mc_gross.”&trans_id=”.$txn_id.”&custom_mid=”.$_COOKIE.””);
which means you don’t need to transfer the cookie variable to paypal as it can be directly accessed by the following PHP command:
$_COOKIE
so if I understand correctly you just have to specify the total amount and the transaction ID. The cookie part is fine as it is.
I am pretty sure the cookie is set when someone visits your site following an affiliate link. Did you simulate that part to make sure the cookie is set so you can test the commission awarding part?
December 22, 2009 at 3:55 pm #16831wisconsinMemberHi,
I did get a response from JROX as follows:
admin response by Ryan Dec 22 2009 03:19:30 AM
Integration – eStore WordPress Plug in that uses the PayPal IPN: Please help!
if your estore is already using the notify_url (IPN), you will have to find a way to transport the JROX cookie on the paypal form. normally, we use the ‘custom’ field to transport the cookie, like so:
<input type=”hidden” name=”custom” value=”‘ . $_COOKIE . ‘” />
then on the paypal IPN file of your estore, you add the PHP script:
$JAMIntegrate = file_get_contents(“http://www.mydomainname.com/affiliates/sale.php?amount=”.$_POST.”&trans_id=”.$_POST.”&custom_mid=”.$_POST);
Can you tell me where I should place these pieces of code… what files and what lines?
December 22, 2009 at 9:04 pm #16832amin007ParticipantNow it becomes soooooo much easier… this is what I asked for when I mentioned how I integrated WP eStore with the iDev affiliate program.
Integrating WP eStore with JROX Jam Affiliate Software
1. Open the “wp_eStore1.php” file and find the following function:
function eStore_get_custom_field_value()
once you find it just add the following towards the end of the function (just before the return statement):
$name = 'jrox_cookie';
$value = $_COOKIE['jrox'];
$custom_field_val = append_values_to_custom_field($name,$value);That will add it to the custom field.
2. Now open the “paypal.php” file and search for the following line:
$this->debug_log(‘Updating Affiliate Database Table with Sales Data if Using the WP Affiliate Platform Plugin.’,true);
once you find that line add the following bit of code just before that line:
$sale_amt = $this->ipn_data;
$trans_id = $this->ipn_data;
$jrox_cookie = $customvariables;
$JAMIntegrate = file_get_contents(“http://www.mydomainname.com/affiliates/sale.php?amount=”.$sale_amt.”&trans_id=”.$trans_id.”&custom_mid=”.$jrox_cookie);
$this->debug_log(‘Awarding JROX affiliate commission.’,true);
That should do it. Let me know how you go.
December 22, 2009 at 9:50 pm #16833wisconsinMemberHi – thanks for getting back to me so quickly. For some reason it’s not registering..
Here is what I did:
1. wp-eStore1.php
..around line 530ish
if (!empty($_SESSION))
{
$name = ‘coupon’;
$value = $_SESSION;
$custom_field_val = append_values_to_custom_field($name,$value);
}
//Begin CJ added per https://support.tipsandtricks-hq.com/forums/topic/integration-with-jrox-jam-affiliate-manager
$name = ‘jrox_cookie’;
$value = $_COOKIE;
$custom_field_val = append_values_to_custom_field($name,$value);
//End CJ added
return $custom_field_val;
}
function append_values_to_custom_field($name,$value)
2. paypal.php
…around line 468ish
$this->debug_log(‘Infusionsoft signup result: ‘.$result,true);
}
}
//CJ added begin https://support.tipsandtricks-hq.com/forums/topic/integration-with-jrox-jam-affiliate-manager
$sale_amt = $this->ipn_data;
$trans_id = $this->ipn_data;
$jrox_cookie = $customvariables;
$JAMIntegrate = file_get_contents(“http://www.myactualdomainname.com/affiliates/sale.php?amount=”.$sale_amt.”&trans_id=”.$trans_id.”&custom_mid=”.$jrox_cookie);
$this->debug_log(‘Awarding JROX affiliate commission.’,true);
//CJ added end
$this->debug_log(‘Updating Affiliate Database Table with Sales Data if Using the WP Affiliate Platform Plugin.’,true);
Have i miss-entered anything?
December 22, 2009 at 10:08 pm #16834amin007ParticipantOkay lets output some debug to see if any value is missing. Please replace the bit of code that you put in “paypal.php” earlier with the follwoing bit:
$this->debug_log(‘Preparing JROX affiliate commission.’,true);
$sale_amt = $this->ipn_data;
$trans_id = $this->ipn_data;
$jrox_cookie = $customvariables;
$this->debug_log(‘Trans ID: ‘.$trans_id.’ Sale amount: ‘.$sale_amt.’ Cookie value: ‘.$jrox_cookie,true);
$JAMIntegrate = file_get_contents(“http://www.myactualdomainname.com/affiliates/sale.php?amount=”.$sale_amt.”&trans_id=”.$trans_id.”&custom_mid=”.$jrox_cookie);
$this->debug_log(‘Awarding JROX affiliate commission :’.$JAMIntegrate,true);
then save and upload the file to your server and do a test transaction (make sure you have the “Enabel Debug” checkbox checked from the settings menu of the plugin). When you process a transaction with the debug option enabled it will log everything int he “ipn_handle_debug.log” file. Please post the contet of that file or email it to me.
Also can you please post a link to the page where you have the payment button on your site?
December 22, 2009 at 10:16 pm #16835wisconsinMemberHere is one of them http://prontopage.net/googlelocalsearch/?page_id=2
I will run the debug test right now and post in a moment…
December 22, 2009 at 10:29 pm #16836wisconsinMemberOK. I have attached the debug log.
I did notice that the “custom” field is not being added to the checkout page…
thanks for helping me get this fixed… I am sure we are close…
[12/22/2009 4:20 PM] – SUCCESS :Paypal Class Initiated by 66.211.170.66
[12/22/2009 4:20 PM] – SUCCESS :Post string : mc_gross=0.25&protection_eligibility=PartiallyEligible&address_status=unconfirmed&item_number1=1&payer_id=ZKW8795TXX648&tax=0.00&address_street=2920+Ellis+Street&payment_date=14%3A20%3A16+Dec+22%2C+2009+PST&payment_status=Completed&charset=windows-1252&address_zip=54701&mc_shipping=0.00&mc_handling=0.00&first_name=Chris&mc_fee=0.25&address_country_code=US&address_name=Chris+John¬ify_version=2.8&custom=&payer_status=unverified&business=info%40prontopage.net&address_country=United+States&num_cart_items=1&mc_handling1=0.00&address_city=Eau+Claire&verify_sign=AiPC9BjkCyDFQXbSkoZcgqH3hpacA4CYlLU9qQg.RLXS3oR0ZuFrTP2j&payer_email=cj137%40charter.net&mc_shipping1=0.00&tax1=0.00&txn_id=0ML91838BK030305P&payment_type=instant&last_name=John&address_state=WI&item_name1=Pronto+Local+Business+Listings+Pro&receiver_email=info%40prontopage.net&payment_fee=0.25&quantity1=1&receiver_id=L7JMHMCZUQT92&txn_type=cart&mc_gross_1=0.25&mc_currency=USD&residence_country=US&transaction_subject=Shopping+Cart&payment_gross=0.25&
[12/22/2009 4:20 PM] – SUCCESS :Connection to http://www.paypal.com successfuly completed.
[12/22/2009 4:20 PM] – SUCCESS :IPN successfully verified.
[12/22/2009 4:20 PM] – SUCCESS :Creating product Information to send.
[12/22/2009 4:20 PM] – SUCCESS :Transaction Type: Shopping Cart
[12/22/2009 4:20 PM] – SUCCESS :Number of Cart Items: 1
[12/22/2009 4:20 PM] – SUCCESS :Item Number: 1
[12/22/2009 4:20 PM] – SUCCESS :Item Name: Pronto Local Business Listings Pro
[12/22/2009 4:20 PM] – SUCCESS :Item Quantity: 1
[12/22/2009 4:20 PM] – SUCCESS :Item Total: 0.25
[12/22/2009 4:20 PM] – SUCCESS :Item Currency: USD
[12/22/2009 4:20 PM] – SUCCESS :Download Link : Pronto Local Business Listings Pro – This product does not have any downloadable content
[12/22/2009 4:20 PM] – SUCCESS :Product Email successfully sent to cj137@charter.net.
[12/22/2009 4:20 PM] – SUCCESS :Notify Email successfully sent to cj137@charter.net.
[12/22/2009 4:20 PM] – SUCCESS :Updating Products, Customers, Coupons, Sales Database Tables with Sales Data.
[12/22/2009 4:20 PM] – SUCCESS :Products, Customers, Coupons, Sales Database Tables Updated.
[12/22/2009 4:20 PM] – SUCCESS :Updating Affiliate Database Table with Sales Data if Using the WP Affiliate Platform Plugin.
[12/22/2009 4:20 PM] – SUCCESS :Not Using the WP Affiliate Platform Plugin.
[12/22/2009 4:20 PM] – SUCCESS :Paypal class finished.
December 22, 2009 at 10:56 pm #16837wisconsinMemberSince I am not hearing back from you right away, I am going to go ahead and test something. I just wanted to be aware in case you happened to do a view source of my page with the paypal button. I didn’t want to confuse things…
-
AuthorPosts
- You must be logged in to reply to this topic.