CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Paypal stuff...

Print topic Send  topic

Author Message
Simon
Posted: 02/11/2003, 3:11 PM

I have come across a few articles, which can be found on www.superfreaker.com, they have some codes with them, for using the IPN system for things like affilliate schemes, downloadable products etc., I am just woundering if anyone knows about using these in CCS (with ASP), I'm not too sure about using custom codes etc.

Any help would be great, and I'll give any source code I create to the CCS community.

Thanks
Simon
Ken
Posted: 02/11/2003, 5:46 PM

I used an external PHP file to link to PayPal. All I did was pass my form values to a PHP file that had the PayPal code imbeded in it. From there I link directly to PayPal. There is a sample on here somewhere on how to do it, but I was unable to get it to work.
simon
Posted: 02/12/2003, 5:39 AM

Thanks, thats what I do for emails, but I thought I'd be able to do it easier from within CCS, do you pass the parameters in a URL, eg item_name, item_ID, item_price etc?

Simon
Ken
Posted: 02/12/2003, 7:35 PM

Well I use CCS for Emails. Now that I could help you with! LOL! With PayPal however, I just query the database for everything I need and all I do is pass the UserID as a session variable, so I know which record I need to access.
RonB
Posted: 02/13/2003, 12:14 AM

I have buy buttons that function as links to paypal and that will send the variables that are placed in {} in the onclick code beneath:

onclick="window.open('https://www.paypal.com/cart/add=1&business=youraccount&item_name={item_name};item_number={order_id}&amount={price}&image_url='';return=http%3A//www.yoursite.com/succes.php&cancel_return=http%3A//www.yoursite.com/cancel.php','cartwin','width=600,height=400,scrollbars,location,resizable,status');"

I didn't like the per item shoppingcart so I now keep the order in my database and make 1 stop at paypal to have the customer pay for the entire order in one go. I use a timestamp as order_id wich is stored as a sessionvariable. Cancel.php retrieves the sessionvariable and deletes the order. succes.php sets the order to status "payed"

Ron
Simon
Posted: 02/13/2003, 2:13 AM

Thanks for all your help, I'll try to work something out like this, probably using an external script.

I would be interested in using my own shopping cart system, but the paypal one just seemed so easy it was a bit tempting! I'm not sure how I would go about linking all the products to the same order number, if you see what I mean, so they can be checked.

I have asked this question in another post I think but.... I have used the paypal example article and get this error;

Microsoft VBScript runtime error '800a01f4'

Variable is undefined: 'flditem_name'

/test/ecommerce/item_view_events.asp, line 22


How do I actually go about defining these variables and where exactly? Please bear in mind that I am pretty new to ASP as well as CCS! I realise that you people seem to be using PHP but isn't it pretty similar?

As for sending emails, I've sussed that out now, thats easy!!!

Cheers
Simon
kurtmel
Posted: 02/13/2003, 7:28 PM

RonB
would you mind giving a little more info on your implementation in PHP using paypal, maybe even write and article??

Would certainly be helpful
RonB
Posted: 02/15/2003, 3:04 PM

well..,

What would you like to know. It's all pretty basic.
The shoppingcart is basically just a table in the database. It holds the order_id(I use a timestamp and set it as a session variable)
product_id (the id refers to the product number in the product table)
Since my client uses external software for accounting I do not have to worry about price changes so I do not even set price in the order table. I get the price by joining to the product table)

so the order table might look something like this:

oder_id product id
20020216001000 12
20020216001000 14


The shopping cart is a grid that shows the order table with entries that have the session variable order_id. I've made order a hiddenfield so you don't sdee it ten times when a client has bought ten items. The link to paypal is now only one item: the order_id and the total of the order. The name of the product, the price etc is produced by joining the order table to the product table based on the product id.
Item_name: In the paypall line I use the name of the buisiness as item_name(this makes shure the name of the buisiness is on the screen when payment is being processed and it will show up on the credit card transaction slip for the client)

Item_number: in this section of the paypall line I set the order_id (again making sure the order_id is on the receipt)

Amount: in the amount part I set the total of the order.

That's basicaly it.
There's some more coding for handling the availability of products but thats a different story. The paypall stuf is relatively easy to do.

This aproach has one possible drawback. I choose to do it this way because my client didn't want customers to register their personal info twice. Once on her site and once when paying thrue paypall. The database has no customer info other then the order_id. All the info about the customer belonging to an order_id is in the paypall account. I did however design a succes page that gives customers the chance to fill in their email so they will be notified when their order is beeing shipped. I added an email field to the order table for this.

Ron

Ron

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.