com.paypal.api.payments
Class Invoice

java.lang.Object
  extended by com.paypal.api.payments.Invoice

public class Invoice
extends Object


Constructor Summary
Invoice()
          Default Constructor
Invoice(MerchantInfo merchantInfo)
          Parameterized Constructor
 
Method Summary
 void cancel(APIContext apiContext, CancelNotification cancelNotification)
          Cancels an invoice.
 void cancel(String accessToken, CancelNotification cancelNotification)
          Cancels an invoice.
 Invoice create(APIContext apiContext)
          Creates a new invoice Resource.
 Invoice create(String accessToken)
          Creates a new invoice Resource.
 void delete(APIContext apiContext)
          Delete invoice resource for the given identifier.
 void delete(String accessToken)
          Delete invoice resource for the given identifier.
static Invoice get(APIContext apiContext, String invoiceId)
          Get the invoice resource for the given identifier.
static Invoice get(String accessToken, String invoiceId)
          Get the invoice resource for the given identifier.
static Invoices getAll(APIContext apiContext)
          Get all invoices of a merchant.
static Invoices getAll(String accessToken)
          Get all invoices of a merchant.
 List<BillingInfo> getBillingInfo()
          Getter for billingInfo
 CustomAmount getCustom()
          Getter for custom
 Cost getDiscount()
          Getter for discount
 String getId()
          Getter for id
 String getInvoiceDate()
          Getter for invoiceDate
 List<InvoiceItem> getItems()
          Getter for items
static String getLastRequest()
          Returns the last request sent to the Service
static String getLastResponse()
          Returns the last response returned by the Service
 String getLogoUrl()
          Getter for logoUrl
 MerchantInfo getMerchantInfo()
          Getter for merchantInfo
 String getMerchantMemo()
          Getter for merchantMemo
 Metadata getMetadata()
          Getter for metadata
 String getNote()
          Getter for note
 String getNumber()
          Getter for number
 List<PaymentDetail> getPaymentDetails()
          Getter for paymentDetails
 PaymentTerm getPaymentTerm()
          Getter for paymentTerm
 List<RefundDetail> getRefundDetails()
          Getter for refundDetails
 ShippingCost getShippingCost()
          Getter for shippingCost
 ShippingInfo getShippingInfo()
          Getter for shippingInfo
 String getStatus()
          Getter for status
 Boolean getTaxCalculatedAfterDiscount()
          Getter for taxCalculatedAfterDiscount
 Boolean getTaxInclusive()
          Getter for taxInclusive
 String getTerms()
          Getter for terms
 Currency getTotalAmount()
          Getter for totalAmount
 String getUri()
          Getter for uri
static OAuthTokenCredential initConfig(File file)
          Initialize using a File(Properties file)
static OAuthTokenCredential initConfig(InputStream is)
          Initialize using InputStream(of a Properties file)
static OAuthTokenCredential initConfig(Properties properties)
          Initialize using Properties
 void recordPayment(APIContext apiContext, PaymentDetail paymentDetail)
          Mark the status of the invoice as paid.
 void recordPayment(String accessToken, PaymentDetail paymentDetail)
          Mark the status of the invoice as paid.
 void recordRefund(APIContext apiContext, RefundDetail refundDetail)
          Mark the status of the invoice as refunded.
 void recordRefund(String accessToken, RefundDetail refundDetail)
          Mark the status of the invoice as refunded.
 void remind(APIContext apiContext, Notification notification)
          Reminds the payer to pay the invoice.
 void remind(String accessToken, Notification notification)
          Reminds the payer to pay the invoice.
 Invoices search(APIContext apiContext, Search search)
          Search for invoice resources.
 Invoices search(String accessToken, Search search)
          Search for invoice resources.
 void send(APIContext apiContext)
          Sends a legitimate invoice to the payer.
 void send(String accessToken)
          Sends a legitimate invoice to the payer.
 Invoice setBillingInfo(List<BillingInfo> billingInfo)
          Setter for billingInfo
 Invoice setCustom(CustomAmount custom)
          Setter for custom
 Invoice setDiscount(Cost discount)
          Setter for discount
 Invoice setId(String id)
          Setter for id
 Invoice setInvoiceDate(String invoiceDate)
          Setter for invoiceDate
 Invoice setItems(List<InvoiceItem> items)
          Setter for items
 Invoice setLogoUrl(String logoUrl)
          Setter for logoUrl
 Invoice setMerchantInfo(MerchantInfo merchantInfo)
          Setter for merchantInfo
 Invoice setMerchantMemo(String merchantMemo)
          Setter for merchantMemo
 Invoice setMetadata(Metadata metadata)
          Setter for metadata
 Invoice setNote(String note)
          Setter for note
 Invoice setNumber(String number)
          Setter for number
 Invoice setPaymentDetails(List<PaymentDetail> paymentDetails)
          Setter for paymentDetails
 Invoice setPaymentTerm(PaymentTerm paymentTerm)
          Setter for paymentTerm
 Invoice setRefundDetails(List<RefundDetail> refundDetails)
          Setter for refundDetails
 Invoice setShippingCost(ShippingCost shippingCost)
          Setter for shippingCost
 Invoice setShippingInfo(ShippingInfo shippingInfo)
          Setter for shippingInfo
 Invoice setStatus(String status)
          Setter for status
 Invoice setTaxCalculatedAfterDiscount(Boolean taxCalculatedAfterDiscount)
          Setter for taxCalculatedAfterDiscount
 Invoice setTaxInclusive(Boolean taxInclusive)
          Setter for taxInclusive
 Invoice setTerms(String terms)
          Setter for terms
 Invoice setTotalAmount(Currency totalAmount)
          Setter for totalAmount
 Invoice setUri(String uri)
          Setter for uri
 String toJSON()
          Returns a JSON string corresponding to object state
 String toString()
           
 Invoice update(APIContext apiContext)
          Full update of the invoice resource for the given identifier.
 Invoice update(String accessToken)
          Full update of the invoice resource for the given identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Invoice

public Invoice()
Default Constructor


Invoice

public Invoice(MerchantInfo merchantInfo)
Parameterized Constructor

Method Detail

getLastRequest

public static String getLastRequest()
Returns the last request sent to the Service

Returns:
Last request sent to the server

getLastResponse

public static String getLastResponse()
Returns the last response returned by the Service

Returns:
Last response got from the Service

initConfig

public static OAuthTokenCredential initConfig(InputStream is)
                                       throws PayPalRESTException
Initialize using InputStream(of a Properties file)

Parameters:
is - InputStream
Returns:
OAuthTokenCredential instance using client ID and client secret loaded from configuration.
Throws:
PayPalRESTException

initConfig

public static OAuthTokenCredential initConfig(File file)
                                       throws PayPalRESTException
Initialize using a File(Properties file)

Parameters:
file - File object of a properties entity
Returns:
OAuthTokenCredential instance using client ID and client secret loaded from configuration.
Throws:
PayPalRESTException

initConfig

public static OAuthTokenCredential initConfig(Properties properties)
Initialize using Properties

Parameters:
properties - Properties object
Returns:
OAuthTokenCredential instance using client ID and client secret loaded from configuration.

setId

public Invoice setId(String id)
Setter for id


getId

public String getId()
Getter for id


setNumber

public Invoice setNumber(String number)
Setter for number


getNumber

public String getNumber()
Getter for number


setUri

public Invoice setUri(String uri)
Setter for uri


getUri

public String getUri()
Getter for uri


setStatus

public Invoice setStatus(String status)
Setter for status


getStatus

public String getStatus()
Getter for status


setMerchantInfo

public Invoice setMerchantInfo(MerchantInfo merchantInfo)
Setter for merchantInfo


getMerchantInfo

public MerchantInfo getMerchantInfo()
Getter for merchantInfo


setBillingInfo

public Invoice setBillingInfo(List<BillingInfo> billingInfo)
Setter for billingInfo


getBillingInfo

public List<BillingInfo> getBillingInfo()
Getter for billingInfo


setShippingInfo

public Invoice setShippingInfo(ShippingInfo shippingInfo)
Setter for shippingInfo


getShippingInfo

public ShippingInfo getShippingInfo()
Getter for shippingInfo


setItems

public Invoice setItems(List<InvoiceItem> items)
Setter for items


getItems

public List<InvoiceItem> getItems()
Getter for items


setInvoiceDate

public Invoice setInvoiceDate(String invoiceDate)
Setter for invoiceDate


getInvoiceDate

public String getInvoiceDate()
Getter for invoiceDate


setPaymentTerm

public Invoice setPaymentTerm(PaymentTerm paymentTerm)
Setter for paymentTerm


getPaymentTerm

public PaymentTerm getPaymentTerm()
Getter for paymentTerm


setDiscount

public Invoice setDiscount(Cost discount)
Setter for discount


getDiscount

public Cost getDiscount()
Getter for discount


setShippingCost

public Invoice setShippingCost(ShippingCost shippingCost)
Setter for shippingCost


getShippingCost

public ShippingCost getShippingCost()
Getter for shippingCost


setCustom

public Invoice setCustom(CustomAmount custom)
Setter for custom


getCustom

public CustomAmount getCustom()
Getter for custom


setTaxCalculatedAfterDiscount

public Invoice setTaxCalculatedAfterDiscount(Boolean taxCalculatedAfterDiscount)
Setter for taxCalculatedAfterDiscount


getTaxCalculatedAfterDiscount

public Boolean getTaxCalculatedAfterDiscount()
Getter for taxCalculatedAfterDiscount


setTaxInclusive

public Invoice setTaxInclusive(Boolean taxInclusive)
Setter for taxInclusive


getTaxInclusive

public Boolean getTaxInclusive()
Getter for taxInclusive


setTerms

public Invoice setTerms(String terms)
Setter for terms


getTerms

public String getTerms()
Getter for terms


setNote

public Invoice setNote(String note)
Setter for note


getNote

public String getNote()
Getter for note


setMerchantMemo

public Invoice setMerchantMemo(String merchantMemo)
Setter for merchantMemo


getMerchantMemo

public String getMerchantMemo()
Getter for merchantMemo


setLogoUrl

public Invoice setLogoUrl(String logoUrl)
Setter for logoUrl


getLogoUrl

public String getLogoUrl()
Getter for logoUrl


setTotalAmount

public Invoice setTotalAmount(Currency totalAmount)
Setter for totalAmount


getTotalAmount

public Currency getTotalAmount()
Getter for totalAmount


setPaymentDetails

public Invoice setPaymentDetails(List<PaymentDetail> paymentDetails)
Setter for paymentDetails


getPaymentDetails

public List<PaymentDetail> getPaymentDetails()
Getter for paymentDetails


setRefundDetails

public Invoice setRefundDetails(List<RefundDetail> refundDetails)
Setter for refundDetails


getRefundDetails

public List<RefundDetail> getRefundDetails()
Getter for refundDetails


setMetadata

public Invoice setMetadata(Metadata metadata)
Setter for metadata


getMetadata

public Metadata getMetadata()
Getter for metadata


create

public Invoice create(String accessToken)
               throws PayPalRESTException
Creates a new invoice Resource.

Parameters:
accessToken - Access Token used for the API call.
Returns:
Invoice
Throws:
PayPalRESTException

create

public Invoice create(APIContext apiContext)
               throws PayPalRESTException
Creates a new invoice Resource.

Parameters:
apiContext - APIContext used for the API call.
Returns:
Invoice
Throws:
PayPalRESTException

search

public Invoices search(String accessToken,
                       Search search)
                throws PayPalRESTException
Search for invoice resources.

Parameters:
accessToken - Access Token used for the API call.
search - Search
Returns:
Invoices
Throws:
PayPalRESTException

search

public Invoices search(APIContext apiContext,
                       Search search)
                throws PayPalRESTException
Search for invoice resources.

Parameters:
apiContext - APIContext used for the API call.
search - Search
Returns:
Invoices
Throws:
PayPalRESTException

send

public void send(String accessToken)
          throws PayPalRESTException
Sends a legitimate invoice to the payer.

Parameters:
accessToken - Access Token used for the API call.
Throws:
PayPalRESTException

send

public void send(APIContext apiContext)
          throws PayPalRESTException
Sends a legitimate invoice to the payer.

Parameters:
apiContext - APIContext used for the API call.
Throws:
PayPalRESTException

remind

public void remind(String accessToken,
                   Notification notification)
            throws PayPalRESTException
Reminds the payer to pay the invoice.

Parameters:
accessToken - Access Token used for the API call.
notification - Notification
Throws:
PayPalRESTException

remind

public void remind(APIContext apiContext,
                   Notification notification)
            throws PayPalRESTException
Reminds the payer to pay the invoice.

Parameters:
apiContext - APIContext used for the API call.
notification - Notification
Throws:
PayPalRESTException

cancel

public void cancel(String accessToken,
                   CancelNotification cancelNotification)
            throws PayPalRESTException
Cancels an invoice.

Parameters:
accessToken - Access Token used for the API call.
cancelNotification - CancelNotification
Throws:
PayPalRESTException

cancel

public void cancel(APIContext apiContext,
                   CancelNotification cancelNotification)
            throws PayPalRESTException
Cancels an invoice.

Parameters:
apiContext - APIContext used for the API call.
cancelNotification - CancelNotification
Throws:
PayPalRESTException

recordPayment

public void recordPayment(String accessToken,
                          PaymentDetail paymentDetail)
                   throws PayPalRESTException
Mark the status of the invoice as paid.

Parameters:
accessToken - Access Token used for the API call.
paymentDetail - PaymentDetail
Throws:
PayPalRESTException

recordPayment

public void recordPayment(APIContext apiContext,
                          PaymentDetail paymentDetail)
                   throws PayPalRESTException
Mark the status of the invoice as paid.

Parameters:
apiContext - APIContext used for the API call.
paymentDetail - PaymentDetail
Throws:
PayPalRESTException

recordRefund

public void recordRefund(String accessToken,
                         RefundDetail refundDetail)
                  throws PayPalRESTException
Mark the status of the invoice as refunded.

Parameters:
accessToken - Access Token used for the API call.
refundDetail - RefundDetail
Throws:
PayPalRESTException

recordRefund

public void recordRefund(APIContext apiContext,
                         RefundDetail refundDetail)
                  throws PayPalRESTException
Mark the status of the invoice as refunded.

Parameters:
apiContext - APIContext used for the API call.
refundDetail - RefundDetail
Throws:
PayPalRESTException

get

public static Invoice get(String accessToken,
                          String invoiceId)
                   throws PayPalRESTException
Get the invoice resource for the given identifier.

Parameters:
accessToken - Access Token used for the API call.
invoiceId - String
Returns:
Invoice
Throws:
PayPalRESTException

get

public static Invoice get(APIContext apiContext,
                          String invoiceId)
                   throws PayPalRESTException
Get the invoice resource for the given identifier.

Parameters:
apiContext - APIContext used for the API call.
invoiceId - String
Returns:
Invoice
Throws:
PayPalRESTException

getAll

public static Invoices getAll(String accessToken)
                       throws PayPalRESTException
Get all invoices of a merchant.

Parameters:
accessToken - Access Token used for the API call.
Returns:
Invoices
Throws:
PayPalRESTException

getAll

public static Invoices getAll(APIContext apiContext)
                       throws PayPalRESTException
Get all invoices of a merchant.

Parameters:
apiContext - APIContext used for the API call.
Returns:
Invoices
Throws:
PayPalRESTException

update

public Invoice update(String accessToken)
               throws PayPalRESTException
Full update of the invoice resource for the given identifier.

Parameters:
accessToken - Access Token used for the API call.
Returns:
Invoice
Throws:
PayPalRESTException

update

public Invoice update(APIContext apiContext)
               throws PayPalRESTException
Full update of the invoice resource for the given identifier.

Parameters:
apiContext - APIContext used for the API call.
Returns:
Invoice
Throws:
PayPalRESTException

delete

public void delete(String accessToken)
            throws PayPalRESTException
Delete invoice resource for the given identifier.

Parameters:
accessToken - Access Token used for the API call.
Throws:
PayPalRESTException

delete

public void delete(APIContext apiContext)
            throws PayPalRESTException
Delete invoice resource for the given identifier.

Parameters:
apiContext - APIContext used for the API call.
Throws:
PayPalRESTException

toJSON

public String toJSON()
Returns a JSON string corresponding to object state

Returns:
JSON representation

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015. All Rights Reserved.