Help with payment process ReadMe info

They have: 1 posts

Joined: Oct 2009

I'm installing Amazon Simple Pay (like paypal) and I need some help with the instructions that read:
"A customer clicks on your Amazon SimplePay button
The customer is redirected to the co-branded user interface pipeline where they enter their payment credentials.
After the customer completes the pipeline they are redirected back to your website.
When the transaction completes, Amazon SimplePay will send an Instant Payment Notification (IPN) to your IPN script.
The IPN script receives data in the $_POST variable.
Use the SimplePay_IPN class to validate the IPN and then take the appropriate action."

<pre>
require 'SimplePay_IPN.php';
// Create a new SimplePay IPN validator, passing your AWS Secret Access Key
$SimplePayIPN = new SimplePay_IPN(AWS_SECRET_ACCESS_KEY);
/**
* Pass the $_POST variables to the IPN validator
* $SimplePayIPN->isValid($_POST) will return true if the POST fields match up with the signature from Amazon SimplePay
* $SimplePayIPN->isValid($_POST) will return false if the generated signature does not match
*/
if ($SimplePayIPN->isValid($_POST)) {
// The POST signature is valid
// Process the IPN -- log the data, update your database, etc...
} else {
// The POST signature is not valid
// Log the invalid IPN and take any needed actions
</pre>

The part I'm interested in getting help with is the part about logging. Can you give some ideas about the logging? Their is a log.txt file with the install files, but I don't see any data after I process a payment. Any guesses about where the transaction data might be logged would be helpful. I'd ultimately like to see the transaction data retreived into a website file.

Thanks.

He has: 629 posts

Joined: May 2007

Well, I'm no PHP expert, but what I have done in the past is use PHP's error_log function, even if I'm logging "success" instead of an error. You pass this function the message (string) that you want to log, and the path to the log file, which you make writable. Check out the specs for the error_log function for details.

Hope this helps.

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.