Class: Stripe::PaymentRecord
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::PaymentRecord
- Defined in:
- lib/stripe/resources/payment_record.rb
Overview
A Payment Record is a resource that allows you to represent payments that occur on- or off-Stripe. For example, you can create a Payment Record to model a payment made on a different payment processor, in order to mark an Invoice as paid and a Subscription as active. Payment Records consist of one or more Payment Attempt Records, which represent individual attempts made on a payment network.
Defined Under Namespace
Classes: AmountCanceled, AmountFailed, AmountGuaranteed, AmountRequested, CustomerDetails, PaymentMethodDetails, ReportPaymentAttemptCanceledParams, ReportPaymentAttemptFailedParams, ReportPaymentAttemptGuaranteedParams, ReportPaymentAttemptParams, ReportPaymentParams, RetrieveParams, ShippingDetails
Constant Summary collapse
- OBJECT_NAME =
"payment_record"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#amount_canceled ⇒ Object
readonly
A representation of an amount of money, consisting of an amount and a currency.
-
#amount_failed ⇒ Object
readonly
A representation of an amount of money, consisting of an amount and a currency.
-
#amount_guaranteed ⇒ Object
readonly
A representation of an amount of money, consisting of an amount and a currency.
-
#amount_requested ⇒ Object
readonly
A representation of an amount of money, consisting of an amount and a currency.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#customer_details ⇒ Object
readonly
Customer information for this payment.
-
#customer_presence ⇒ Object
readonly
Indicates whether the customer was present in your checkout flow during this payment.
-
#description ⇒ Object
readonly
An arbitrary string attached to the object.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#latest_payment_attempt_record ⇒ Object
readonly
ID of the latest Payment Attempt Record attached to this Payment Record.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#payment_method_details ⇒ Object
readonly
Information about the Payment Method debited for this payment.
-
#payment_reference ⇒ Object
readonly
An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID.
-
#shipping_details ⇒ Object
readonly
Shipping information for this payment.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
- .object_name ⇒ Object
-
.report_payment(params = {}, opts = {}) ⇒ Object
Report a new Payment Record.
-
.report_payment_attempt(id, params = {}, opts = {}) ⇒ Object
Report a new payment attempt on the specified Payment Record.
-
.report_payment_attempt_canceled(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record was canceled.
-
.report_payment_attempt_failed(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record failed or errored.
-
.report_payment_attempt_guaranteed(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record was guaranteed.
Instance Method Summary collapse
-
#report_payment_attempt(params = {}, opts = {}) ⇒ Object
Report a new payment attempt on the specified Payment Record.
-
#report_payment_attempt_canceled(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record was canceled.
-
#report_payment_attempt_failed(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record failed or errored.
-
#report_payment_attempt_guaranteed(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record was guaranteed.
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#amount_canceled ⇒ Object (readonly)
A representation of an amount of money, consisting of an amount and a currency.
677 678 679 |
# File 'lib/stripe/resources/payment_record.rb', line 677 def amount_canceled @amount_canceled end |
#amount_failed ⇒ Object (readonly)
A representation of an amount of money, consisting of an amount and a currency.
680 681 682 |
# File 'lib/stripe/resources/payment_record.rb', line 680 def amount_failed @amount_failed end |
#amount_guaranteed ⇒ Object (readonly)
A representation of an amount of money, consisting of an amount and a currency.
683 684 685 |
# File 'lib/stripe/resources/payment_record.rb', line 683 def amount_guaranteed @amount_guaranteed end |
#amount_requested ⇒ Object (readonly)
A representation of an amount of money, consisting of an amount and a currency.
686 687 688 |
# File 'lib/stripe/resources/payment_record.rb', line 686 def amount_requested @amount_requested end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
689 690 691 |
# File 'lib/stripe/resources/payment_record.rb', line 689 def created @created end |
#customer_details ⇒ Object (readonly)
Customer information for this payment.
692 693 694 |
# File 'lib/stripe/resources/payment_record.rb', line 692 def customer_details @customer_details end |
#customer_presence ⇒ Object (readonly)
Indicates whether the customer was present in your checkout flow during this payment.
695 696 697 |
# File 'lib/stripe/resources/payment_record.rb', line 695 def customer_presence @customer_presence end |
#description ⇒ Object (readonly)
An arbitrary string attached to the object. Often useful for displaying to users.
698 699 700 |
# File 'lib/stripe/resources/payment_record.rb', line 698 def description @description end |
#id ⇒ Object (readonly)
Unique identifier for the object.
701 702 703 |
# File 'lib/stripe/resources/payment_record.rb', line 701 def id @id end |
#latest_payment_attempt_record ⇒ Object (readonly)
ID of the latest Payment Attempt Record attached to this Payment Record.
704 705 706 |
# File 'lib/stripe/resources/payment_record.rb', line 704 def latest_payment_attempt_record @latest_payment_attempt_record end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
707 708 709 |
# File 'lib/stripe/resources/payment_record.rb', line 707 def livemode @livemode end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
710 711 712 |
# File 'lib/stripe/resources/payment_record.rb', line 710 def @metadata end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
713 714 715 |
# File 'lib/stripe/resources/payment_record.rb', line 713 def object @object end |
#payment_method_details ⇒ Object (readonly)
Information about the Payment Method debited for this payment.
716 717 718 |
# File 'lib/stripe/resources/payment_record.rb', line 716 def payment_method_details @payment_method_details end |
#payment_reference ⇒ Object (readonly)
An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID.
719 720 721 |
# File 'lib/stripe/resources/payment_record.rb', line 719 def payment_reference @payment_reference end |
#shipping_details ⇒ Object (readonly)
Shipping information for this payment.
722 723 724 |
# File 'lib/stripe/resources/payment_record.rb', line 722 def shipping_details @shipping_details end |
Class Method Details
.object_name ⇒ Object
11 12 13 |
# File 'lib/stripe/resources/payment_record.rb', line 11 def self.object_name "payment_record" end |
.report_payment(params = {}, opts = {}) ⇒ Object
Report a new Payment Record. You may report a Payment Record as it is
initialized and later report updates through the other report_* methods, or report Payment
Records in a terminal state directly, through this method.
727 728 729 730 731 732 733 734 |
# File 'lib/stripe/resources/payment_record.rb', line 727 def self.report_payment(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/payment_records/report_payment", params: params, opts: opts ) end |
.report_payment_attempt(id, params = {}, opts = {}) ⇒ Object
Report a new payment attempt on the specified Payment Record. A new payment
attempt can only be specified if all other payment attempts are canceled or failed.
749 750 751 752 753 754 755 756 |
# File 'lib/stripe/resources/payment_record.rb', line 749 def self.report_payment_attempt(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.report_payment_attempt_canceled(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
was canceled.
771 772 773 774 775 776 777 778 |
# File 'lib/stripe/resources/payment_record.rb', line 771 def self.report_payment_attempt_canceled(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_canceled", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.report_payment_attempt_failed(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
failed or errored.
793 794 795 796 797 798 799 800 |
# File 'lib/stripe/resources/payment_record.rb', line 793 def self.report_payment_attempt_failed(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_failed", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.report_payment_attempt_guaranteed(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
was guaranteed.
815 816 817 818 819 820 821 822 |
# File 'lib/stripe/resources/payment_record.rb', line 815 def self.report_payment_attempt_guaranteed(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_guaranteed", { id: CGI.escape(id) }), params: params, opts: opts ) end |
Instance Method Details
#report_payment_attempt(params = {}, opts = {}) ⇒ Object
Report a new payment attempt on the specified Payment Record. A new payment
attempt can only be specified if all other payment attempts are canceled or failed.
738 739 740 741 742 743 744 745 |
# File 'lib/stripe/resources/payment_record.rb', line 738 def report_payment_attempt(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#report_payment_attempt_canceled(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
was canceled.
760 761 762 763 764 765 766 767 |
# File 'lib/stripe/resources/payment_record.rb', line 760 def report_payment_attempt_canceled(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_canceled", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#report_payment_attempt_failed(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
failed or errored.
782 783 784 785 786 787 788 789 |
# File 'lib/stripe/resources/payment_record.rb', line 782 def report_payment_attempt_failed(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_failed", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#report_payment_attempt_guaranteed(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
was guaranteed.
804 805 806 807 808 809 810 811 |
# File 'lib/stripe/resources/payment_record.rb', line 804 def report_payment_attempt_guaranteed(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_guaranteed", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |