Class: Brightpearl::CustomerPayment
- Extended by:
- APIOperations::Delete, APIOperations::Post
- Defined in:
- lib/brightpearl/resources/customer_payment.rb
Overview
Instance Attribute Summary collapse
-
#amount_authorized ⇒ Object
Returns the value of attribute amount_authorized.
-
#amount_paid ⇒ Object
Returns the value of attribute amount_paid.
-
#created_on ⇒ Object
Returns the value of attribute created_on.
-
#currency_code ⇒ Object
Returns the value of attribute currency_code.
-
#currency_id ⇒ Object
Returns the value of attribute currency_id.
-
#expires ⇒ Object
Returns the value of attribute expires.
-
#journal_id ⇒ Object
Returns the value of attribute journal_id.
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#payment_date ⇒ Object
Returns the value of attribute payment_date.
-
#payment_id ⇒ Object
Returns the value of attribute payment_id.
-
#payment_method_code ⇒ Object
Returns the value of attribute payment_method_code.
-
#payment_type ⇒ Object
Returns the value of attribute payment_type.
-
#transaction_code ⇒ Object
Returns the value of attribute transaction_code.
-
#transaction_ref ⇒ Object
Returns the value of attribute transaction_ref.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ara) ⇒ CustomerPayment
constructor
ARA => API Record Array.
Methods included from APIOperations::Post
Methods included from APIOperations::Delete
Methods inherited from Resource
Constructor Details
#initialize(ara) ⇒ CustomerPayment
ARA => API Record Array
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 30 def initialize(ara) @payment_id = ara[0] @transaction_ref = ara[1] @transaction_code = ara[2] @payment_method_code = ara[3] @payment_type = ara[4] @order_id = ara[5] @currency_id = ara[6] @currency_code = ara[7] @amount_authorized = ara[8] @amount_paid = ara[9] @expires = ara[10] @payment_date = ara[11] @created_on = ara[12] @journal_id = ara[13] end |
Instance Attribute Details
#amount_authorized ⇒ Object
Returns the value of attribute amount_authorized.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def @amount_authorized end |
#amount_paid ⇒ Object
Returns the value of attribute amount_paid.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def amount_paid @amount_paid end |
#created_on ⇒ Object
Returns the value of attribute created_on.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def created_on @created_on end |
#currency_code ⇒ Object
Returns the value of attribute currency_code.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def currency_code @currency_code end |
#currency_id ⇒ Object
Returns the value of attribute currency_id.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def currency_id @currency_id end |
#expires ⇒ Object
Returns the value of attribute expires.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def expires @expires end |
#journal_id ⇒ Object
Returns the value of attribute journal_id.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def journal_id @journal_id end |
#order_id ⇒ Object
Returns the value of attribute order_id.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def order_id @order_id end |
#payment_date ⇒ Object
Returns the value of attribute payment_date.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def payment_date @payment_date end |
#payment_id ⇒ Object
Returns the value of attribute payment_id.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def payment_id @payment_id end |
#payment_method_code ⇒ Object
Returns the value of attribute payment_method_code.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def payment_method_code @payment_method_code end |
#payment_type ⇒ Object
Returns the value of attribute payment_type.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def payment_type @payment_type end |
#transaction_code ⇒ Object
Returns the value of attribute transaction_code.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def transaction_code @transaction_code end |
#transaction_ref ⇒ Object
Returns the value of attribute transaction_ref.
7 8 9 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 7 def transaction_ref @transaction_ref end |
Class Method Details
.resource_path ⇒ Object
13 14 15 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 13 def resource_path "accounting-service/customer-payment" end |
.search(query_params = {}) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/brightpearl/resources/customer_payment.rb', line 21 def search(query_params = {}) response = send_request(path: "accounting-service/customer-payment-search?#{to_query(query_params)}", method: :get) return response.merge({ records: response[:payload]["response"]["results"].map { |item| CustomerPayment.new(item) }, }) end |