class Starling::Resources::PaymentResource
A resource representing a Payment returned from the Payment API
Public Instance Methods
@return [Float] the amount of the payment
# File lib/starling/resources/payment_resource.rb, line 17 def amount present_float(parsed_data['amount']) end
@return [Time, nil] the time when the payment was cancelled, or nil if it has not
been cancelled
# File lib/starling/resources/payment_resource.rb, line 67 def cancelled_at present_datetime(parsed_data['cancelledAt']) end
@return [String] the currency of the payment
# File lib/starling/resources/payment_resource.rb, line 12 def currency parsed_data['currency'] end
@return [true, false] where the payment is immediate or scheduled for the future
# File lib/starling/resources/payment_resource.rb, line 38 def immediate parsed_data['immediate'] end
@return [Date] the date of the next payment in the series
# File lib/starling/resources/payment_resource.rb, line 61 def next_date present_date(parsed_data['nextDate']) end
@return [String] the Starling
internal ID of the payment
# File lib/starling/resources/payment_resource.rb, line 6 def payment_order_id parsed_data['paymentOrderId'] end
@return [Symbol] the type of the payment (e.g. `:standing_order`) (these values
do not seem to be accurate!)
# File lib/starling/resources/payment_resource.rb, line 73 def payment_type present_enum(parsed_data['paymentType']) end
@return [String] the Starling
internal ID of the contact account the payment
is/was sent to
# File lib/starling/resources/payment_resource.rb, line 28 def receiving_contact_account_id parsed_data['receivingContactAccountId'] end
@return [String] the name of the recipient of the payment
# File lib/starling/resources/payment_resource.rb, line 33 def recipient_name parsed_data['recipientName'] end
Returns a Hash describing the recurrence behaviour of the payment, or nil if the payment is not recurring. The values in the Hash will be parsed directly from JSON (e.g. dates will appear as strings).
TODO: Consider replacing this with its own resource
@return [Hash, nil] a Hash describing the recurrence behaviour of the payment,
with values parsed directly from JSON, or nil if the payment is not recurring
# File lib/starling/resources/payment_resource.rb, line 51 def recurrence_rule parsed_data['recurrenceRule'] end
@return [String] the reference of the payment
# File lib/starling/resources/payment_resource.rb, line 22 def reference parsed_data['reference'] end
@return [Date] the start date of the payment
# File lib/starling/resources/payment_resource.rb, line 56 def start_date present_date(parsed_data['startDate']) end