Site Menu

Readymade PayPal IPN Access Database

The database and code sample that I posted are incomplete. I will leave them below in case they are of interest to anyone. A far better resource is here: ENJOY :)

PayPal Independent Payment Notification (IPN), coupled with or without Payment Data Transfer (PDF) is actually very simple. Sometimes when you're renewing your acquaintance with it, or if you are new to it, the information that is available makes it seem much more complicated than it really is.

For one thing, all the stuff about SDK (software developer's kit) may put one on the wrong track. You don't need to mess with SDK to use IPN/PDT.

The PayPal Sandbox is very useful for learning how to set this stuff up, and for testing scripts. I'm slow on the uptake and it took me awhile to figger out how to use the Sandbox, LOL. Here's how:

1. Create a developer account at http://developer.paypal.com/ then set up two test accounts (or more if you like) under the Sandbox tab. ONE account should become a test merchant account -- you'll have to go through the process of upgrading that fake sandbox account to merchant, etc. Create a second fake sandbox account to be your fake customer to buy fake stuff from the fake merchant.

2. Launch your fake merchant's Sandbox and use the PayPal shopping cart generator then publish your practice shopping cart on your site. Send your fake merchant shopping. Everything they "buy" will be posted not to the official real PayPal site, but to <form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> and their fake money is paid to your fake merchant.

3. The fake IPN/PDT of your fake merchant is posted by the PayPal Sandbox to your IPN script and even your database if you have one set up properly.

BTW--I posted these notes as reminder to myself as well as a mini-guide to newbies. If you don't work with this stuff all the time, it is easy to confused all over again.

Here is a paypal Access database for you to download. The idea is, if you are working on a PayPal.com IPN script, maybe this will save you some time.

I went looking for one already set up and couldn't find one that was free. So I made this one. I hope it will work OK. If anyone tries it and finds problems with it, please let me know. Your suggestions for its improvement would be much appreciated!

If you find it helpful, please rate:
Rated:
by Aspin.com users
What do you think?

 

 

 

Recordset code for Payments:

xDb_Conn_Str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("../../database/PAYPALMBD.mdb") & ";"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str
strsql = "SELECT * FROM [PAYMENTS] WHERE 0 = 1"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 2
rs.AddNew

rs("RECEIVER_EMAIL")=Request.Form("receiver_email")
rs("BUSINESS")=Request.Form("business")
rs("ITEM_NAME")=Request.Form("item_name")
rs("ITEM_NUMBER")=Request.Form("item_number")
rs("QUANTITY")=Request.Form("quantity")
rs("INVOICE")=Request.Form("invoice")
rs("CUSTOM")=Request.Form("custom")
rs("OPTION_NAME1")=Request.Form("option_name1")
rs("OPTION_SELECTION1")=Request.Form("option_selection1")
rs("OPTION_NAME2")=Request.Form("option_name2")
rs("OPTION_SELECTION2")=Request.Form("option_selection2")
rs("NUM_CART_ITEMS")=Request.Form("num_cart_items")
rs("PAYMENT_STATUS")=Request.Form("payment_status")
rs("PENDING_REASON")=Request.Form("pending_reason")
rs("PAYMENT_DATE")=Request.Form("payment_date")
rs("SETTLE_AMOUNT")=Request.Form("settle_amount")
rs("SETTLE_CURRENCY")=Request.Form("settle_currency")
rs("EXCHANGE_RATE")=Request.Form("exchange_rate")
rs("PAYMENT_GROSS")=Request.Form("payment_gross")
rs("PAYMENT_FEE")=Request.Form("payment_fee")
rs("MC_GROSS")=Request.Form("mc_gross")
rs("MC_FEE")=Request.Form("mc_fee")
rs("MC_CURRENCY")=Request.Form("mc_currency")
rs("TAX")=Request.Form("tax")
rs("TXN_ID")=Request.Form("txn_id")
rs("TXN_TYPE")=Request.Form("txn_type")
rs("REASON_CODE")=Request.Form("reason_code")
rs("FOR_AUCTION")=Request.Form("for_auction")
rs("AUCTION_BUYER_ID")=Request.Form("auction_buyer_id")
rs("AUCTION_CLOSE_DATE")=Request.Form("auction_close_date")
rs("AUCTION_MULTI_ITEM")=Request.Form("auction_multi_item")
rs("MEMO")=Request.Form("memo")
rs("FIRST_NAME")=Request.Form("first_name")
rs("LAST_NAME")=Request.Form("last_name")
rs("ADDRESS_STREET")=Request.Form("address_street")
rs("ADDRESS_CITY")=Request.Form("address_city")
rs("ADDRESS_STATE")=Request.Form("address_state")
rs("ADDRESS_ZIP")=Request.Form("address_zip")
rs("ADDRESS_COUNTRY")=Request.Form("address_country")
rs("ADDRESS_STATUS")=Request.Form("address_status")
rs("PAYER_EMAIL")=Request.Form("payer_email")
rs("PAYER_ID")=Request.Form("payer_id")
rs("PAYER_STATUS")=Request.Form("payer_status")
rs("PAYMENT_TYPE")=Request.Form("payment_type")
rs("NOTIFY_VERSION")=Request.Form("notify_version")
rs("VERIFY_SIGN")=Request.Form("VERIFY_SIGN")

'Recordset code for subscriptions:

rs("SUBSCR_DATE")=Request.Form("subscr_date")
rs("SUBSCR_EFFECTIVE")=Request.Form("subscr_effective")
rs("PERIOD1")=Request.Form("period1")
rs("PERIOD2")=Request.Form("period2")
rs("PERIOD3AMOUNT1")=Request.Form("period3amount1")
rs("AMOUNT2")=Request.Form("amount2")
rs("AMOUNT3")=Request.Form("amount3")
rs("MC_AMOUNT1")=Request.Form("c_amount1")
rs("MC_AMOUNT2")=Request.Form("c_amount2")
rs("MC_AMOUNT3")=Request.Form("c_amount3")
rs("RECURRING")=Request.Form("recurring")
rs("REATTEMPT")=Request.Form("reattempt")
rs("RETRY_AT")=Request.Form("retry_at")
rs("RECUR_TIMES")=Request.Form("recur_times")
rs("USERNAME")=Request.Form("username")
rs("PASSWORD")=Request.Form("password")
rs("SUBSCR_I")=Request.Form("subscr_id")

rs.Update
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
Response.Clear

----------------------------

Here are a couple of good PayPal Independent Payment Notification programmers' resources:
http://www.eliteweaver.co.uk/testing/ipntest.php 'sometimes gets temperamental, doesn't work -- better to use PayPal Sandbox.
https://developer.paypal.com/