Class Charge

    • Constructor Detail

      • Charge

        public Charge()
    • Method Detail

      • getApplication

        public java.lang.String getApplication()
        Get ID of expandable application object.
      • setApplication

        public void setApplication​(java.lang.String id)
      • getApplicationObject

        public Application getApplicationObject()
        Get expanded application.
      • setApplicationObject

        public void setApplicationObject​(Application expandableObject)
      • getApplicationFee

        public java.lang.String getApplicationFee()
        Get ID of expandable applicationFee object.
      • setApplicationFee

        public void setApplicationFee​(java.lang.String id)
      • getApplicationFeeObject

        public ApplicationFee getApplicationFeeObject()
        Get expanded applicationFee.
      • setApplicationFeeObject

        public void setApplicationFeeObject​(ApplicationFee expandableObject)
      • getBalanceTransaction

        public java.lang.String getBalanceTransaction()
        Get ID of expandable balanceTransaction object.
      • setBalanceTransaction

        public void setBalanceTransaction​(java.lang.String id)
      • getBalanceTransactionObject

        public BalanceTransaction getBalanceTransactionObject()
        Get expanded balanceTransaction.
      • setBalanceTransactionObject

        public void setBalanceTransactionObject​(BalanceTransaction expandableObject)
      • getCustomer

        public java.lang.String getCustomer()
        Get ID of expandable customer object.
      • setCustomer

        public void setCustomer​(java.lang.String id)
      • getCustomerObject

        public Customer getCustomerObject()
        Get expanded customer.
      • setCustomerObject

        public void setCustomerObject​(Customer expandableObject)
      • getDestination

        public java.lang.String getDestination()
        Get ID of expandable destination object.
      • setDestination

        public void setDestination​(java.lang.String id)
      • getDestinationObject

        public Account getDestinationObject()
        Get expanded destination.
      • setDestinationObject

        public void setDestinationObject​(Account expandableObject)
      • getDispute

        public java.lang.String getDispute()
        Get ID of expandable dispute object.
      • setDispute

        public void setDispute​(java.lang.String id)
      • getDisputeObject

        public Dispute getDisputeObject()
        Get expanded dispute.
      • setDisputeObject

        public void setDisputeObject​(Dispute expandableObject)
      • getInvoice

        public java.lang.String getInvoice()
        Get ID of expandable invoice object.
      • setInvoice

        public void setInvoice​(java.lang.String id)
      • getInvoiceObject

        public Invoice getInvoiceObject()
        Get expanded invoice.
      • setInvoiceObject

        public void setInvoiceObject​(Invoice expandableObject)
      • getOnBehalfOf

        public java.lang.String getOnBehalfOf()
        Get ID of expandable onBehalfOf object.
      • setOnBehalfOf

        public void setOnBehalfOf​(java.lang.String id)
      • getOnBehalfOfObject

        public Account getOnBehalfOfObject()
        Get expanded onBehalfOf.
      • setOnBehalfOfObject

        public void setOnBehalfOfObject​(Account expandableObject)
      • getOrder

        public java.lang.String getOrder()
        Get ID of expandable order object.
      • setOrder

        public void setOrder​(java.lang.String id)
      • getOrderObject

        public Order getOrderObject()
        Get expanded order.
      • setOrderObject

        public void setOrderObject​(Order expandableObject)
      • getPaymentIntent

        public java.lang.String getPaymentIntent()
        Get ID of expandable paymentIntent object.
      • setPaymentIntent

        public void setPaymentIntent​(java.lang.String id)
      • getPaymentIntentObject

        public PaymentIntent getPaymentIntentObject()
        Get expanded paymentIntent.
      • setPaymentIntentObject

        public void setPaymentIntentObject​(PaymentIntent expandableObject)
      • getReview

        public java.lang.String getReview()
        Get ID of expandable review object.
      • setReview

        public void setReview​(java.lang.String id)
      • getReviewObject

        public Review getReviewObject()
        Get expanded review.
      • setReviewObject

        public void setReviewObject​(Review expandableObject)
      • getSourceTransfer

        public java.lang.String getSourceTransfer()
        Get ID of expandable sourceTransfer object.
      • setSourceTransfer

        public void setSourceTransfer​(java.lang.String id)
      • getSourceTransferObject

        public Transfer getSourceTransferObject()
        Get expanded sourceTransfer.
      • setSourceTransferObject

        public void setSourceTransferObject​(Transfer expandableObject)
      • getTransfer

        public java.lang.String getTransfer()
        Get ID of expandable transfer object.
      • setTransfer

        public void setTransfer​(java.lang.String id)
      • getTransferObject

        public Transfer getTransferObject()
        Get expanded transfer.
      • setTransferObject

        public void setTransferObject​(Transfer expandableObject)
      • list

        public static ChargeCollection list​(java.util.Map<java.lang.String,​java.lang.Object> params)
                                     throws StripeException
        Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.
        Throws:
        StripeException
      • list

        public static ChargeCollection list​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                            RequestOptions options)
                                     throws StripeException
        Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.
        Throws:
        StripeException
      • create

        public static Charge create​(java.util.Map<java.lang.String,​java.lang.Object> params)
                             throws StripeException
        To charge a credit card or other payment source, you create a Charge object. If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).
        Throws:
        StripeException
      • create

        public static Charge create​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                    RequestOptions options)
                             throws StripeException
        To charge a credit card or other payment source, you create a Charge object. If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).
        Throws:
        StripeException
      • create

        public static Charge create​(ChargeCreateParams params)
                             throws StripeException
        To charge a credit card or other payment source, you create a Charge object. If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).
        Throws:
        StripeException
      • create

        public static Charge create​(ChargeCreateParams params,
                                    RequestOptions options)
                             throws StripeException
        To charge a credit card or other payment source, you create a Charge object. If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).
        Throws:
        StripeException
      • retrieve

        public static Charge retrieve​(java.lang.String charge)
                               throws StripeException
        Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.
        Throws:
        StripeException
      • retrieve

        public static Charge retrieve​(java.lang.String charge,
                                      RequestOptions options)
                               throws StripeException
        Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.
        Throws:
        StripeException
      • retrieve

        public static Charge retrieve​(java.lang.String charge,
                                      java.util.Map<java.lang.String,​java.lang.Object> params,
                                      RequestOptions options)
                               throws StripeException
        Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.
        Throws:
        StripeException
      • retrieve

        public static Charge retrieve​(java.lang.String charge,
                                      ChargeRetrieveParams params,
                                      RequestOptions options)
                               throws StripeException
        Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.
        Throws:
        StripeException
      • update

        public Charge update​(java.util.Map<java.lang.String,​java.lang.Object> params)
                      throws StripeException
        Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
        Specified by:
        update in interface MetadataStore<Charge>
        Throws:
        StripeException
      • capture

        public Charge capture()
                       throws StripeException
        Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.

        Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.

        Throws:
        StripeException
      • capture

        public Charge capture​(RequestOptions options)
                       throws StripeException
        Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.

        Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.

        Throws:
        StripeException
      • capture

        public Charge capture​(java.util.Map<java.lang.String,​java.lang.Object> params)
                       throws StripeException
        Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.

        Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.

        Throws:
        StripeException
      • capture

        public Charge capture​(java.util.Map<java.lang.String,​java.lang.Object> params,
                              RequestOptions options)
                       throws StripeException
        Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.

        Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.

        Throws:
        StripeException
      • capture

        public Charge capture​(ChargeCaptureParams params)
                       throws StripeException
        Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.

        Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.

        Throws:
        StripeException
      • capture

        public Charge capture​(ChargeCaptureParams params,
                              RequestOptions options)
                       throws StripeException
        Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.

        Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.

        Throws:
        StripeException
      • getAmount

        public java.lang.Long getAmount()
        Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
      • getAmountCaptured

        public java.lang.Long getAmountCaptured()
        Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made).
      • getAmountRefunded

        public java.lang.Long getAmountRefunded()
        Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued).
      • getApplicationFeeAmount

        public java.lang.Long getApplicationFeeAmount()
        The amount of the application fee (if any) requested for the charge. See the Connect documentation for details.
      • getAuthorizationCode

        public java.lang.String getAuthorizationCode()
        Authorization code on the charge.
      • getCalculatedStatementDescriptor

        public java.lang.String getCalculatedStatementDescriptor()
        The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined.
      • getCaptured

        public java.lang.Boolean getCaptured()
        If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured.
      • getCreated

        public java.lang.Long getCreated()
        Time at which the object was created. Measured in seconds since the Unix epoch.
      • getDescription

        public java.lang.String getDescription()
        An arbitrary string attached to the object. Often useful for displaying to users.
      • getDisputed

        public java.lang.Boolean getDisputed()
        Whether the charge has been disputed.
      • getFailureCode

        public java.lang.String getFailureCode()
        Error code explaining reason for charge failure if available (see the errors section for a list of codes).
      • getFailureMessage

        public java.lang.String getFailureMessage()
        Message to user further explaining reason for charge failure if available.
      • getFraudDetails

        public Charge.FraudDetails getFraudDetails()
        Information on fraud assessments for the charge.
      • getLivemode

        public java.lang.Boolean getLivemode()
        Has the value true if the object exists in live mode or the value false if the object exists in test mode.
      • getObject

        public java.lang.String getObject()
        String representing the object's type. Objects of the same type share the same value.

        Equal to charge.

      • getPaid

        public java.lang.Boolean getPaid()
        true if the charge succeeded, or was successfully authorized for later capture.
      • getPaymentMethod

        public java.lang.String getPaymentMethod()
        ID of the payment method used in this charge.
      • getPaymentMethodDetails

        public Charge.PaymentMethodDetails getPaymentMethodDetails()
        Details about the payment method at the time of the transaction.
      • getReceiptEmail

        public java.lang.String getReceiptEmail()
        This is the email address that the receipt for this charge was sent to.
      • getReceiptNumber

        public java.lang.String getReceiptNumber()
        This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent.
      • getReceiptUrl

        public java.lang.String getReceiptUrl()
        This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt.
      • getRefunded

        public java.lang.Boolean getRefunded()
        Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.
      • getRefunds

        public RefundCollection getRefunds()
        A list of refunds that have been applied to the charge.
      • getShipping

        public ShippingDetails getShipping()
        Shipping information for the charge.
      • getSource

        public PaymentSource getSource()
        This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method or payment_method_details instead.
      • getStatementDescriptor

        public java.lang.String getStatementDescriptor()
        For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.
      • getStatementDescriptorSuffix

        public java.lang.String getStatementDescriptorSuffix()
        Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
      • getStatus

        public java.lang.String getStatus()
        The status of the payment is either succeeded, pending, or failed.
      • getTransferGroup

        public java.lang.String getTransferGroup()
        A string that identifies this transaction as part of a group. See the Connect documentation for details.
      • setAmount

        public void setAmount​(java.lang.Long amount)
        Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
      • setAmountCaptured

        public void setAmountCaptured​(java.lang.Long amountCaptured)
        Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made).
      • setAmountRefunded

        public void setAmountRefunded​(java.lang.Long amountRefunded)
        Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued).
      • setApplicationFeeAmount

        public void setApplicationFeeAmount​(java.lang.Long applicationFeeAmount)
        The amount of the application fee (if any) requested for the charge. See the Connect documentation for details.
      • setAuthorizationCode

        public void setAuthorizationCode​(java.lang.String authorizationCode)
        Authorization code on the charge.
      • setCalculatedStatementDescriptor

        public void setCalculatedStatementDescriptor​(java.lang.String calculatedStatementDescriptor)
        The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined.
      • setCaptured

        public void setCaptured​(java.lang.Boolean captured)
        If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured.
      • setCreated

        public void setCreated​(java.lang.Long created)
        Time at which the object was created. Measured in seconds since the Unix epoch.
      • setDescription

        public void setDescription​(java.lang.String description)
        An arbitrary string attached to the object. Often useful for displaying to users.
      • setDisputed

        public void setDisputed​(java.lang.Boolean disputed)
        Whether the charge has been disputed.
      • setFailureCode

        public void setFailureCode​(java.lang.String failureCode)
        Error code explaining reason for charge failure if available (see the errors section for a list of codes).
      • setFailureMessage

        public void setFailureMessage​(java.lang.String failureMessage)
        Message to user further explaining reason for charge failure if available.
      • setFraudDetails

        public void setFraudDetails​(Charge.FraudDetails fraudDetails)
        Information on fraud assessments for the charge.
      • setId

        public void setId​(java.lang.String id)
        Unique identifier for the object.
      • setLivemode

        public void setLivemode​(java.lang.Boolean livemode)
        Has the value true if the object exists in live mode or the value false if the object exists in test mode.
      • setMetadata

        public void setMetadata​(java.util.Map<java.lang.String,​java.lang.String> metadata)
        Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
      • setObject

        public void setObject​(java.lang.String object)
        String representing the object's type. Objects of the same type share the same value.

        Equal to charge.

      • setPaid

        public void setPaid​(java.lang.Boolean paid)
        true if the charge succeeded, or was successfully authorized for later capture.
      • setPaymentMethod

        public void setPaymentMethod​(java.lang.String paymentMethod)
        ID of the payment method used in this charge.
      • setPaymentMethodDetails

        public void setPaymentMethodDetails​(Charge.PaymentMethodDetails paymentMethodDetails)
        Details about the payment method at the time of the transaction.
      • setReceiptEmail

        public void setReceiptEmail​(java.lang.String receiptEmail)
        This is the email address that the receipt for this charge was sent to.
      • setReceiptNumber

        public void setReceiptNumber​(java.lang.String receiptNumber)
        This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent.
      • setReceiptUrl

        public void setReceiptUrl​(java.lang.String receiptUrl)
        This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt.
      • setRefunded

        public void setRefunded​(java.lang.Boolean refunded)
        Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.
      • setRefunds

        public void setRefunds​(RefundCollection refunds)
        A list of refunds that have been applied to the charge.
      • setShipping

        public void setShipping​(ShippingDetails shipping)
        Shipping information for the charge.
      • setSource

        public void setSource​(PaymentSource source)
        This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method or payment_method_details instead.
      • setStatementDescriptor

        public void setStatementDescriptor​(java.lang.String statementDescriptor)
        For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.
      • setStatementDescriptorSuffix

        public void setStatementDescriptorSuffix​(java.lang.String statementDescriptorSuffix)
        Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
      • setStatus

        public void setStatus​(java.lang.String status)
        The status of the payment is either succeeded, pending, or failed.
      • setTransferGroup

        public void setTransferGroup​(java.lang.String transferGroup)
        A string that identifies this transaction as part of a group. See the Connect documentation for details.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getId

        public java.lang.String getId()
        Unique identifier for the object.
        Specified by:
        getId in interface HasId
      • getMetadata

        public java.util.Map<java.lang.String,​java.lang.String> getMetadata()
        Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
        Specified by:
        getMetadata in interface MetadataStore<Charge>