Jump to content


Photo

Acces PayPal with Java Applet


  • This topic is locked This topic is locked
1 reply to this topic

#1 golem

golem

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 01 October 2003 - 06:45 AM

How I can pass parameters (business, item_name, return) to PayPal in a applet Java ?
Please see example below.
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
public class GOTOURL extends Applet implements
ActionListener {
Button b;
String paypal;
String s1 = "cmd=_cart" ;
String s2 = "&business=golem@ifrance.com";
String s3 = "&item_name=Donation to Golem";
String s4 = "&return=www.ifrance.com/golem/thanks.htm" ;

public void init() {
b = new Button("Go to PAYPAL URL");
add(B);
b.addActionListener(this);
}
public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == B) {
try {
paypal = "http://www.paypal.com/cgi-bin/webscr?" + s1 + s2 + s3 + s4 ;
getAppletContext().showDocument(new URL(paypal));
}
catch (Exception e) {
e.printStackTrace();
}
}
}
} // end


#2 PayPalStephen

PayPalStephen

    Advanced Member

  • Members
  • 2,138 posts

Posted 10 October 2003 - 12:21 PM

if these are static values for the variables, you can just add it to the url for your action variable posting to PayPal.

https:// www.paypal.com/ cgi-bin/webscr?cmd=_xclick&business=email@address.com&item_name=donation+to+golem&return=www.ifrance.com/golem/thanks.htm

Stephen Ivaskevicius
PayPal/eBay, Inc.
www.paypal.com/pdn




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users