Class AgreementToken
java.lang.Object
com.paypal.base.rest.PayPalModel
com.paypal.base.rest.PayPalResource
org.broadleafcommerce.vendor.paypal.api.AgreementToken
public class AgreementToken
extends com.paypal.base.rest.PayPalResource
The PayPal REST SDK does not currently contain support for
Reference Transactions and Merchant Initiated Billing Agreements
This was created to support the need to call the Billing Agreement Token endpoints
See: https://developer.paypal.com/docs/limited-release/reference-transactions/#overview
-
Constructor Summary
ConstructorsConstructorDescriptionAgreementToken(String tokenId) AgreementToken(String description, com.paypal.api.payments.Payer payer, com.paypal.api.payments.Plan plan) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancreate(com.paypal.base.rest.APIContext apiContext) Create a new billing agreement token by passing the details for the agreement, including the description, payer, and billing plan in the request JSON.booleanstatic AgreementTokenexecute(AgreementToken agreementToken, com.paypal.base.rest.APIContext apiContext) Execute a billing agreement after buyer approval by passing the payment token to the request URI.getId()List<com.paypal.api.payments.Links>getLinks()com.paypal.api.payments.PayergetPayer()com.paypal.api.payments.PlangetPlan()com.paypal.api.payments.AddressinthashCode()setDescription(String description) setPayer(com.paypal.api.payments.Payer payer) setPlan(com.paypal.api.payments.Plan plan) setShippingAddress(com.paypal.api.payments.Address shippingAddress) setTokenId(String tokenId) Methods inherited from class com.paypal.base.rest.PayPalResource
configureAndExecute, configureAndExecute, configureAndExecute, configureAndExecute, createAPICallPreHandler, getClientCredential, getClientID, getClientSecret, getConfigurations, getCredential, getLastRequest, getLastResponse, getOAuthTokenCredential, initConfig, initConfig, initConfig, initializeToDefaultMethods inherited from class com.paypal.base.rest.PayPalModel
toJSON, toString
-
Constructor Details
-
AgreementToken
public AgreementToken() -
AgreementToken
-
AgreementToken
public AgreementToken(String description, com.paypal.api.payments.Payer payer, com.paypal.api.payments.Plan plan)
-
-
Method Details
-
create
public AgreementToken create(com.paypal.base.rest.APIContext apiContext) throws com.paypal.base.rest.PayPalRESTException Create a new billing agreement token by passing the details for the agreement, including the description, payer, and billing plan in the request JSON.- Parameters:
apiContext-APIContextused for the API call.- Returns:
- AgreementToken
- Throws:
com.paypal.base.rest.PayPalRESTException
-
execute
public static AgreementToken execute(AgreementToken agreementToken, com.paypal.base.rest.APIContext apiContext) throws com.paypal.base.rest.PayPalRESTException Execute a billing agreement after buyer approval by passing the payment token to the request URI.- Parameters:
apiContext-APIContextused for the API call.tokenId- payment tokenId (e.g., BA-8A802366G0648845Y)- Returns:
- AgreementToken
- Throws:
com.paypal.base.rest.PayPalRESTException
-
getId
-
setId
-
getDescription
-
setDescription
-
getPayer
public com.paypal.api.payments.Payer getPayer() -
setPayer
-
getPlan
public com.paypal.api.payments.Plan getPlan() -
setPlan
-
getShippingAddress
public com.paypal.api.payments.Address getShippingAddress() -
setShippingAddress
-
getTokenId
-
setTokenId
-
getLinks
-
setLinks
-
equals
- Overrides:
equalsin classcom.paypal.base.rest.PayPalModel
-
canEqual
- Overrides:
canEqualin classcom.paypal.base.rest.PayPalModel
-
hashCode
public int hashCode()- Overrides:
hashCodein classcom.paypal.base.rest.PayPalModel
-