paypalnvp.core
Class PayPal

java.lang.Object
  extended by paypalnvp.core.PayPal
All Implemented Interfaces:
java.io.Serializable

public final class PayPal
extends java.lang.Object
implements java.io.Serializable

Instance of this class is used for sending requests and returning responses from paypal.

See Also:
Serialized Form

Nested Class Summary
static class PayPal.Environment
          paypal environment - live, sandbox or beta sandbox
 
Constructor Summary
PayPal(Profile profile, PayPal.Environment environment)
          Returns new instance of PayPal for use with api signatures.
PayPal(Profile profile, PayPal.Environment environment, boolean apiSignature)
          Returns new instance of PayPal.
 
Method Summary
 java.lang.String getRedirectUrl(Request request)
          Returns paypal url, where profile should be redirected.
 void setResponse(Request request)
          Sets response from PayPal.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PayPal

public PayPal(Profile profile,
              PayPal.Environment environment)
Returns new instance of PayPal for use with api signatures.

Parameters:
profile -
environment -

PayPal

public PayPal(Profile profile,
              PayPal.Environment environment,
              boolean apiSignature)
Returns new instance of PayPal.

Parameters:
profile -
environment -
apiSignature - - specify if you want to use server for api signature, or api certificate
Method Detail

setResponse

public void setResponse(Request request)
Sets response from PayPal. Calls setNVPResponse on supplied request argument and sets response Map from PayPal.

Parameters:
request -

getRedirectUrl

public java.lang.String getRedirectUrl(Request request)
Returns paypal url, where profile should be redirected. If Request has not been sent, or response has not been successfull, null is returned.

Returns:
- url where to redirect profile

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object