phpCOIN

Forum Rules Miscellaneous Add-Ons

For questions and issues dealing with miscellaneous add-ons that do not warrant their own forum, including questions about non-existant addons.

Pages: (6) [1] 2 3 ... Last » ( Go to first unread post ) Reply to this topicStart new topicStart Poll

> how do I integrate JAM Phpcoin and paypal? Please
mike-sol
Posted: July 28, 2009 01:15 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



HI again :-)

I have installed JAM affiliate scripts and to integrate this into phpcoin and paypal the documentation here: http://docs.phpcoin.com/index.php/JAM_Affiliate_Tracking is saying that:

# On your phpCOIN powered website, open up and edit /coin_modules/ipn/vendors/paypal/paypal.php
# Copy and Paste the following integration code in between these lines:

On my phpCOIN powered website I do not have this: /coin_modules/ipn/vendors/paypal/paypal.php

But I do have this: /coin_modules/ipn/vendors/paypal.php

And within this file I do not have this:

# should we accept data?
IF (!$_ACFG['IPN_ACCEPT_INCOMING']) {exit;}


But I do have this:

# Exit if we should NOT accept IPN data
IF (!$_ACFG['IPN_ACCEPT_INCOMING']) {
IF ($_CCFG['PAYPAL_WRITEDEBUG']) {
fputs($open_file, "Not Accepting IPN - Exiting IPN\r\n\r\n");
fclose($open_file);
}
exit();
}


# If incoming connection is from ourselves (testing):
# - set "good data" flag

So I'm a little confused as to how to configure this.

Any ideas please?

Thanks

Mike
PMEmail Poster
Top
lightman
Posted: July 28, 2009 02:24 pm
Quote Post


The Janitor
***

Group: Admin
Posts: 3,639
Member No.: 3
Joined: August 25, 2006



No idea - this add-on was contributed by a user - see the readme.txt included in the package and http://docs.phpcoin.com/index.php/JAM_Affiliate_Tracking

Contact the contributor directly for support of this add-on smile.gif


--------------------
***** Unless otherwise stated, all replies refer to the following *****
====================================================================
--- The latest unmodified version of phpCOIN available from the phpCOIN download page on the date and time of this post.
--- All relevant HotFix files applied - One of the four included unmodified themes - The original language files .
--- Help will be given to install/configure/use phpCOIN, but not programming help to modify phpCOIN operations. If you are competent enough to make programming changes, you should be competent enough to read the source code and figure things out :)
PM
Top
cantex
Posted: July 28, 2009 02:42 pm
Quote Post


Chief Cook & Bottle Washer
***

Group: Archive
Posts: 3,252
Member No.: 1
Joined: August 25, 2006



As lightman said, the JAM code was contributed ~ we do not use it, nor did we write it.

However, there is light at the end of the tunnel.

Back around v1.6.0 we did a "cleanup" of the Admin -> Parameters to make them easier to find and understand. If docs references an $_ACFG element but you have an $_CCFG element, pretend that the docs actually say $_CCFG and everything should work.

As far as /coin_modules/ipn/vendors/paypal/paypal.php vs /coin_modules/ipn/vendors/paypal.php it is either a typo or again, the result of code clean-up along the way to v1.6.3
Again, pretend that the docs say to use what you do have and things should be OK


--------------------
================================================================
Please do not email or PM me with a question:
1: I handle over a thousand emails a day, so chances are yours would be buried in the pile.
2: All questions will only be answered in the support forums, so the answers will be useful to others.

Help will be given to install/configure/use phpCOIN, but not programming help to modify phpCOIN operations. If you are competent enough to make programming changes, you should be competent enough to read the source code and figure things out :)

If you are trying to integrate posted sample code into your website, please take into account any changes in phpCOIN made after the code sample was posted. It is discouraging to spend hours answering questions or trying to track down an issue only to find that the user has a version of phpCOIN that makes the sample irrelevant
PM
Top
nimasdj
Posted: July 31, 2009 02:54 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



mike-sol, if you are absolutely sure your paypal ipn installation is right and /coin_modules/ipn/vendors/paypal/paypal.php is the correct place the file should be, it means the design changed since I contributed that and the file moved to this new location in later versions.

Anyway, the block should be placed here:

# Exit if we should NOT accept IPN data
IF (!$_ACFG['IPN_ACCEPT_INCOMING']) {
IF ($_CCFG['PAYPAL_WRITEDEBUG']) {
fputs($open_file, "Not Accepting IPN - Exiting IPN\r\n\r\n");
fclose($open_file);
}
exit();
}
// ADD JAM block here.

This post has been edited by nimasdj on July 31, 2009 02:56 pm


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
nimasdj
Posted: July 31, 2009 03:02 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



sorry I meant if you are sure /coin_modules/ipn/vendors/paypal.php is the correct place the file should be then it is a change since I wrote that doc and just place the code block where I told you and it's fine.


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
mike-sol
Posted: July 31, 2009 05:40 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



Thanks for the reply.

I just checked my code and in this page "coin_modules/ipn/vendors/paypal.php" I have this code:

CODE

# Exit if we should NOT accept IPN data
IF (!$_CCFG['IPN_ACCEPT_INCOMING']) {
 IF ($_CCFG['PAYPAL_WRITEDEBUG']) {
  fputs($open_file, "Not Accepting IPN - Exiting IPN\r\n\r\n");
  fclose($open_file);
 }
 exit();
}

###################################
## INTEGRATE JAM AFFILIATE CODE ##
###################################
  if (isset($_GPV['txn_id']) AND isset($_GPV['custom'])) {
       $JAM_Affiliate_URL = "http://www.mydomain.com/affiliates"; //DO NOT ADD TRAILING SLASH
       if (function_exists(curl_init)) {
            if (isset($_GPV['reason_code']) AND $_GPV['reason_code'] == 'refund') {
                 $secret = 'mysecret'; //ENTER YOUR SECRET CODE FOR AUTOMATIC REFUND MODULE
                 $url = $JAM_Affiliate_URL . "/refund.php?transaction_id=".
                    $_GPV['parent_txn_id'] ."&secret=".$secret;
                 $ch = curl_init($url);
                 curl_setopt($ch, CURLOPT_HEADER, 0);
                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                 $resp = curl_exec($ch);
                 curl_close ($ch);
            } else {
                 $url = $JAM_Affiliate_URL . "/sale.php?amount=".$_GPV['mc_gross']
                    ."&trans_id=".$_GPV['txn_id']."&custom_mid=".$_GPV['custom'];
                 $ch = curl_init($url);
                 curl_setopt($ch, CURLOPT_HEADER, 0);
                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                 $resp = curl_exec($ch);
                 curl_close ($ch);
            }
       }
  }
################################
## END JAM INTEGRATION CODE ##
###############################

# If incoming connection is from ourselves (testing):
# - set "good data" flag
# - Do NOT set "proceed" flag
IF (strpos($_ref, BASE_HREF) !== FALSE) {
 $_CONFIRMED++;

 IF ($_CCFG['PAYPAL_WRITEDEBUG']) {
  fputs($open_file, "  Connection Is From Self-Testing\r\n");
 }

# If incoming connection is from PayPal:
# - Do NOT set "good data" flag


I could search my whole site to see if there is code there that should not be there that could be calling this ipn thing twice.

What would I search for?

Or where else could I look for this?

I have put my paylink on here and don't know where else to look.

Thanks.

Mike




PMEmail Poster
Top
mike-sol
Posted: August 01, 2009 07:30 am
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



Making more attempts at getting this bank transfer paylink to send data to JAM affiliate control panel.

My Paylink code in phpcoin is:

<form method=\"POST\" action=\"mod.php\">
<input type=\"hidden\" name=\"mod\" value=\"orders\">
<input type=\"hidden\" name=\"mode\" value=\"return\">
<input type=\"hidden\" name=\"transfer\" value=\"1\">
<input type=\"hidden\" name=\"item_name\" value=\"<prod_desc>\">
<input type=\"hidden\" name=\"item_number\" value=\"<prod_id>\">
<input type=\"hidden\" name=\"currency_code\" value=\"EUR\">
<input type=\"hidden\" name=\"amount\" value=\"<total_amt>\">
<input type=\"hidden\" name=\"invoice\" value=\"<invoice_id>\">
<input type=\"submit\" value=\"Confirm\" name=\"confirm\">
</form>
<form method=\"POST\" action=\"mod.php\">
<input type=\"hidden\" name=\"mod\" value=\"orders\">
<input type=\"hidden\" name=\"mode\" value=\"return\">
<input type=\"hidden\" name=\"transfer\" value=\"0\">
<input type=\"submit\" value=\"Cancel\" name=\"cancel\">
</form>

<img border=\"0\" src=\"http://www.mydomain.com/affiliates/sale.php?amount=$<total_amt>&trans_id=$<invoice_id>\" width=\"1\" height=\"1\">


Placing an order via my affiliate link produces this output on the phpcoin paylink page (source code shown).

<form method="POST" action="mod.php">
<input type="hidden" name="mod" value="orders">
<input type="hidden" name="mode" value="return">
<input type="hidden" name="transfer" value="1">
<input type="hidden" name="item_name" value="testproduct">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="amount" value="12.00">
<input type="hidden" name="invoice" value="19">
<input type="submit" value="Confirm" name="confirm">
</form>
<form method="POST" action="mod.php">
<input type="hidden" name="mod" value="orders">
<input type="hidden" name="mode" value="return">
<input type="hidden" name="transfer" value="0">
<input type="submit" value="Cancel" name="cancel">
</form>

<img border="0" src="http://www.mydomain.com/affiliates/sale.php?amount=$12.00&trans_id=$19" width="1" height="1">

I assume that I have to use the invoice number as the trans_id for bank transfers?

But nothing is being sent to my JAM affiliate control panel.

I have modified my api.php in paypal and I have all my phpcoin api's turned on.

Where have I gone wrong?

I have a feeling it is somewhere with the <img border="0" src="http://www.mydomain.com/affiliates/sale.php?amount=$12.00&trans_id=$19" width="1" height="1"> ?

I don't know. I need help please.

Thanks

Regards

Mike
PMEmail Poster
Top
mike-sol
Posted: August 01, 2009 09:45 am
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



Finally fixed it.

For the benefit of others:

Correct: <img border="0" src="http://www.mydomain.com/affiliates/sale.php?amount=<total_amt>&trans_id=<invoice_id>" width="1" height="1">


I had this: <img border="0" src="http://www.mydomain.com/affiliates/sale.php?amount=$<total_amt>&trans_id=$<invoice_id>" width="1" height="1">

Just a couple of $$ was screwing it all up!

At last :-)
PMEmail Poster
Top
cantex
Posted: August 01, 2009 03:12 pm
Quote Post


Chief Cook & Bottle Washer
***

Group: Archive
Posts: 3,252
Member No.: 1
Joined: August 25, 2006



Thanks for the update


--------------------
================================================================
Please do not email or PM me with a question:
1: I handle over a thousand emails a day, so chances are yours would be buried in the pile.
2: All questions will only be answered in the support forums, so the answers will be useful to others.

Help will be given to install/configure/use phpCOIN, but not programming help to modify phpCOIN operations. If you are competent enough to make programming changes, you should be competent enough to read the source code and figure things out :)

If you are trying to integrate posted sample code into your website, please take into account any changes in phpCOIN made after the code sample was posted. It is discouraging to spend hours answering questions or trying to track down an issue only to find that the user has a version of phpCOIN that makes the sample irrelevant
PM
Top
nimasdj
Posted: August 04, 2009 02:33 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



I see you actually did not bother to read the instruction I wrote in wiki!

For paypal payment, you need to add that jam code in paypal.php ipn file and that javascript within the paypal form. nothing else is necessary.

and for bank transfer and check, you need to change the api.php file I wrote in wiki and a modified api.php is available on download page too. with api system you won't need to that hidden image tag any more nor you need to have anything in transfer/check payment form. api modification does everything for you.


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
nimasdj
Posted: August 04, 2009 02:36 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



I also noticed you did not edit below in jam code added to your paypal.php

CODE
      $JAM_Affiliate_URL = "http://www.mydomain.com/affiliates"; //DO NOT ADD TRAILING SLASH


and is it correct?

CODE
$secret = 'mysecret'; //ENTER YOUR SECRET CODE FOR AUTOMATIC REFUND MODULE


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
nimasdj
Posted: August 04, 2009 02:37 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



QUOTE (cantex @ August 01, 2009 02:12 pm)
Thanks for the update

There is no update. That user is in a wrong way as I explained above.


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
mike-sol
Posted: August 04, 2009 03:05 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



Hi and thanks for the reply.

Yes I read the wiki. Several times.

I was reading stuff all over the place and a little overwhelmed and confused by it all.

Yes I have probably made mistakes in my coding which led to some of my problems.

I could not run with all the API's on as I said in one of my posts. Then after a mod somewhere someone told me only to turn some of them on. They are all off now and its working.

QUOTE
$JAM_Affiliate_URL = "http://www.mydomain.com/affiliates"; //DO NOT ADD TRAILING SLASH


QUOTE
$secret = 'mysecret'; //ENTER YOUR SECRET CODE FOR AUTOMATIC REFUND MODULE


As for the above yes I did edit these lines in my files but when I post on this forum I edited them out again. Not going to give "my secret" to everyone here.

Yes nimasdj I followed all your instructions as best I could and thanks for writing it all out as you have.

Think I have finally got it all working. And I'm using the image tag in the paylink which caused me problems as I was getting duplicated commissions in JAM each time the paylink displayed. But I have set the "Duplicate Transaction Monitor in Minutes" to the max so that should fix that.

You guys probably know this software inside out so it is easy to say I should have done this or that. I have had to learn it as I go and yes I have made lots of errors. I just have to get this working one way or another.

Thanks for all you help, really.

Regards

Mike




PMEmail Poster
Top
nimasdj
Posted: August 04, 2009 04:08 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



No problem you can't give url here (I too would not give mine smile.gif ), just wanted to make sure if your edited them...

Sorry if the wiki was unclear. I hope cantex edit it in better English.

No need to turn all api on, just turn on the ones used for integration. what is your problem turing them on? api thing is necessary only for bank transfer and check. for paypal only that code in paypal.php and JS in paypal form.

If you get duplication commissions, this is because you are sending the information twice. for example if you modify paypal.php with the code and paypal form with the JS and still are using hidden image tag with them, the purchase information will be sent twice. the same if you use api.php with image tag.

Are you sure you did not add image tag anywhere else but in api.php? for example did you add image tag in payment forms?


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
mike-sol
Posted: August 04, 2009 04:48 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



I would not say it was unclear. It's just that if I were a coder in these languages I would know exactly what to do and regognize bad syntax straight away. If I have missed out a "$" or put one where it should not be I could spend hours trying to find out why it wont work. As in my case I had two "$" that should not have been there. I just could not see it. That's why I kept posting to the board hoping someone would see my mistake.

When I turned on the API's several test paypals went through ok. Then another gave me a totally blank center module with "checking not logged in user at the top". Could not do anything with it. So turned all API's off again and paypal worked fine. Refunds too, phpcoin and JAM!


Then some days later I followed your instructions to get the "bank transfer" working. I was reluctant to use API's turned on because I knew that turning on the API's were going to cause a problem. Anyway I turned them on in an attempt to get the bank transfer working and the blank center module with "checking not logged in user at the top" came back again. By now I'm spitting feathers and getting real frustrated with the whole thing.

So thinking that I would be better off with those API's turned off I looked at other ways of getting it done.

Also the original duplicate commissions were because when using the paypal sand box I was having to accept the payments which were firing off two IPN's for the same transaction. Once I had set that to accept by default all was well there.

Image tag in the bank transfer paylink did the trick eventually when I got the syntax correct. It's easier when you know what to do. But getting there can be a pig.

Anyway I thought that the image link in the paylink was the solution... Until I started getting duplicate commissions again in JAM. Then I found out it was the image tag loading each time the paylink was called.

The only way to fix that was to set the "Duplicate Transaction Monitor in Minutes" to 9999 minutes. Almost 7 days. Not ideal but it worked.

As long as I completed the bank transfer within 7 days I would not see a duplicate commission!

It is not right now, so I will create another paylink and try the API route again.

I'm sure you will hear me screaming for help sometime tomorrow afternoon.

Thanks for your help

Regards

Mike

Ps: "Are you sure you did not add image tag anywhere else but in api.php? for example did you add image tag in payment forms?"

I thought the image tag only went in the paylink, not the api.php? I did mod the api.php but don't remember and image tag being in there?? I'll check that in the morning.
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic OptionsPages: (6) [1] 2 3 ... Last » Reply to this topicStart new topicStart Poll

 


Inscrita el Registro Mercantil de Mallorca Tomo 2140, Hoja No. PM-51034, Folio 135
This website owned and operated by: Technology Services RPVW S.L. CIF# B57345084
Avda Constitucion 48 Bajos Alaro 07340 Baleares SPAIN
Tel:+34 971518362    Fax: +34 971518368    eMail: support@phpcoin.com