lib/braintree/transaction.rb in braintree-2.22.0 vs lib/braintree/transaction.rb in braintree-2.23.0
- old
+ new
@@ -46,10 +46,11 @@
attr_reader :avs_error_response_code, :avs_postal_code_response_code, :avs_street_address_response_code
attr_reader :amount, :created_at, :credit_card_details, :customer_details, :subscription_details, :id
attr_reader :currency_iso_code
attr_reader :custom_fields
attr_reader :cvv_response_code
+ attr_reader :disbursement_details
attr_reader :descriptor
attr_reader :gateway_rejection_reason
attr_reader :merchant_account_id
attr_reader :order_id
attr_reader :channel
@@ -174,10 +175,11 @@
@amount = Util.to_big_decimal(amount)
@credit_card_details = CreditCardDetails.new(@credit_card)
@subscription_details = SubscriptionDetails.new(@subscription)
@customer_details = CustomerDetails.new(@customer)
@billing_details = AddressDetails.new(@billing)
+ @disbursement_details = DisbursementDetails.new(@disbursement_details)
@shipping_details = AddressDetails.new(@shipping)
@status_history = attributes[:status_history] ? attributes[:status_history].map { |s| StatusDetails.new(s) } : []
@tax_amount = Util.to_big_decimal(tax_amount)
@descriptor = Descriptor.new(@descriptor)
@custom_fields = attributes[:custom_fields].is_a?(Hash) ? attributes[:custom_fields] : {}
@@ -219,9 +221,14 @@
end
# Returns true if the transaction has been refunded. False otherwise.
def refunded?
!@refund_id.nil?
+ end
+
+ # Returns true if the transaction has been disbursed. False otherwise.
+ def disbursed?
+ @disbursement_details.valid?
end
def refund_id
warn "[DEPRECATED] Transaction.refund_id is deprecated. Please use TransparentRedirect.refund_ids"
@refund_id