Class: Stripe::PaymentRecord

Inherits:
APIResource show all
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: Amount, AmountAuthorized, AmountCanceled, AmountFailed, AmountGuaranteed, AmountRefunded, AmountRequested, CustomerDetails, PaymentMethodDetails, ProcessorDetails, ShippingDetails

Constant Summary collapse

OBJECT_NAME =
"payment_record"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

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

included

Methods inherited from StripeObject

#==, #[], #[]=, #_get_inner_class_type, 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

#amountObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



1831
1832
1833
# File 'lib/stripe/resources/payment_record.rb', line 1831

def amount
  @amount
end

#amount_authorizedObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



1833
1834
1835
# File 'lib/stripe/resources/payment_record.rb', line 1833

def amount_authorized
  @amount_authorized
end

#amount_canceledObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



1835
1836
1837
# File 'lib/stripe/resources/payment_record.rb', line 1835

def amount_canceled
  @amount_canceled
end

#amount_failedObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



1837
1838
1839
# File 'lib/stripe/resources/payment_record.rb', line 1837

def amount_failed
  @amount_failed
end

#amount_guaranteedObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



1839
1840
1841
# File 'lib/stripe/resources/payment_record.rb', line 1839

def amount_guaranteed
  @amount_guaranteed
end

#amount_refundedObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



1841
1842
1843
# File 'lib/stripe/resources/payment_record.rb', line 1841

def amount_refunded
  @amount_refunded
end

#amount_requestedObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



1843
1844
1845
# File 'lib/stripe/resources/payment_record.rb', line 1843

def amount_requested
  @amount_requested
end

#applicationObject (readonly)

ID of the Connect application that created the PaymentRecord.



1845
1846
1847
# File 'lib/stripe/resources/payment_record.rb', line 1845

def application
  @application
end

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



1847
1848
1849
# File 'lib/stripe/resources/payment_record.rb', line 1847

def created
  @created
end

#customer_detailsObject (readonly)

Customer information for this payment.



1849
1850
1851
# File 'lib/stripe/resources/payment_record.rb', line 1849

def customer_details
  @customer_details
end

#customer_presenceObject (readonly)

Indicates whether the customer was present in your checkout flow during this payment.



1851
1852
1853
# File 'lib/stripe/resources/payment_record.rb', line 1851

def customer_presence
  @customer_presence
end

#descriptionObject (readonly)

An arbitrary string attached to the object. Often useful for displaying to users.



1853
1854
1855
# File 'lib/stripe/resources/payment_record.rb', line 1853

def description
  @description
end

#idObject (readonly)

Unique identifier for the object.



1855
1856
1857
# File 'lib/stripe/resources/payment_record.rb', line 1855

def id
  @id
end

#latest_payment_attempt_recordObject (readonly)

ID of the latest Payment Attempt Record attached to this Payment Record.



1857
1858
1859
# File 'lib/stripe/resources/payment_record.rb', line 1857

def latest_payment_attempt_record
  @latest_payment_attempt_record
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



1859
1860
1861
# File 'lib/stripe/resources/payment_record.rb', line 1859

def livemode
  @livemode
end

#metadataObject (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.



1861
1862
1863
# File 'lib/stripe/resources/payment_record.rb', line 1861

def 
  @metadata
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



1863
1864
1865
# File 'lib/stripe/resources/payment_record.rb', line 1863

def object
  @object
end

#payment_method_detailsObject (readonly)

Information about the Payment Method debited for this payment.



1865
1866
1867
# File 'lib/stripe/resources/payment_record.rb', line 1865

def payment_method_details
  @payment_method_details
end

#processor_detailsObject (readonly)

Processor information associated with this payment.



1867
1868
1869
# File 'lib/stripe/resources/payment_record.rb', line 1867

def processor_details
  @processor_details
end

#shipping_detailsObject (readonly)

Shipping information for this payment.



1869
1870
1871
# File 'lib/stripe/resources/payment_record.rb', line 1869

def shipping_details
  @shipping_details
end

Class Method Details

.field_remappingsObject



2029
2030
2031
# File 'lib/stripe/resources/payment_record.rb', line 2029

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
# File 'lib/stripe/resources/payment_record.rb', line 2013

def self.inner_class_types
  @inner_class_types = {
    amount: Amount,
    amount_authorized: AmountAuthorized,
    amount_canceled: AmountCanceled,
    amount_failed: AmountFailed,
    amount_guaranteed: AmountGuaranteed,
    amount_refunded: AmountRefunded,
    amount_requested: AmountRequested,
    customer_details: CustomerDetails,
    payment_method_details: PaymentMethodDetails,
    processor_details: ProcessorDetails,
    shipping_details: ShippingDetails,
  }
end

.object_nameObject



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.


1874
1875
1876
1877
1878
1879
1880
1881
# File 'lib/stripe/resources/payment_record.rb', line 1874

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.


1896
1897
1898
1899
1900
1901
1902
1903
# File 'lib/stripe/resources/payment_record.rb', line 1896

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.


1918
1919
1920
1921
1922
1923
1924
1925
# File 'lib/stripe/resources/payment_record.rb', line 1918

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.


1940
1941
1942
1943
1944
1945
1946
1947
# File 'lib/stripe/resources/payment_record.rb', line 1940

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.


1962
1963
1964
1965
1966
1967
1968
1969
# File 'lib/stripe/resources/payment_record.rb', line 1962

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

.report_payment_attempt_informational(id, params = {}, opts = {}) ⇒ Object

Report informational updates on the specified Payment Record.



1982
1983
1984
1985
1986
1987
1988
1989
# File 'lib/stripe/resources/payment_record.rb', line 1982

def self.report_payment_attempt_informational(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/payment_records/%<id>s/report_payment_attempt_informational", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

.report_refund(id, params = {}, opts = {}) ⇒ Object

Report that the most recent payment attempt on the specified Payment Record

was refunded.


2004
2005
2006
2007
2008
2009
2010
2011
# File 'lib/stripe/resources/payment_record.rb', line 2004

def self.report_refund(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/payment_records/%<id>s/report_refund", { 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.


1885
1886
1887
1888
1889
1890
1891
1892
# File 'lib/stripe/resources/payment_record.rb', line 1885

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.


1907
1908
1909
1910
1911
1912
1913
1914
# File 'lib/stripe/resources/payment_record.rb', line 1907

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.


1929
1930
1931
1932
1933
1934
1935
1936
# File 'lib/stripe/resources/payment_record.rb', line 1929

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.


1951
1952
1953
1954
1955
1956
1957
1958
# File 'lib/stripe/resources/payment_record.rb', line 1951

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

#report_payment_attempt_informational(params = {}, opts = {}) ⇒ Object

Report informational updates on the specified Payment Record.



1972
1973
1974
1975
1976
1977
1978
1979
# File 'lib/stripe/resources/payment_record.rb', line 1972

def report_payment_attempt_informational(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/payment_records/%<id>s/report_payment_attempt_informational", { id: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#report_refund(params = {}, opts = {}) ⇒ Object

Report that the most recent payment attempt on the specified Payment Record

was refunded.


1993
1994
1995
1996
1997
1998
1999
2000
# File 'lib/stripe/resources/payment_record.rb', line 1993

def report_refund(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/payment_records/%<id>s/report_refund", { id: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end