Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › WP Affiliate & PayPal
Tagged: WP Affiliate
- This topic has 6 replies, 2 voices, and was last updated 13 years, 6 months ago by mikee17.
-
AuthorPosts
-
May 19, 2011 at 3:10 pm #3437mikee17Member
Hi,
Does this http://www.tipsandtricks-hq.com/wordpress-affiliate/wp-content/uploads/2011/03/php-example-award-commission-http-post.txt script work on notify_url of PayPal ?
What if the sale amount = 0 ?
I tried and no sale is recorded…
I turned the debug log ON and here is what I get from the log.
—
[05/19/2011 3:05 PM] – SUCCESS :Start Processing…
[05/19/2011 3:05 PM] – SUCCESS :Request does not have any GET or POST data.. cannot process request
—
PS: I use the code for HTTP Post using cURL from the above link.
Thanks & Regards
May 19, 2011 at 4:52 pm #32689mikee17MemberHi,
1. I learned that the sale amount cannot be 0.
2. cURL and file_get_contents do not work on the notify_url page and requires browser execution.
Am I correct?
Thanks & Regards
May 20, 2011 at 12:51 am #32690amin007Participant1. I learned that the sale amount cannot be 0 – There is no point in doing a commission calculation on a 0 (zero amount) so I added that restriction but if for some reason you really need to have 0 amount then this condition can be taken out.
2. CURL can work on any script execution. You just can’t directly make that script your notify_url without doing modifications to it. For example you will need to massage the data you get from PayPal’s IPN then populate the variables correctly then execute the CURL POST. If you are simply trying to integrate with a PayPal button why not use this integration?
May 20, 2011 at 5:57 am #32691mikee17MemberSay for example, we have a MONTHLY subscription of 5 USD with ONE WEEK trail(0 USD) and would like to record a commission even though its not relevant. How do we take out the condition you say?
Saying when I used the script from the link I pasted above, it does not mean I used the script as it is… I have all the values in place, i.e…
cURL: $secretKey, $affiliate_id, $sale_amt
file_get_contents: $secret, $referrer, $sale_amt
Stil it did not work for both POST and GET methods, shall try again and get back on this.
May 20, 2011 at 6:30 am #32692mikee17MemberIf, I’m using direct SQL statements to insert values to ‘wp_affiliates_sales_tbl’ table, what do I do for ‘txn_id’ ?
i.e $txn_id = uniqid(); ? or can we use for ex. the payer_id => TT4B9D8ZKHBQA from paypal?
I have values from paypal on the notify_url page for >> refid, date, time, payment, sale_amount, item_id, buyer_email
Do I have to insert/update to any other table?
May 20, 2011 at 11:12 pm #32693amin007ParticipantYou can use a unique ID as the transaction ID. I prefer to use the transaction ID sent from PayPal (PayPal will also send you the transaction ID in the IPN… the name of the variable will be “txn_id”). Either method is fine though.
“Do I have to insert/update to any other table?” – No.
May 23, 2011 at 7:49 am #32694mikee17MemberThank you!
* I actually wanted to say ‘Transaction ID’ i.e ‘txn_id’, by mistake said ‘payer_id’ instead.
-
AuthorPosts
- You must be logged in to reply to this topic.