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 Details

    • AgreementToken

      public AgreementToken()
    • AgreementToken

      public AgreementToken(String tokenId)
    • 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 - APIContext used 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 - APIContext used for the API call.
      tokenId - payment tokenId (e.g., BA-8A802366G0648845Y)
      Returns:
      AgreementToken
      Throws:
      com.paypal.base.rest.PayPalRESTException
    • getId

      public String getId()
    • setId

      public AgreementToken setId(String id)
    • getDescription

      public String getDescription()
    • setDescription

      public AgreementToken setDescription(String description)
    • getPayer

      public com.paypal.api.payments.Payer getPayer()
    • setPayer

      public AgreementToken setPayer(com.paypal.api.payments.Payer payer)
    • getPlan

      public com.paypal.api.payments.Plan getPlan()
    • setPlan

      public AgreementToken setPlan(com.paypal.api.payments.Plan plan)
    • getShippingAddress

      public com.paypal.api.payments.Address getShippingAddress()
    • setShippingAddress

      public AgreementToken setShippingAddress(com.paypal.api.payments.Address shippingAddress)
    • getTokenId

      public String getTokenId()
    • setTokenId

      public AgreementToken setTokenId(String tokenId)
    • getLinks

      public List<com.paypal.api.payments.Links> getLinks()
    • setLinks

      public AgreementToken setLinks(List<com.paypal.api.payments.Links> links)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class com.paypal.base.rest.PayPalModel
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class com.paypal.base.rest.PayPalModel
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class com.paypal.base.rest.PayPalModel