apimatic-cp-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +178 -0
- data/bin/console +15 -0
- data/lib/cell_point_api/api_helper.rb +10 -0
- data/lib/cell_point_api/apis/apple_pay_api.rb +51 -0
- data/lib/cell_point_api/apis/authentication_api.rb +81 -0
- data/lib/cell_point_api/apis/base_api.rb +67 -0
- data/lib/cell_point_api/apis/bulk_api.rb +93 -0
- data/lib/cell_point_api/apis/cards_api.rb +104 -0
- data/lib/cell_point_api/apis/notes_api.rb +66 -0
- data/lib/cell_point_api/apis/oauth_authorization_api.rb +44 -0
- data/lib/cell_point_api/apis/orders_api.rb +483 -0
- data/lib/cell_point_api/apis/payment_methods_api.rb +57 -0
- data/lib/cell_point_api/apis/proxy_api.rb +91 -0
- data/lib/cell_point_api/apis/transactions_api.rb +546 -0
- data/lib/cell_point_api/apis/wallet_api.rb +39 -0
- data/lib/cell_point_api/client.rb +145 -0
- data/lib/cell_point_api/configuration.rb +180 -0
- data/lib/cell_point_api/events/callbacks/callbacks_handler.rb +37 -0
- data/lib/cell_point_api/events/unknown_event.rb +32 -0
- data/lib/cell_point_api/exceptions/api_exception.rb +21 -0
- data/lib/cell_point_api/exceptions/oauth_provider_exception.rb +64 -0
- data/lib/cell_point_api/exceptions/problem_exception.rb +75 -0
- data/lib/cell_point_api/http/api_response.rb +19 -0
- data/lib/cell_point_api/http/auth/cpd_issued_jwt.rb +156 -0
- data/lib/cell_point_api/http/auth/merchant_issued_jwt.rb +53 -0
- data/lib/cell_point_api/http/http_call_back.rb +10 -0
- data/lib/cell_point_api/http/http_method_enum.rb +10 -0
- data/lib/cell_point_api/http/http_request.rb +10 -0
- data/lib/cell_point_api/http/http_response.rb +10 -0
- data/lib/cell_point_api/http/proxy_settings.rb +22 -0
- data/lib/cell_point_api/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/cell_point_api/logging/sdk_logger.rb +17 -0
- data/lib/cell_point_api/models/account.rb +168 -0
- data/lib/cell_point_api/models/account_status.rb +52 -0
- data/lib/cell_point_api/models/account_type.rb +44 -0
- data/lib/cell_point_api/models/action_base.rb +74 -0
- data/lib/cell_point_api/models/action_completion_response.rb +77 -0
- data/lib/cell_point_api/models/action_result_status.rb +40 -0
- data/lib/cell_point_api/models/action_type.rb +36 -0
- data/lib/cell_point_api/models/activity.rb +244 -0
- data/lib/cell_point_api/models/activity_data.rb +127 -0
- data/lib/cell_point_api/models/address_verification_status.rb +56 -0
- data/lib/cell_point_api/models/airline_ancillary.rb +244 -0
- data/lib/cell_point_api/models/airline_ancillary_data.rb +120 -0
- data/lib/cell_point_api/models/airline_fare.rb +348 -0
- data/lib/cell_point_api/models/airline_fare_data.rb +217 -0
- data/lib/cell_point_api/models/airline_industry_data.rb +152 -0
- data/lib/cell_point_api/models/airport.rb +144 -0
- data/lib/cell_point_api/models/amount.rb +105 -0
- data/lib/cell_point_api/models/ancillary_details.rb +366 -0
- data/lib/cell_point_api/models/apple_pay_config.rb +83 -0
- data/lib/cell_point_api/models/apple_pay_instrument_apple_pay_node.rb +119 -0
- data/lib/cell_point_api/models/apple_pay_payment_instrument.rb +123 -0
- data/lib/cell_point_api/models/apple_tokenized_token.rb +143 -0
- data/lib/cell_point_api/models/audience.rb +36 -0
- data/lib/cell_point_api/models/authorization.rb +145 -0
- data/lib/cell_point_api/models/authorization_group.rb +99 -0
- data/lib/cell_point_api/models/authorization_group1.rb +216 -0
- data/lib/cell_point_api/models/authorization_group_full.rb +193 -0
- data/lib/cell_point_api/models/authorize_order_by_id_post201_response.rb +128 -0
- data/lib/cell_point_api/models/auto_rental.rb +195 -0
- data/lib/cell_point_api/models/auto_rental_data.rb +76 -0
- data/lib/cell_point_api/models/auto_rental_industry_data.rb +182 -0
- data/lib/cell_point_api/models/base_model.rb +110 -0
- data/lib/cell_point_api/models/bin.rb +73 -0
- data/lib/cell_point_api/models/breadcrumb.rb +86 -0
- data/lib/cell_point_api/models/browser_info.rb +114 -0
- data/lib/cell_point_api/models/bundle.rb +195 -0
- data/lib/cell_point_api/models/bundled_activity.rb +229 -0
- data/lib/cell_point_api/models/bundled_airline_ancillary.rb +226 -0
- data/lib/cell_point_api/models/bundled_airline_fare.rb +330 -0
- data/lib/cell_point_api/models/bundled_auto_rental.rb +176 -0
- data/lib/cell_point_api/models/bundled_discount.rb +132 -0
- data/lib/cell_point_api/models/bundled_item_base.rb +123 -0
- data/lib/cell_point_api/models/bundled_lodging_reservation.rb +176 -0
- data/lib/cell_point_api/models/bundled_product.rb +161 -0
- data/lib/cell_point_api/models/buyer.rb +129 -0
- data/lib/cell_point_api/models/buyer_fingerprint.rb +125 -0
- data/lib/cell_point_api/models/buyer_history.rb +199 -0
- data/lib/cell_point_api/models/cancel.rb +109 -0
- data/lib/cell_point_api/models/cancelled_payment_transactions.rb +84 -0
- data/lib/cell_point_api/models/capabilities.rb +77 -0
- data/lib/cell_point_api/models/capture.rb +84 -0
- data/lib/cell_point_api/models/capture_payment_response.rb +159 -0
- data/lib/cell_point_api/models/card.rb +131 -0
- data/lib/cell_point_api/models/card_config.rb +105 -0
- data/lib/cell_point_api/models/card_identification.rb +126 -0
- data/lib/cell_point_api/models/card_instrument_card_node.rb +232 -0
- data/lib/cell_point_api/models/card_number.rb +122 -0
- data/lib/cell_point_api/models/card_payment_instrument.rb +136 -0
- data/lib/cell_point_api/models/card_scheme.rb +63 -0
- data/lib/cell_point_api/models/card_scheme_configuration.rb +87 -0
- data/lib/cell_point_api/models/carrier.rb +82 -0
- data/lib/cell_point_api/models/category.rb +36 -0
- data/lib/cell_point_api/models/client_assertion.rb +135 -0
- data/lib/cell_point_api/models/close.rb +89 -0
- data/lib/cell_point_api/models/close_refund_response.rb +73 -0
- data/lib/cell_point_api/models/closed_payment_transactions.rb +83 -0
- data/lib/cell_point_api/models/codeshare.rb +87 -0
- data/lib/cell_point_api/models/complete_person_name.rb +120 -0
- data/lib/cell_point_api/models/completion_redirect.rb +93 -0
- data/lib/cell_point_api/models/configuration.rb +86 -0
- data/lib/cell_point_api/models/contact_data.rb +82 -0
- data/lib/cell_point_api/models/cpu.rb +74 -0
- data/lib/cell_point_api/models/device_os.rb +60 -0
- data/lib/cell_point_api/models/discount.rb +150 -0
- data/lib/cell_point_api/models/discount_data.rb +83 -0
- data/lib/cell_point_api/models/driver.rb +86 -0
- data/lib/cell_point_api/models/external_transaction.rb +227 -0
- data/lib/cell_point_api/models/externally_tokenized_card.rb +81 -0
- data/lib/cell_point_api/models/failover.rb +105 -0
- data/lib/cell_point_api/models/failure_category.rb +62 -0
- data/lib/cell_point_api/models/failure_module.rb +58 -0
- data/lib/cell_point_api/models/fingerprint.rb +82 -0
- data/lib/cell_point_api/models/fraud_assessment.rb +163 -0
- data/lib/cell_point_api/models/fulfilled_activity.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_airline_ancillary.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_airline_fare.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_auto_rental.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_bundle.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_discount.rb +178 -0
- data/lib/cell_point_api/models/fulfilled_line_item_base.rb +177 -0
- data/lib/cell_point_api/models/fulfilled_lodging_reservation.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_order.rb +148 -0
- data/lib/cell_point_api/models/fulfilled_product.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_tax_line.rb +162 -0
- data/lib/cell_point_api/models/fulfillment_data.rb +90 -0
- data/lib/cell_point_api/models/fulfillment_status.rb +41 -0
- data/lib/cell_point_api/models/funding_type.rb +40 -0
- data/lib/cell_point_api/models/gender.rb +40 -0
- data/lib/cell_point_api/models/hpp_data.rb +155 -0
- data/lib/cell_point_api/models/identifying_document.rb +159 -0
- data/lib/cell_point_api/models/identifying_document_type.rb +60 -0
- data/lib/cell_point_api/models/industry_data.rb +124 -0
- data/lib/cell_point_api/models/informational_price_row.rb +97 -0
- data/lib/cell_point_api/models/informational_price_section.rb +104 -0
- data/lib/cell_point_api/models/itinerary_type.rb +47 -0
- data/lib/cell_point_api/models/journey_segment.rb +83 -0
- data/lib/cell_point_api/models/line_item_base.rb +101 -0
- data/lib/cell_point_api/models/line_item_type.rb +60 -0
- data/lib/cell_point_api/models/links.rb +86 -0
- data/lib/cell_point_api/models/location.rb +153 -0
- data/lib/cell_point_api/models/lodging_industry_data.rb +216 -0
- data/lib/cell_point_api/models/lodging_reservation.rb +195 -0
- data/lib/cell_point_api/models/lodging_reservation_data.rb +76 -0
- data/lib/cell_point_api/models/loyalty_account.rb +103 -0
- data/lib/cell_point_api/models/network_info.rb +76 -0
- data/lib/cell_point_api/models/non_negative_amount.rb +105 -0
- data/lib/cell_point_api/models/non_positive_amount.rb +105 -0
- data/lib/cell_point_api/models/note.rb +139 -0
- data/lib/cell_point_api/models/note_request.rb +90 -0
- data/lib/cell_point_api/models/oauth_provider_error.rb +62 -0
- data/lib/cell_point_api/models/oauth_scope_cpd_issued_jwt.rb +158 -0
- data/lib/cell_point_api/models/oauth_token.rb +96 -0
- data/lib/cell_point_api/models/order.rb +414 -0
- data/lib/cell_point_api/models/order_canceled_reason.rb +56 -0
- data/lib/cell_point_api/models/order_core.rb +343 -0
- data/lib/cell_point_api/models/order_extended.rb +150 -0
- data/lib/cell_point_api/models/order_payment_summary.rb +117 -0
- data/lib/cell_point_api/models/order_status.rb +161 -0
- data/lib/cell_point_api/models/order_status_type.rb +58 -0
- data/lib/cell_point_api/models/order_transactions.rb +88 -0
- data/lib/cell_point_api/models/owner.rb +131 -0
- data/lib/cell_point_api/models/page_type.rb +26 -0
- data/lib/cell_point_api/models/passenger.rb +229 -0
- data/lib/cell_point_api/models/password_change_type.rb +41 -0
- data/lib/cell_point_api/models/pay_pal_action.rb +129 -0
- data/lib/cell_point_api/models/pay_pal_payment_instrument.rb +88 -0
- data/lib/cell_point_api/models/payment_data.rb +102 -0
- data/lib/cell_point_api/models/payment_data_header.rb +94 -0
- data/lib/cell_point_api/models/payment_data_version.rb +26 -0
- data/lib/cell_point_api/models/payment_field.rb +68 -0
- data/lib/cell_point_api/models/payment_instrument_base.rb +87 -0
- data/lib/cell_point_api/models/payment_method.rb +52 -0
- data/lib/cell_point_api/models/payment_methods_for_order_get200_response.rb +157 -0
- data/lib/cell_point_api/models/payment_methods_search_vouchers_post200_response.rb +82 -0
- data/lib/cell_point_api/models/payment_processor.rb +121 -0
- data/lib/cell_point_api/models/payment_status.rb +122 -0
- data/lib/cell_point_api/models/payment_transaction.rb +605 -0
- data/lib/cell_point_api/models/payment_transaction_authorized_amount.rb +105 -0
- data/lib/cell_point_api/models/payment_transaction_canceled_amount.rb +105 -0
- data/lib/cell_point_api/models/payment_transaction_captured_amount.rb +105 -0
- data/lib/cell_point_api/models/payment_transaction_pending_authorize_amount.rb +106 -0
- data/lib/cell_point_api/models/payment_transaction_pending_cancel_amount.rb +106 -0
- data/lib/cell_point_api/models/payment_transaction_pending_capture_amount.rb +106 -0
- data/lib/cell_point_api/models/payment_transaction_processing_fee.rb +106 -0
- data/lib/cell_point_api/models/payment_transaction_refunded_amount.rb +105 -0
- data/lib/cell_point_api/models/payments_v1_bulks_response.rb +74 -0
- data/lib/cell_point_api/models/payments_v1_orders_payments_retry_failed_refunds_request.rb +74 -0
- data/lib/cell_point_api/models/payments_v1_refunds_closures_request.rb +74 -0
- data/lib/cell_point_api/models/payments_v1_refunds_retry_failed_refunds_request.rb +74 -0
- data/lib/cell_point_api/models/payments_v1_schemes_response.rb +76 -0
- data/lib/cell_point_api/models/paypal_config.rb +94 -0
- data/lib/cell_point_api/models/person.rb +161 -0
- data/lib/cell_point_api/models/person_name.rb +89 -0
- data/lib/cell_point_api/models/phone.rb +132 -0
- data/lib/cell_point_api/models/pk_payment_method.rb +111 -0
- data/lib/cell_point_api/models/pk_payment_token.rb +94 -0
- data/lib/cell_point_api/models/postal_address.rb +217 -0
- data/lib/cell_point_api/models/price_summary.rb +191 -0
- data/lib/cell_point_api/models/product.rb +179 -0
- data/lib/cell_point_api/models/product_data.rb +104 -0
- data/lib/cell_point_api/models/property.rb +110 -0
- data/lib/cell_point_api/models/provider.rb +129 -0
- data/lib/cell_point_api/models/psp.rb +26 -0
- data/lib/cell_point_api/models/redirect_action.rb +116 -0
- data/lib/cell_point_api/models/refund_item.rb +310 -0
- data/lib/cell_point_api/models/refund_method.rb +36 -0
- data/lib/cell_point_api/models/refund_order_group_post201_response.rb +91 -0
- data/lib/cell_point_api/models/refund_reason.rb +104 -0
- data/lib/cell_point_api/models/refund_request.rb +161 -0
- data/lib/cell_point_api/models/refund_status.rb +44 -0
- data/lib/cell_point_api/models/refund_transaction.rb +311 -0
- data/lib/cell_point_api/models/refund_transaction_amount.rb +105 -0
- data/lib/cell_point_api/models/refund_type.rb +38 -0
- data/lib/cell_point_api/models/related_payment.rb +106 -0
- data/lib/cell_point_api/models/related_refund.rb +106 -0
- data/lib/cell_point_api/models/rental_location.rb +226 -0
- data/lib/cell_point_api/models/retry_refund_response.rb +73 -0
- data/lib/cell_point_api/models/reward.rb +101 -0
- data/lib/cell_point_api/models/room.rb +100 -0
- data/lib/cell_point_api/models/sales_channel.rb +36 -0
- data/lib/cell_point_api/models/save_pk_payment_token_request.rb +83 -0
- data/lib/cell_point_api/models/save_wallet_payment_token_request.rb +83 -0
- data/lib/cell_point_api/models/screen.rb +97 -0
- data/lib/cell_point_api/models/search_vouchers_request.rb +119 -0
- data/lib/cell_point_api/models/security_code.rb +83 -0
- data/lib/cell_point_api/models/security_code_match_status.rb +50 -0
- data/lib/cell_point_api/models/status.rb +43 -0
- data/lib/cell_point_api/models/status1.rb +52 -0
- data/lib/cell_point_api/models/summary.rb +82 -0
- data/lib/cell_point_api/models/tax.rb +134 -0
- data/lib/cell_point_api/models/taxes_and_fees_breakdown_page.rb +82 -0
- data/lib/cell_point_api/models/token_post200_response.rb +96 -0
- data/lib/cell_point_api/models/tokenized_card.rb +229 -0
- data/lib/cell_point_api/models/tokenized_card_with_contact_data.rb +247 -0
- data/lib/cell_point_api/models/tokenized_data.rb +169 -0
- data/lib/cell_point_api/models/total_row.rb +83 -0
- data/lib/cell_point_api/models/transaction_action.rb +108 -0
- data/lib/cell_point_api/models/transaction_action_result.rb +94 -0
- data/lib/cell_point_api/models/transaction_base.rb +132 -0
- data/lib/cell_point_api/models/transaction_failure.rb +222 -0
- data/lib/cell_point_api/models/travel_journey.rb +139 -0
- data/lib/cell_point_api/models/travel_leg.rb +194 -0
- data/lib/cell_point_api/models/trigger_bulk_request.rb +83 -0
- data/lib/cell_point_api/models/type.rb +67 -0
- data/lib/cell_point_api/models/type1.rb +47 -0
- data/lib/cell_point_api/models/type2.rb +40 -0
- data/lib/cell_point_api/models/type3.rb +41 -0
- data/lib/cell_point_api/models/type4.rb +56 -0
- data/lib/cell_point_api/models/type5.rb +78 -0
- data/lib/cell_point_api/models/uplift_config.rb +73 -0
- data/lib/cell_point_api/models/uplift_payment_instrument.rb +102 -0
- data/lib/cell_point_api/models/vehicle.rb +139 -0
- data/lib/cell_point_api/models/voucher_config.rb +92 -0
- data/lib/cell_point_api/models/voucher_issuer.rb +26 -0
- data/lib/cell_point_api/models/voucher_payment_instrument.rb +233 -0
- data/lib/cell_point_api/models/voucher_payment_instrument_node.rb +198 -0
- data/lib/cell_point_api/models/voucher_type.rb +36 -0
- data/lib/cell_point_api/models/wallet_instrument_wallet_node.rb +136 -0
- data/lib/cell_point_api/models/wallet_payment_instrument.rb +123 -0
- data/lib/cell_point_api/models/wallet_tokenized_token.rb +148 -0
- data/lib/cell_point_api/models/wallet_tokenized_token_identification.rb +75 -0
- data/lib/cell_point_api/models/wallet_type.rb +36 -0
- data/lib/cell_point_api/utilities/date_time_helper.rb +11 -0
- data/lib/cell_point_api/utilities/file_wrapper.rb +28 -0
- data/lib/cell_point_api/utilities/union_type_lookup.rb +260 -0
- data/lib/cell_point_api.rb +301 -0
- metadata +354 -0
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
# cell_point_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module CellPointApi
|
|
8
|
+
# A Payment Transaction is a transaction that is processed by a payment
|
|
9
|
+
# processor.
|
|
10
|
+
class PaymentTransaction < BaseModel
|
|
11
|
+
SKIP = Object.new
|
|
12
|
+
private_constant :SKIP
|
|
13
|
+
|
|
14
|
+
# Unique identifier for this transaction.
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# Identifier for an order.
|
|
19
|
+
# @return [String]
|
|
20
|
+
attr_accessor :order_id
|
|
21
|
+
|
|
22
|
+
# Discriminator used to identify the type of transaction.
|
|
23
|
+
# @return [Type2]
|
|
24
|
+
attr_accessor :type
|
|
25
|
+
|
|
26
|
+
# Details about a failure that happened on a transaction.
|
|
27
|
+
# @return [TransactionFailure]
|
|
28
|
+
attr_accessor :failure
|
|
29
|
+
|
|
30
|
+
# When the transaction was created.
|
|
31
|
+
# @return [DateTime]
|
|
32
|
+
attr_accessor :created_at
|
|
33
|
+
|
|
34
|
+
# Acquirer or Payment Service Provider (PSP) that processed the payment.
|
|
35
|
+
# @return [PaymentProcessor]
|
|
36
|
+
attr_accessor :payment_processor
|
|
37
|
+
|
|
38
|
+
# States that a transaction can be in.
|
|
39
|
+
# <table>
|
|
40
|
+
# <thead>
|
|
41
|
+
# <tr>
|
|
42
|
+
# <th>Status</th>
|
|
43
|
+
# <th>Description</th>
|
|
44
|
+
# </tr>
|
|
45
|
+
# </thead>
|
|
46
|
+
# <tbody>
|
|
47
|
+
# <tr>
|
|
48
|
+
# <td>AUTHORIZED</td>
|
|
49
|
+
# <td>A transaction has been fully authorized and the funds are being
|
|
50
|
+
# held.</td>
|
|
51
|
+
# </tr>
|
|
52
|
+
# <tr>
|
|
53
|
+
# <td>AUTHORIZE_FAILED</td>
|
|
54
|
+
# <td>Authorization has failed. No funds are being held.</td>
|
|
55
|
+
# </tr>
|
|
56
|
+
# <tr>
|
|
57
|
+
# <td>AUTHORIZE_INITIATED</td>
|
|
58
|
+
# <td>A payment authorization has been initiated with CellPoint
|
|
59
|
+
# Digital.</td>
|
|
60
|
+
# </tr>
|
|
61
|
+
# <tr>
|
|
62
|
+
# <td>CANCELED</td>
|
|
63
|
+
# <td>Authorization has been canceled and no funds are being held
|
|
64
|
+
# anymore.</td>
|
|
65
|
+
# </tr>
|
|
66
|
+
# <tr>
|
|
67
|
+
# <td>CANCELLATION_FAILED</td>
|
|
68
|
+
# <td>Cancellation has failed. Funds are still held as part of the
|
|
69
|
+
# authorization.</td>
|
|
70
|
+
# </tr>
|
|
71
|
+
# <tr>
|
|
72
|
+
# <td>CANCELLATION_INITIATED</td>
|
|
73
|
+
# <td>Cancellation of funds have been initiated and is pending
|
|
74
|
+
# completion.</td>
|
|
75
|
+
# </tr>
|
|
76
|
+
# <tr>
|
|
77
|
+
# <td>CAPTURED</td>
|
|
78
|
+
# <td>
|
|
79
|
+
# Authorized transaction that has been fully captured.
|
|
80
|
+
# Depending on how settlement is done by payment processor, funds
|
|
81
|
+
# have been moved from buyer's account to merchant's account.
|
|
82
|
+
# </td>
|
|
83
|
+
# </tr>
|
|
84
|
+
# <tr>
|
|
85
|
+
# <td>CAPTURE_FAILED</td>
|
|
86
|
+
# <td>Capture has failed. Funds are still held as part of the
|
|
87
|
+
# authorization, but have not moved.</td>
|
|
88
|
+
# </tr>
|
|
89
|
+
# <tr>
|
|
90
|
+
# <td>CAPTURE_INITIATED</td>
|
|
91
|
+
# <td>Capture has been initiated, but is pending completion.</td>
|
|
92
|
+
# </tr>
|
|
93
|
+
# <tr>
|
|
94
|
+
# <td>CAPTURE_PENDING</td>
|
|
95
|
+
# <td>Authorization has already happened, and the transaction has now
|
|
96
|
+
# been marked as pending for capture. Capture will take place automatically
|
|
97
|
+
# as per configured schedule.</td>
|
|
98
|
+
# </tr>
|
|
99
|
+
# <tr>
|
|
100
|
+
# <td>CAPTURE_BATCHED</td>
|
|
101
|
+
# <td>Authorization has already happened, and the transaction has been
|
|
102
|
+
# sent for capturing in a batch. Capture will finally take place
|
|
103
|
+
# automatically as per configured schedule.</td>
|
|
104
|
+
# </tr>
|
|
105
|
+
# <tr>
|
|
106
|
+
# <td>PARTIALLY_CANCELED</td>
|
|
107
|
+
# <td>Authorized transaction is partially canceled<td>
|
|
108
|
+
# </tr>
|
|
109
|
+
# <tr>
|
|
110
|
+
# <td>PARTIALLY_CAPTURED</td>
|
|
111
|
+
# <td>Authorized transaction is partially captured<td>
|
|
112
|
+
# </tr>
|
|
113
|
+
# <tr>
|
|
114
|
+
# <td>PENDING_ACTION_COMPLETION</td>
|
|
115
|
+
# <td>The transaction is in a state where an action has been
|
|
116
|
+
# initiated, but is pending completion.</td>
|
|
117
|
+
# </tr>
|
|
118
|
+
# <tr>
|
|
119
|
+
# <td>CLOSED</td>
|
|
120
|
+
# <td>The transaction that has previously failed has been closed to
|
|
121
|
+
# avoid its stagnation in review pools.</td>
|
|
122
|
+
# </tr>
|
|
123
|
+
# </tbody>
|
|
124
|
+
# </table>
|
|
125
|
+
# @return [PaymentStatus]
|
|
126
|
+
attr_accessor :status
|
|
127
|
+
|
|
128
|
+
# When the transaction was authorized.
|
|
129
|
+
# @return [DateTime]
|
|
130
|
+
attr_accessor :authorized_at
|
|
131
|
+
|
|
132
|
+
# When the transaction's funds were captured.
|
|
133
|
+
# If multiple captures have happened, this is the latest capture.
|
|
134
|
+
# @return [DateTime]
|
|
135
|
+
attr_accessor :captured_at
|
|
136
|
+
|
|
137
|
+
# When the transaction's authorization was canceled.
|
|
138
|
+
# @return [DateTime]
|
|
139
|
+
attr_accessor :canceled_at
|
|
140
|
+
|
|
141
|
+
# List of refund transaction(s) that have happened for this payment.
|
|
142
|
+
# @return [Array[RelatedRefund]]
|
|
143
|
+
attr_accessor :refunds
|
|
144
|
+
|
|
145
|
+
# If the transaction had to failover to a different payment processor.
|
|
146
|
+
# List of failover failures can be found in `failovers` property.
|
|
147
|
+
# @return [TrueClass | FalseClass]
|
|
148
|
+
attr_accessor :has_failed_over
|
|
149
|
+
|
|
150
|
+
# If the transaction had to failover to a different payment processor.
|
|
151
|
+
# List of failover failures can be found in `failovers` property.
|
|
152
|
+
# @return [Array[Failover]]
|
|
153
|
+
attr_accessor :failovers
|
|
154
|
+
|
|
155
|
+
# If `status` is `AUTHORIZE_INITIATED` this is the amount that will be
|
|
156
|
+
# attempted to be authorized.
|
|
157
|
+
# @return [PaymentTransactionPendingAuthorizeAmount]
|
|
158
|
+
attr_accessor :pending_authorize_amount
|
|
159
|
+
|
|
160
|
+
# Amount that was authorized on the transaction.
|
|
161
|
+
# @return [PaymentTransactionAuthorizedAmount]
|
|
162
|
+
attr_accessor :authorized_amount
|
|
163
|
+
|
|
164
|
+
# If `status` is `CAPTURE_PENDING`, this will be the amount that will be
|
|
165
|
+
# captured.
|
|
166
|
+
# @return [PaymentTransactionPendingCaptureAmount]
|
|
167
|
+
attr_accessor :pending_capture_amount
|
|
168
|
+
|
|
169
|
+
# Amount captured from an authorised transaction.
|
|
170
|
+
# @return [PaymentTransactionCapturedAmount]
|
|
171
|
+
attr_accessor :captured_amount
|
|
172
|
+
|
|
173
|
+
# Amount refunded from a captured transaction.
|
|
174
|
+
# @return [PaymentTransactionRefundedAmount]
|
|
175
|
+
attr_accessor :refunded_amount
|
|
176
|
+
|
|
177
|
+
# During the cancellation process this will be the amount that will be
|
|
178
|
+
# canceled.
|
|
179
|
+
# @return [PaymentTransactionPendingCancelAmount]
|
|
180
|
+
attr_accessor :pending_cancel_amount
|
|
181
|
+
|
|
182
|
+
# Amount canceled from an authorized transaction.
|
|
183
|
+
# @return [PaymentTransactionCanceledAmount]
|
|
184
|
+
attr_accessor :canceled_amount
|
|
185
|
+
|
|
186
|
+
# If there is a fee for using the payment method (i.e. $5 fee for using
|
|
187
|
+
# ACH), that should be included here.
|
|
188
|
+
# @return [PaymentTransactionProcessingFee]
|
|
189
|
+
attr_accessor :processing_fee
|
|
190
|
+
|
|
191
|
+
# The payment instrument that is being used in the transaction.
|
|
192
|
+
# @return [Object]
|
|
193
|
+
attr_accessor :payment_instrument
|
|
194
|
+
|
|
195
|
+
# Authorization group ID that this transaction belongs to.
|
|
196
|
+
# @return [String]
|
|
197
|
+
attr_accessor :authorization_group_id
|
|
198
|
+
|
|
199
|
+
# Address Verification Status (AVS)
|
|
200
|
+
# <table>
|
|
201
|
+
# <thead>
|
|
202
|
+
# <tr>
|
|
203
|
+
# <th>AVS Status</th>
|
|
204
|
+
# <th>Description</th>
|
|
205
|
+
# </tr>
|
|
206
|
+
# </thead>
|
|
207
|
+
# <tbody>
|
|
208
|
+
# <tr>
|
|
209
|
+
# <td>MATCH</td>
|
|
210
|
+
# <td>Both address or postal code match</td>
|
|
211
|
+
# </tr>
|
|
212
|
+
# <tr>
|
|
213
|
+
# <td>PARTIAL_MATCH_POSTAL_CODE_ONLY</td>
|
|
214
|
+
# <td>postal code matches but address does not</td>
|
|
215
|
+
# </tr>
|
|
216
|
+
# <tr>
|
|
217
|
+
# <td>PARTIAL_MATCH_ADDRESS_ONLY</td>
|
|
218
|
+
# <td>address matches but postal code does not</td>
|
|
219
|
+
# </tr>
|
|
220
|
+
# <tr>
|
|
221
|
+
# <td>FAILURE</td>
|
|
222
|
+
# <td>neither address or postal code match</td>
|
|
223
|
+
# </tr>
|
|
224
|
+
# <tr>
|
|
225
|
+
# <td>UNAVAILABLE</td>
|
|
226
|
+
# <td>AVS is unavailable for card/country</td>
|
|
227
|
+
# </tr>
|
|
228
|
+
# </tbody>
|
|
229
|
+
# </table>
|
|
230
|
+
# @return [AddressVerificationStatus]
|
|
231
|
+
attr_accessor :address_verification_status
|
|
232
|
+
|
|
233
|
+
# Security Code Status
|
|
234
|
+
# <table>
|
|
235
|
+
# <thead>
|
|
236
|
+
# <tr>
|
|
237
|
+
# <th>Security Code Status</th>
|
|
238
|
+
# <th>Description</th>
|
|
239
|
+
# </tr>
|
|
240
|
+
# </thead>
|
|
241
|
+
# <tbody>
|
|
242
|
+
# <tr>
|
|
243
|
+
# <td>MATCH</td>
|
|
244
|
+
# <td>Provided Security Code matches expected value.</td>
|
|
245
|
+
# </tr>
|
|
246
|
+
# <tr>
|
|
247
|
+
# <td>NOT_PROVIDED</td>
|
|
248
|
+
# <td>Security Code not provided.</td>
|
|
249
|
+
# </tr>
|
|
250
|
+
# <tr>
|
|
251
|
+
# <td>FAILURE</td>
|
|
252
|
+
# <td>Security Code does not match expected value.</td>
|
|
253
|
+
# </tr>
|
|
254
|
+
# <tr>
|
|
255
|
+
# <td>UNAVAILABLE</td>
|
|
256
|
+
# <td>Security Code check not available.</td>
|
|
257
|
+
# </tr>
|
|
258
|
+
# </tbody>
|
|
259
|
+
# </table>
|
|
260
|
+
# @return [SecurityCodeMatchStatus]
|
|
261
|
+
attr_accessor :security_code_status
|
|
262
|
+
|
|
263
|
+
# List of assessments on if the transaction is considered acceptable or not.
|
|
264
|
+
# @return [Array[FraudAssessment]]
|
|
265
|
+
attr_accessor :fraud_assessments
|
|
266
|
+
|
|
267
|
+
# The action to be taken on the transaction.
|
|
268
|
+
# @return [Object]
|
|
269
|
+
attr_accessor :action
|
|
270
|
+
|
|
271
|
+
# A mapping from model property names to API property names.
|
|
272
|
+
def self.names
|
|
273
|
+
@_hash = {} if @_hash.nil?
|
|
274
|
+
@_hash['id'] = 'id'
|
|
275
|
+
@_hash['order_id'] = 'orderId'
|
|
276
|
+
@_hash['type'] = 'type'
|
|
277
|
+
@_hash['failure'] = 'failure'
|
|
278
|
+
@_hash['created_at'] = 'createdAt'
|
|
279
|
+
@_hash['payment_processor'] = 'paymentProcessor'
|
|
280
|
+
@_hash['status'] = 'status'
|
|
281
|
+
@_hash['authorized_at'] = 'authorizedAt'
|
|
282
|
+
@_hash['captured_at'] = 'capturedAt'
|
|
283
|
+
@_hash['canceled_at'] = 'canceledAt'
|
|
284
|
+
@_hash['refunds'] = 'refunds'
|
|
285
|
+
@_hash['has_failed_over'] = 'hasFailedOver'
|
|
286
|
+
@_hash['failovers'] = 'failovers'
|
|
287
|
+
@_hash['pending_authorize_amount'] = 'pendingAuthorizeAmount'
|
|
288
|
+
@_hash['authorized_amount'] = 'authorizedAmount'
|
|
289
|
+
@_hash['pending_capture_amount'] = 'pendingCaptureAmount'
|
|
290
|
+
@_hash['captured_amount'] = 'capturedAmount'
|
|
291
|
+
@_hash['refunded_amount'] = 'refundedAmount'
|
|
292
|
+
@_hash['pending_cancel_amount'] = 'pendingCancelAmount'
|
|
293
|
+
@_hash['canceled_amount'] = 'canceledAmount'
|
|
294
|
+
@_hash['processing_fee'] = 'processingFee'
|
|
295
|
+
@_hash['payment_instrument'] = 'paymentInstrument'
|
|
296
|
+
@_hash['authorization_group_id'] = 'authorizationGroupId'
|
|
297
|
+
@_hash['address_verification_status'] = 'addressVerificationStatus'
|
|
298
|
+
@_hash['security_code_status'] = 'securityCodeStatus'
|
|
299
|
+
@_hash['fraud_assessments'] = 'fraudAssessments'
|
|
300
|
+
@_hash['action'] = 'action'
|
|
301
|
+
@_hash
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# An array for optional fields
|
|
305
|
+
def self.optionals
|
|
306
|
+
%w[
|
|
307
|
+
order_id
|
|
308
|
+
failure
|
|
309
|
+
created_at
|
|
310
|
+
payment_processor
|
|
311
|
+
authorized_at
|
|
312
|
+
captured_at
|
|
313
|
+
canceled_at
|
|
314
|
+
refunds
|
|
315
|
+
has_failed_over
|
|
316
|
+
failovers
|
|
317
|
+
pending_authorize_amount
|
|
318
|
+
authorized_amount
|
|
319
|
+
pending_capture_amount
|
|
320
|
+
captured_amount
|
|
321
|
+
refunded_amount
|
|
322
|
+
pending_cancel_amount
|
|
323
|
+
canceled_amount
|
|
324
|
+
processing_fee
|
|
325
|
+
authorization_group_id
|
|
326
|
+
address_verification_status
|
|
327
|
+
security_code_status
|
|
328
|
+
fraud_assessments
|
|
329
|
+
action
|
|
330
|
+
]
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# An array for nullable fields
|
|
334
|
+
def self.nullables
|
|
335
|
+
[]
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
def initialize(id:, type:, status:, payment_instrument:, order_id: SKIP,
|
|
339
|
+
failure: SKIP, created_at: SKIP, payment_processor: SKIP,
|
|
340
|
+
authorized_at: SKIP, captured_at: SKIP, canceled_at: SKIP,
|
|
341
|
+
refunds: SKIP, has_failed_over: SKIP, failovers: SKIP,
|
|
342
|
+
pending_authorize_amount: SKIP, authorized_amount: SKIP,
|
|
343
|
+
pending_capture_amount: SKIP, captured_amount: SKIP,
|
|
344
|
+
refunded_amount: SKIP, pending_cancel_amount: SKIP,
|
|
345
|
+
canceled_amount: SKIP, processing_fee: SKIP,
|
|
346
|
+
authorization_group_id: SKIP,
|
|
347
|
+
address_verification_status: SKIP,
|
|
348
|
+
security_code_status: SKIP, fraud_assessments: SKIP,
|
|
349
|
+
action: SKIP, additional_properties: nil)
|
|
350
|
+
# Add additional model properties to the instance
|
|
351
|
+
additional_properties = {} if additional_properties.nil?
|
|
352
|
+
|
|
353
|
+
@id = id
|
|
354
|
+
@order_id = order_id unless order_id == SKIP
|
|
355
|
+
@type = type
|
|
356
|
+
@failure = failure unless failure == SKIP
|
|
357
|
+
@created_at = created_at unless created_at == SKIP
|
|
358
|
+
@payment_processor = payment_processor unless payment_processor == SKIP
|
|
359
|
+
@status = status
|
|
360
|
+
@authorized_at = authorized_at unless authorized_at == SKIP
|
|
361
|
+
@captured_at = captured_at unless captured_at == SKIP
|
|
362
|
+
@canceled_at = canceled_at unless canceled_at == SKIP
|
|
363
|
+
@refunds = refunds unless refunds == SKIP
|
|
364
|
+
@has_failed_over = has_failed_over unless has_failed_over == SKIP
|
|
365
|
+
@failovers = failovers unless failovers == SKIP
|
|
366
|
+
@pending_authorize_amount = pending_authorize_amount unless pending_authorize_amount == SKIP
|
|
367
|
+
@authorized_amount = authorized_amount unless authorized_amount == SKIP
|
|
368
|
+
@pending_capture_amount = pending_capture_amount unless pending_capture_amount == SKIP
|
|
369
|
+
@captured_amount = captured_amount unless captured_amount == SKIP
|
|
370
|
+
@refunded_amount = refunded_amount unless refunded_amount == SKIP
|
|
371
|
+
@pending_cancel_amount = pending_cancel_amount unless pending_cancel_amount == SKIP
|
|
372
|
+
@canceled_amount = canceled_amount unless canceled_amount == SKIP
|
|
373
|
+
@processing_fee = processing_fee unless processing_fee == SKIP
|
|
374
|
+
@payment_instrument = payment_instrument
|
|
375
|
+
@authorization_group_id = authorization_group_id unless authorization_group_id == SKIP
|
|
376
|
+
unless address_verification_status == SKIP
|
|
377
|
+
@address_verification_status =
|
|
378
|
+
address_verification_status
|
|
379
|
+
end
|
|
380
|
+
@security_code_status = security_code_status unless security_code_status == SKIP
|
|
381
|
+
@fraud_assessments = fraud_assessments unless fraud_assessments == SKIP
|
|
382
|
+
@action = action unless action == SKIP
|
|
383
|
+
@additional_properties = additional_properties
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
# Creates an instance of the object from a hash.
|
|
387
|
+
def self.from_hash(hash)
|
|
388
|
+
return nil unless hash
|
|
389
|
+
|
|
390
|
+
# Extract variables from the hash.
|
|
391
|
+
id = hash.key?('id') ? hash['id'] : nil
|
|
392
|
+
type = hash.key?('type') ? hash['type'] : nil
|
|
393
|
+
status = hash.key?('status') ? hash['status'] : nil
|
|
394
|
+
payment_instrument = hash.key?('paymentInstrument') ? APIHelper.deserialize_union_type(
|
|
395
|
+
UnionTypeLookUp.get(:PaymentInstrument), hash['paymentInstrument']
|
|
396
|
+
) : nil
|
|
397
|
+
order_id = hash.key?('orderId') ? hash['orderId'] : SKIP
|
|
398
|
+
failure = TransactionFailure.from_hash(hash['failure']) if hash['failure']
|
|
399
|
+
created_at = if hash.key?('createdAt')
|
|
400
|
+
(DateTimeHelper.from_rfc3339(hash['createdAt']) if hash['createdAt'])
|
|
401
|
+
else
|
|
402
|
+
SKIP
|
|
403
|
+
end
|
|
404
|
+
payment_processor = PaymentProcessor.from_hash(hash['paymentProcessor']) if
|
|
405
|
+
hash['paymentProcessor']
|
|
406
|
+
authorized_at = if hash.key?('authorizedAt')
|
|
407
|
+
(DateTimeHelper.from_rfc3339(hash['authorizedAt']) if hash['authorizedAt'])
|
|
408
|
+
else
|
|
409
|
+
SKIP
|
|
410
|
+
end
|
|
411
|
+
captured_at = if hash.key?('capturedAt')
|
|
412
|
+
(DateTimeHelper.from_rfc3339(hash['capturedAt']) if hash['capturedAt'])
|
|
413
|
+
else
|
|
414
|
+
SKIP
|
|
415
|
+
end
|
|
416
|
+
canceled_at = if hash.key?('canceledAt')
|
|
417
|
+
(DateTimeHelper.from_rfc3339(hash['canceledAt']) if hash['canceledAt'])
|
|
418
|
+
else
|
|
419
|
+
SKIP
|
|
420
|
+
end
|
|
421
|
+
# Parameter is an array, so we need to iterate through it
|
|
422
|
+
refunds = nil
|
|
423
|
+
unless hash['refunds'].nil?
|
|
424
|
+
refunds = []
|
|
425
|
+
hash['refunds'].each do |structure|
|
|
426
|
+
refunds << (RelatedRefund.from_hash(structure) if structure)
|
|
427
|
+
end
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
refunds = SKIP unless hash.key?('refunds')
|
|
431
|
+
has_failed_over =
|
|
432
|
+
hash.key?('hasFailedOver') ? hash['hasFailedOver'] : SKIP
|
|
433
|
+
# Parameter is an array, so we need to iterate through it
|
|
434
|
+
failovers = nil
|
|
435
|
+
unless hash['failovers'].nil?
|
|
436
|
+
failovers = []
|
|
437
|
+
hash['failovers'].each do |structure|
|
|
438
|
+
failovers << (Failover.from_hash(structure) if structure)
|
|
439
|
+
end
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
failovers = SKIP unless hash.key?('failovers')
|
|
443
|
+
if hash['pendingAuthorizeAmount']
|
|
444
|
+
pending_authorize_amount = PaymentTransactionPendingAuthorizeAmount.from_hash(hash['pendingAuthorizeAmount'])
|
|
445
|
+
end
|
|
446
|
+
authorized_amount = PaymentTransactionAuthorizedAmount.from_hash(hash['authorizedAmount']) if
|
|
447
|
+
hash['authorizedAmount']
|
|
448
|
+
if hash['pendingCaptureAmount']
|
|
449
|
+
pending_capture_amount = PaymentTransactionPendingCaptureAmount.from_hash(hash['pendingCaptureAmount'])
|
|
450
|
+
end
|
|
451
|
+
captured_amount = PaymentTransactionCapturedAmount.from_hash(hash['capturedAmount']) if
|
|
452
|
+
hash['capturedAmount']
|
|
453
|
+
refunded_amount = PaymentTransactionRefundedAmount.from_hash(hash['refundedAmount']) if
|
|
454
|
+
hash['refundedAmount']
|
|
455
|
+
if hash['pendingCancelAmount']
|
|
456
|
+
pending_cancel_amount = PaymentTransactionPendingCancelAmount.from_hash(hash['pendingCancelAmount'])
|
|
457
|
+
end
|
|
458
|
+
canceled_amount = PaymentTransactionCanceledAmount.from_hash(hash['canceledAmount']) if
|
|
459
|
+
hash['canceledAmount']
|
|
460
|
+
processing_fee = PaymentTransactionProcessingFee.from_hash(hash['processingFee']) if
|
|
461
|
+
hash['processingFee']
|
|
462
|
+
authorization_group_id =
|
|
463
|
+
hash.key?('authorizationGroupId') ? hash['authorizationGroupId'] : SKIP
|
|
464
|
+
address_verification_status =
|
|
465
|
+
hash.key?('addressVerificationStatus') ? hash['addressVerificationStatus'] : SKIP
|
|
466
|
+
security_code_status =
|
|
467
|
+
hash.key?('securityCodeStatus') ? hash['securityCodeStatus'] : SKIP
|
|
468
|
+
# Parameter is an array, so we need to iterate through it
|
|
469
|
+
fraud_assessments = nil
|
|
470
|
+
unless hash['fraudAssessments'].nil?
|
|
471
|
+
fraud_assessments = []
|
|
472
|
+
hash['fraudAssessments'].each do |structure|
|
|
473
|
+
fraud_assessments << (FraudAssessment.from_hash(structure) if structure)
|
|
474
|
+
end
|
|
475
|
+
end
|
|
476
|
+
|
|
477
|
+
fraud_assessments = SKIP unless hash.key?('fraudAssessments')
|
|
478
|
+
action = hash.key?('action') ? APIHelper.deserialize_union_type(
|
|
479
|
+
UnionTypeLookUp.get(:Action), hash['action']
|
|
480
|
+
) : SKIP
|
|
481
|
+
|
|
482
|
+
# Create a new hash for additional properties, removing known properties.
|
|
483
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
484
|
+
|
|
485
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
486
|
+
new_hash, proc { |value| value }
|
|
487
|
+
)
|
|
488
|
+
|
|
489
|
+
# Create object from extracted values.
|
|
490
|
+
PaymentTransaction.new(id: id,
|
|
491
|
+
type: type,
|
|
492
|
+
status: status,
|
|
493
|
+
payment_instrument: payment_instrument,
|
|
494
|
+
order_id: order_id,
|
|
495
|
+
failure: failure,
|
|
496
|
+
created_at: created_at,
|
|
497
|
+
payment_processor: payment_processor,
|
|
498
|
+
authorized_at: authorized_at,
|
|
499
|
+
captured_at: captured_at,
|
|
500
|
+
canceled_at: canceled_at,
|
|
501
|
+
refunds: refunds,
|
|
502
|
+
has_failed_over: has_failed_over,
|
|
503
|
+
failovers: failovers,
|
|
504
|
+
pending_authorize_amount: pending_authorize_amount,
|
|
505
|
+
authorized_amount: authorized_amount,
|
|
506
|
+
pending_capture_amount: pending_capture_amount,
|
|
507
|
+
captured_amount: captured_amount,
|
|
508
|
+
refunded_amount: refunded_amount,
|
|
509
|
+
pending_cancel_amount: pending_cancel_amount,
|
|
510
|
+
canceled_amount: canceled_amount,
|
|
511
|
+
processing_fee: processing_fee,
|
|
512
|
+
authorization_group_id: authorization_group_id,
|
|
513
|
+
address_verification_status: address_verification_status,
|
|
514
|
+
security_code_status: security_code_status,
|
|
515
|
+
fraud_assessments: fraud_assessments,
|
|
516
|
+
action: action,
|
|
517
|
+
additional_properties: additional_properties)
|
|
518
|
+
end
|
|
519
|
+
|
|
520
|
+
def to_custom_created_at
|
|
521
|
+
DateTimeHelper.to_rfc3339(created_at)
|
|
522
|
+
end
|
|
523
|
+
|
|
524
|
+
def to_custom_authorized_at
|
|
525
|
+
DateTimeHelper.to_rfc3339(authorized_at)
|
|
526
|
+
end
|
|
527
|
+
|
|
528
|
+
def to_custom_captured_at
|
|
529
|
+
DateTimeHelper.to_rfc3339(captured_at)
|
|
530
|
+
end
|
|
531
|
+
|
|
532
|
+
def to_custom_canceled_at
|
|
533
|
+
DateTimeHelper.to_rfc3339(canceled_at)
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
# Validates an instance of the object from a given value.
|
|
537
|
+
# @param [PaymentTransaction | Hash] The value against the validation is performed.
|
|
538
|
+
def self.validate(value)
|
|
539
|
+
if value.instance_of? self
|
|
540
|
+
return (
|
|
541
|
+
APIHelper.valid_type?(value.id,
|
|
542
|
+
->(val) { val.instance_of? String }) and
|
|
543
|
+
APIHelper.valid_type?(value.type,
|
|
544
|
+
->(val) { Type2.validate(val) }) and
|
|
545
|
+
APIHelper.valid_type?(value.status,
|
|
546
|
+
->(val) { PaymentStatus.validate(val) }) and
|
|
547
|
+
UnionTypeLookUp.get(:PaymentInstrument)
|
|
548
|
+
.validate(value.payment_instrument)
|
|
549
|
+
)
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
return false unless value.instance_of? Hash
|
|
553
|
+
|
|
554
|
+
(
|
|
555
|
+
APIHelper.valid_type?(value['id'],
|
|
556
|
+
->(val) { val.instance_of? String }) and
|
|
557
|
+
APIHelper.valid_type?(value['type'],
|
|
558
|
+
->(val) { Type2.validate(val) }) and
|
|
559
|
+
APIHelper.valid_type?(value['status'],
|
|
560
|
+
->(val) { PaymentStatus.validate(val) }) and
|
|
561
|
+
UnionTypeLookUp.get(:PaymentInstrument)
|
|
562
|
+
.validate(value['paymentInstrument'])
|
|
563
|
+
)
|
|
564
|
+
end
|
|
565
|
+
|
|
566
|
+
# Provides a human-readable string representation of the object.
|
|
567
|
+
def to_s
|
|
568
|
+
class_name = self.class.name.split('::').last
|
|
569
|
+
"<#{class_name} id: #{@id}, order_id: #{@order_id}, type: #{@type}, failure: #{@failure},"\
|
|
570
|
+
" created_at: #{@created_at}, payment_processor: #{@payment_processor}, status: #{@status},"\
|
|
571
|
+
" authorized_at: #{@authorized_at}, captured_at: #{@captured_at}, canceled_at:"\
|
|
572
|
+
" #{@canceled_at}, refunds: #{@refunds}, has_failed_over: #{@has_failed_over}, failovers:"\
|
|
573
|
+
" #{@failovers}, pending_authorize_amount: #{@pending_authorize_amount}, authorized_amount:"\
|
|
574
|
+
" #{@authorized_amount}, pending_capture_amount: #{@pending_capture_amount},"\
|
|
575
|
+
" captured_amount: #{@captured_amount}, refunded_amount: #{@refunded_amount},"\
|
|
576
|
+
" pending_cancel_amount: #{@pending_cancel_amount}, canceled_amount: #{@canceled_amount},"\
|
|
577
|
+
" processing_fee: #{@processing_fee}, payment_instrument: #{@payment_instrument},"\
|
|
578
|
+
" authorization_group_id: #{@authorization_group_id}, address_verification_status:"\
|
|
579
|
+
" #{@address_verification_status}, security_code_status: #{@security_code_status},"\
|
|
580
|
+
" fraud_assessments: #{@fraud_assessments}, action: #{@action}, additional_properties:"\
|
|
581
|
+
" #{@additional_properties}>"
|
|
582
|
+
end
|
|
583
|
+
|
|
584
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
585
|
+
def inspect
|
|
586
|
+
class_name = self.class.name.split('::').last
|
|
587
|
+
"<#{class_name} id: #{@id.inspect}, order_id: #{@order_id.inspect}, type: #{@type.inspect},"\
|
|
588
|
+
" failure: #{@failure.inspect}, created_at: #{@created_at.inspect}, payment_processor:"\
|
|
589
|
+
" #{@payment_processor.inspect}, status: #{@status.inspect}, authorized_at:"\
|
|
590
|
+
" #{@authorized_at.inspect}, captured_at: #{@captured_at.inspect}, canceled_at:"\
|
|
591
|
+
" #{@canceled_at.inspect}, refunds: #{@refunds.inspect}, has_failed_over:"\
|
|
592
|
+
" #{@has_failed_over.inspect}, failovers: #{@failovers.inspect}, pending_authorize_amount:"\
|
|
593
|
+
" #{@pending_authorize_amount.inspect}, authorized_amount: #{@authorized_amount.inspect},"\
|
|
594
|
+
" pending_capture_amount: #{@pending_capture_amount.inspect}, captured_amount:"\
|
|
595
|
+
" #{@captured_amount.inspect}, refunded_amount: #{@refunded_amount.inspect},"\
|
|
596
|
+
" pending_cancel_amount: #{@pending_cancel_amount.inspect}, canceled_amount:"\
|
|
597
|
+
" #{@canceled_amount.inspect}, processing_fee: #{@processing_fee.inspect},"\
|
|
598
|
+
" payment_instrument: #{@payment_instrument.inspect}, authorization_group_id:"\
|
|
599
|
+
" #{@authorization_group_id.inspect}, address_verification_status:"\
|
|
600
|
+
" #{@address_verification_status.inspect}, security_code_status:"\
|
|
601
|
+
" #{@security_code_status.inspect}, fraud_assessments: #{@fraud_assessments.inspect},"\
|
|
602
|
+
" action: #{@action.inspect}, additional_properties: #{@additional_properties}>"
|
|
603
|
+
end
|
|
604
|
+
end
|
|
605
|
+
end
|