paypal-server-sdk 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +35 -0
- data/README.md +112 -0
- data/lib/paypal_server_sdk/api_helper.rb +10 -0
- data/lib/paypal_server_sdk/client.rb +85 -0
- data/lib/paypal_server_sdk/configuration.rb +109 -0
- data/lib/paypal_server_sdk/controllers/base_controller.rb +71 -0
- data/lib/paypal_server_sdk/controllers/o_auth_authorization_controller.rb +42 -0
- data/lib/paypal_server_sdk/controllers/orders_controller.rb +517 -0
- data/lib/paypal_server_sdk/controllers/payments_controller.rb +404 -0
- data/lib/paypal_server_sdk/controllers/vault_controller.rb +224 -0
- data/lib/paypal_server_sdk/exceptions/api_exception.rb +10 -0
- data/lib/paypal_server_sdk/exceptions/error_exception.rb +71 -0
- data/lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb +48 -0
- data/lib/paypal_server_sdk/http/api_response.rb +21 -0
- data/lib/paypal_server_sdk/http/auth/o_auth2.rb +136 -0
- data/lib/paypal_server_sdk/http/http_call_back.rb +10 -0
- data/lib/paypal_server_sdk/http/http_method_enum.rb +10 -0
- data/lib/paypal_server_sdk/http/http_request.rb +10 -0
- data/lib/paypal_server_sdk/http/http_response.rb +10 -0
- data/lib/paypal_server_sdk/logging/configuration/api_logging_configuration.rb +114 -0
- data/lib/paypal_server_sdk/logging/sdk_logger.rb +17 -0
- data/lib/paypal_server_sdk/models/activity_timestamps.rb +68 -0
- data/lib/paypal_server_sdk/models/address.rb +116 -0
- data/lib/paypal_server_sdk/models/address_details.rb +160 -0
- data/lib/paypal_server_sdk/models/amount_breakdown.rb +115 -0
- data/lib/paypal_server_sdk/models/amount_with_breakdown.rb +80 -0
- data/lib/paypal_server_sdk/models/apple_pay_attributes.rb +60 -0
- data/lib/paypal_server_sdk/models/apple_pay_attributes_response.rb +50 -0
- data/lib/paypal_server_sdk/models/apple_pay_card.rb +94 -0
- data/lib/paypal_server_sdk/models/apple_pay_card_response.rb +167 -0
- data/lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb +95 -0
- data/lib/paypal_server_sdk/models/apple_pay_payment_data.rb +83 -0
- data/lib/paypal_server_sdk/models/apple_pay_payment_data_type.rb +24 -0
- data/lib/paypal_server_sdk/models/apple_pay_payment_object.rb +114 -0
- data/lib/paypal_server_sdk/models/apple_pay_payment_token.rb +51 -0
- data/lib/paypal_server_sdk/models/apple_pay_request.rb +137 -0
- data/lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb +113 -0
- data/lib/paypal_server_sdk/models/assurance_details.rb +68 -0
- data/lib/paypal_server_sdk/models/authentication_response.rb +61 -0
- data/lib/paypal_server_sdk/models/authorization.rb +192 -0
- data/lib/paypal_server_sdk/models/authorization_incomplete_reason.rb +23 -0
- data/lib/paypal_server_sdk/models/authorization_status.rb +35 -0
- data/lib/paypal_server_sdk/models/authorization_status_details.rb +50 -0
- data/lib/paypal_server_sdk/models/authorization_status_with_details.rb +60 -0
- data/lib/paypal_server_sdk/models/authorization_with_additional_data.rb +205 -0
- data/lib/paypal_server_sdk/models/avs_code.rb +90 -0
- data/lib/paypal_server_sdk/models/bancontact_payment_object.rb +95 -0
- data/lib/paypal_server_sdk/models/bancontact_payment_request.rb +73 -0
- data/lib/paypal_server_sdk/models/base_model.rb +62 -0
- data/lib/paypal_server_sdk/models/bin_details.rb +88 -0
- data/lib/paypal_server_sdk/models/blik_experience_context.rb +122 -0
- data/lib/paypal_server_sdk/models/blik_level0_payment_object.rb +48 -0
- data/lib/paypal_server_sdk/models/blik_one_click_payment_object.rb +52 -0
- data/lib/paypal_server_sdk/models/blik_one_click_payment_request.rb +82 -0
- data/lib/paypal_server_sdk/models/blik_payment_object.rb +86 -0
- data/lib/paypal_server_sdk/models/blik_payment_request.rb +105 -0
- data/lib/paypal_server_sdk/models/capture.rb +228 -0
- data/lib/paypal_server_sdk/models/capture_incomplete_reason.rb +55 -0
- data/lib/paypal_server_sdk/models/capture_payment_instruction.rb +89 -0
- data/lib/paypal_server_sdk/models/capture_request.rb +108 -0
- data/lib/paypal_server_sdk/models/capture_status.rb +35 -0
- data/lib/paypal_server_sdk/models/capture_status_details.rb +50 -0
- data/lib/paypal_server_sdk/models/capture_status_with_details.rb +60 -0
- data/lib/paypal_server_sdk/models/captured_payment.rb +248 -0
- data/lib/paypal_server_sdk/models/card_attributes.rb +70 -0
- data/lib/paypal_server_sdk/models/card_attributes_response.rb +50 -0
- data/lib/paypal_server_sdk/models/card_authentication_response.rb +51 -0
- data/lib/paypal_server_sdk/models/card_brand.rb +93 -0
- data/lib/paypal_server_sdk/models/card_customer_information.rb +85 -0
- data/lib/paypal_server_sdk/models/card_experience_context.rb +59 -0
- data/lib/paypal_server_sdk/models/card_from_request.rb +60 -0
- data/lib/paypal_server_sdk/models/card_payment_token.rb +166 -0
- data/lib/paypal_server_sdk/models/card_request.rb +176 -0
- data/lib/paypal_server_sdk/models/card_response.rb +139 -0
- data/lib/paypal_server_sdk/models/card_response_entity.rb +156 -0
- data/lib/paypal_server_sdk/models/card_stored_credential.rb +95 -0
- data/lib/paypal_server_sdk/models/card_supplementary_data.rb +71 -0
- data/lib/paypal_server_sdk/models/card_type.rb +32 -0
- data/lib/paypal_server_sdk/models/card_vault_response.rb +86 -0
- data/lib/paypal_server_sdk/models/card_verification.rb +51 -0
- data/lib/paypal_server_sdk/models/card_verification_details.rb +111 -0
- data/lib/paypal_server_sdk/models/card_verification_method.rb +29 -0
- data/lib/paypal_server_sdk/models/card_verification_processor_response.rb +62 -0
- data/lib/paypal_server_sdk/models/checkout_payment_intent.rb +24 -0
- data/lib/paypal_server_sdk/models/cobranded_card.rb +70 -0
- data/lib/paypal_server_sdk/models/confirm_order_request.rb +74 -0
- data/lib/paypal_server_sdk/models/customer_information.rb +72 -0
- data/lib/paypal_server_sdk/models/customer_request.rb +62 -0
- data/lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb +105 -0
- data/lib/paypal_server_sdk/models/cvv_code.rb +60 -0
- data/lib/paypal_server_sdk/models/disbursement_mode.rb +23 -0
- data/lib/paypal_server_sdk/models/dispute_category.rb +23 -0
- data/lib/paypal_server_sdk/models/eci_flag.rb +39 -0
- data/lib/paypal_server_sdk/models/enrollment_status.rb +29 -0
- data/lib/paypal_server_sdk/models/eps_payment_object.rb +74 -0
- data/lib/paypal_server_sdk/models/eps_payment_request.rb +73 -0
- data/lib/paypal_server_sdk/models/error_details.rb +110 -0
- data/lib/paypal_server_sdk/models/exchange_rate.rb +75 -0
- data/lib/paypal_server_sdk/models/experience_context.rb +98 -0
- data/lib/paypal_server_sdk/models/fullfillment_type.rb +31 -0
- data/lib/paypal_server_sdk/models/giropay_payment_object.rb +74 -0
- data/lib/paypal_server_sdk/models/giropay_payment_request.rb +73 -0
- data/lib/paypal_server_sdk/models/google_pay_authentication_method.rb +23 -0
- data/lib/paypal_server_sdk/models/google_pay_card_attributes.rb +51 -0
- data/lib/paypal_server_sdk/models/google_pay_card_response.rb +104 -0
- data/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb +105 -0
- data/lib/paypal_server_sdk/models/google_pay_payment_method.rb +20 -0
- data/lib/paypal_server_sdk/models/google_pay_request.rb +118 -0
- data/lib/paypal_server_sdk/models/google_pay_request_card.rb +84 -0
- data/lib/paypal_server_sdk/models/google_pay_wallet_response.rb +85 -0
- data/lib/paypal_server_sdk/models/ideal_payment_object.rb +85 -0
- data/lib/paypal_server_sdk/models/ideal_payment_request.rb +83 -0
- data/lib/paypal_server_sdk/models/item.rb +134 -0
- data/lib/paypal_server_sdk/models/item_category.rb +26 -0
- data/lib/paypal_server_sdk/models/level2_card_processing_data.rb +66 -0
- data/lib/paypal_server_sdk/models/level3_card_processing_data.rb +120 -0
- data/lib/paypal_server_sdk/models/liability_shift_indicator.rb +26 -0
- data/lib/paypal_server_sdk/models/line_item.rb +177 -0
- data/lib/paypal_server_sdk/models/link_description.rb +75 -0
- data/lib/paypal_server_sdk/models/link_http_method.rb +41 -0
- data/lib/paypal_server_sdk/models/money.rb +62 -0
- data/lib/paypal_server_sdk/models/my_bank_payment_object.rb +85 -0
- data/lib/paypal_server_sdk/models/my_bank_payment_request.rb +73 -0
- data/lib/paypal_server_sdk/models/name.rb +61 -0
- data/lib/paypal_server_sdk/models/net_amount_breakdown_item.rb +73 -0
- data/lib/paypal_server_sdk/models/network_token.rb +95 -0
- data/lib/paypal_server_sdk/models/network_transaction_reference.rb +90 -0
- data/lib/paypal_server_sdk/models/network_transaction_reference_entity.rb +88 -0
- data/lib/paypal_server_sdk/models/o_auth_provider_error.rb +45 -0
- data/lib/paypal_server_sdk/models/o_auth_token.rb +106 -0
- data/lib/paypal_server_sdk/models/order.rb +178 -0
- data/lib/paypal_server_sdk/models/order_application_context.rb +193 -0
- data/lib/paypal_server_sdk/models/order_application_context_landing_page.rb +32 -0
- data/lib/paypal_server_sdk/models/order_application_context_shipping_preference.rb +34 -0
- data/lib/paypal_server_sdk/models/order_application_context_user_action.rb +29 -0
- data/lib/paypal_server_sdk/models/order_authorize_request.rb +51 -0
- data/lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb +104 -0
- data/lib/paypal_server_sdk/models/order_authorize_response.rb +171 -0
- data/lib/paypal_server_sdk/models/order_authorize_response_payment_source.rb +88 -0
- data/lib/paypal_server_sdk/models/order_capture_request.rb +51 -0
- data/lib/paypal_server_sdk/models/order_capture_request_payment_source.rb +104 -0
- data/lib/paypal_server_sdk/models/order_confirm_application_context.rb +109 -0
- data/lib/paypal_server_sdk/models/order_request.rb +103 -0
- data/lib/paypal_server_sdk/models/order_status.rb +35 -0
- data/lib/paypal_server_sdk/models/order_tracker_item.rb +99 -0
- data/lib/paypal_server_sdk/models/order_tracker_request.rb +116 -0
- data/lib/paypal_server_sdk/models/order_tracker_response.rb +122 -0
- data/lib/paypal_server_sdk/models/order_tracker_status.rb +23 -0
- data/lib/paypal_server_sdk/models/p24_payment_object.rb +108 -0
- data/lib/paypal_server_sdk/models/p24_payment_request.rb +85 -0
- data/lib/paypal_server_sdk/models/pa_res_status.rb +42 -0
- data/lib/paypal_server_sdk/models/patch.rb +83 -0
- data/lib/paypal_server_sdk/models/patch_op.rb +35 -0
- data/lib/paypal_server_sdk/models/pay_pal_experience_landing_page.rb +26 -0
- data/lib/paypal_server_sdk/models/pay_pal_experience_user_action.rb +24 -0
- data/lib/paypal_server_sdk/models/pay_pal_payment_token.rb +180 -0
- data/lib/paypal_server_sdk/models/pay_pal_payment_token_customer_type.rb +25 -0
- data/lib/paypal_server_sdk/models/pay_pal_payment_token_usage_pattern.rb +35 -0
- data/lib/paypal_server_sdk/models/pay_pal_payment_token_usage_type.rb +23 -0
- data/lib/paypal_server_sdk/models/pay_pal_wallet.rb +158 -0
- data/lib/paypal_server_sdk/models/pay_pal_wallet_account_verification_status.rb +24 -0
- data/lib/paypal_server_sdk/models/pay_pal_wallet_attributes.rb +59 -0
- data/lib/paypal_server_sdk/models/pay_pal_wallet_attributes_response.rb +70 -0
- data/lib/paypal_server_sdk/models/pay_pal_wallet_customer.rb +85 -0
- data/lib/paypal_server_sdk/models/pay_pal_wallet_customer_request.rb +85 -0
- data/lib/paypal_server_sdk/models/pay_pal_wallet_experience_context.rb +140 -0
- data/lib/paypal_server_sdk/models/pay_pal_wallet_response.rb +166 -0
- data/lib/paypal_server_sdk/models/pay_pal_wallet_vault_instruction.rb +115 -0
- data/lib/paypal_server_sdk/models/pay_pal_wallet_vault_response.rb +86 -0
- data/lib/paypal_server_sdk/models/pay_pal_wallet_vault_status.rb +26 -0
- data/lib/paypal_server_sdk/models/payee.rb +65 -0
- data/lib/paypal_server_sdk/models/payee_base.rb +64 -0
- data/lib/paypal_server_sdk/models/payee_payment_method_preference.rb +23 -0
- data/lib/paypal_server_sdk/models/payer.rb +120 -0
- data/lib/paypal_server_sdk/models/payer_base.rb +64 -0
- data/lib/paypal_server_sdk/models/payment_advice_code.rb +30 -0
- data/lib/paypal_server_sdk/models/payment_authorization.rb +212 -0
- data/lib/paypal_server_sdk/models/payment_collection.rb +99 -0
- data/lib/paypal_server_sdk/models/payment_initiator.rb +23 -0
- data/lib/paypal_server_sdk/models/payment_instruction.rb +105 -0
- data/lib/paypal_server_sdk/models/payment_method_preference.rb +72 -0
- data/lib/paypal_server_sdk/models/payment_source.rb +187 -0
- data/lib/paypal_server_sdk/models/payment_source_response.rb +171 -0
- data/lib/paypal_server_sdk/models/payment_supplementary_data.rb +50 -0
- data/lib/paypal_server_sdk/models/payment_token_request.rb +60 -0
- data/lib/paypal_server_sdk/models/payment_token_request_card.rb +125 -0
- data/lib/paypal_server_sdk/models/payment_token_request_payment_source.rb +59 -0
- data/lib/paypal_server_sdk/models/payment_token_response.rb +87 -0
- data/lib/paypal_server_sdk/models/payment_token_response_payment_source.rb +87 -0
- data/lib/paypal_server_sdk/models/phone.rb +77 -0
- data/lib/paypal_server_sdk/models/phone_number.rb +54 -0
- data/lib/paypal_server_sdk/models/phone_number_with_country_code.rb +66 -0
- data/lib/paypal_server_sdk/models/phone_type.rb +32 -0
- data/lib/paypal_server_sdk/models/phone_with_type.rb +59 -0
- data/lib/paypal_server_sdk/models/platform_fee.rb +63 -0
- data/lib/paypal_server_sdk/models/processing_instruction.rb +23 -0
- data/lib/paypal_server_sdk/models/processor_response.rb +83 -0
- data/lib/paypal_server_sdk/models/processor_response_code.rb +479 -0
- data/lib/paypal_server_sdk/models/purchase_unit.rb +227 -0
- data/lib/paypal_server_sdk/models/purchase_unit_request.rb +193 -0
- data/lib/paypal_server_sdk/models/reauthorize_request.rb +62 -0
- data/lib/paypal_server_sdk/models/refund.rb +195 -0
- data/lib/paypal_server_sdk/models/refund_incomplete_reason.rb +20 -0
- data/lib/paypal_server_sdk/models/refund_payment_instruction.rb +68 -0
- data/lib/paypal_server_sdk/models/refund_platform_fee.rb +52 -0
- data/lib/paypal_server_sdk/models/refund_request.rb +100 -0
- data/lib/paypal_server_sdk/models/refund_status.rb +29 -0
- data/lib/paypal_server_sdk/models/refund_status_details.rb +50 -0
- data/lib/paypal_server_sdk/models/refund_status_with_details.rb +60 -0
- data/lib/paypal_server_sdk/models/related_identifiers.rb +69 -0
- data/lib/paypal_server_sdk/models/seller_payable_breakdown.rb +156 -0
- data/lib/paypal_server_sdk/models/seller_protection.rb +65 -0
- data/lib/paypal_server_sdk/models/seller_protection_status.rb +29 -0
- data/lib/paypal_server_sdk/models/seller_receivable_breakdown.rb +129 -0
- data/lib/paypal_server_sdk/models/setup_token_card_experience_context.rb +103 -0
- data/lib/paypal_server_sdk/models/setup_token_request.rb +60 -0
- data/lib/paypal_server_sdk/models/setup_token_request_card.rb +141 -0
- data/lib/paypal_server_sdk/models/setup_token_request_payment_source.rb +77 -0
- data/lib/paypal_server_sdk/models/setup_token_response.rb +106 -0
- data/lib/paypal_server_sdk/models/setup_token_response_card.rb +156 -0
- data/lib/paypal_server_sdk/models/setup_token_response_payment_source.rb +68 -0
- data/lib/paypal_server_sdk/models/shipment_carrier.rb +3852 -0
- data/lib/paypal_server_sdk/models/shipping_details.rb +106 -0
- data/lib/paypal_server_sdk/models/shipping_name.rb +50 -0
- data/lib/paypal_server_sdk/models/shipping_option.rb +94 -0
- data/lib/paypal_server_sdk/models/shipping_preference.rb +26 -0
- data/lib/paypal_server_sdk/models/shipping_type.rb +29 -0
- data/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb +124 -0
- data/lib/paypal_server_sdk/models/sofort_payment_object.rb +85 -0
- data/lib/paypal_server_sdk/models/sofort_payment_request.rb +73 -0
- data/lib/paypal_server_sdk/models/standard_entry_class_code.rb +36 -0
- data/lib/paypal_server_sdk/models/store_in_vault_instruction.rb +20 -0
- data/lib/paypal_server_sdk/models/stored_payment_source.rb +95 -0
- data/lib/paypal_server_sdk/models/stored_payment_source_payment_type.rb +26 -0
- data/lib/paypal_server_sdk/models/stored_payment_source_usage_type.rb +27 -0
- data/lib/paypal_server_sdk/models/supplementary_data.rb +58 -0
- data/lib/paypal_server_sdk/models/supplementary_purchase_data.rb +63 -0
- data/lib/paypal_server_sdk/models/tax_id_type.rb +23 -0
- data/lib/paypal_server_sdk/models/tax_info.rb +57 -0
- data/lib/paypal_server_sdk/models/three_d_secure_authentication_response.rb +62 -0
- data/lib/paypal_server_sdk/models/token.rb +56 -0
- data/lib/paypal_server_sdk/models/token_request_type.rb +23 -0
- data/lib/paypal_server_sdk/models/token_type.rb +20 -0
- data/lib/paypal_server_sdk/models/trustly_payment_object.rb +85 -0
- data/lib/paypal_server_sdk/models/trustly_payment_request.rb +73 -0
- data/lib/paypal_server_sdk/models/universal_product_code.rb +56 -0
- data/lib/paypal_server_sdk/models/upc_type.rb +38 -0
- data/lib/paypal_server_sdk/models/vault_customer.rb +50 -0
- data/lib/paypal_server_sdk/models/vault_experience_context.rb +112 -0
- data/lib/paypal_server_sdk/models/vault_instruction.rb +50 -0
- data/lib/paypal_server_sdk/models/vault_instruction_base.rb +52 -0
- data/lib/paypal_server_sdk/models/vault_pay_pal_wallet_request.rb +115 -0
- data/lib/paypal_server_sdk/models/vault_response.rb +86 -0
- data/lib/paypal_server_sdk/models/vault_status.rb +26 -0
- data/lib/paypal_server_sdk/models/vault_token_request.rb +56 -0
- data/lib/paypal_server_sdk/models/vault_venmo_experience_context.rb +73 -0
- data/lib/paypal_server_sdk/models/vault_venmo_request.rb +115 -0
- data/lib/paypal_server_sdk/models/vaulted_digital_wallet.rb +106 -0
- data/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb +75 -0
- data/lib/paypal_server_sdk/models/venmo_payment_token.rb +169 -0
- data/lib/paypal_server_sdk/models/venmo_payment_token_customer_type.rb +25 -0
- data/lib/paypal_server_sdk/models/venmo_payment_token_usage_pattern.rb +35 -0
- data/lib/paypal_server_sdk/models/venmo_payment_token_usage_type.rb +23 -0
- data/lib/paypal_server_sdk/models/venmo_wallet_additional_attributes.rb +60 -0
- data/lib/paypal_server_sdk/models/venmo_wallet_attributes_response.rb +50 -0
- data/lib/paypal_server_sdk/models/venmo_wallet_customer_information.rb +63 -0
- data/lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb +65 -0
- data/lib/paypal_server_sdk/models/venmo_wallet_request.rb +89 -0
- data/lib/paypal_server_sdk/models/venmo_wallet_response.rb +120 -0
- data/lib/paypal_server_sdk/models/venmo_wallet_vault_attributes.rb +114 -0
- data/lib/paypal_server_sdk/utilities/date_time_helper.rb +11 -0
- data/lib/paypal_server_sdk/utilities/file_wrapper.rb +16 -0
- data/lib/paypal_server_sdk.rb +306 -0
- metadata +357 -0
@@ -0,0 +1,228 @@
|
|
1
|
+
# paypal_server_sdk
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaypalServerSdk
|
7
|
+
# A captured payment.
|
8
|
+
class Capture < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The status of the captured payment.
|
13
|
+
# @return [CaptureStatus]
|
14
|
+
attr_accessor :status
|
15
|
+
|
16
|
+
# The details of the captured payment status.
|
17
|
+
# @return [CaptureStatusDetails]
|
18
|
+
attr_accessor :status_details
|
19
|
+
|
20
|
+
# The PayPal-generated ID for the captured payment.
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :id
|
23
|
+
|
24
|
+
# The currency and amount for a financial transaction, such as a balance or
|
25
|
+
# payment due.
|
26
|
+
# @return [Money]
|
27
|
+
attr_accessor :amount
|
28
|
+
|
29
|
+
# The API caller-provided external invoice number for this order. Appears in
|
30
|
+
# both the payer's transaction history and the emails that the payer
|
31
|
+
# receives.
|
32
|
+
# @return [String]
|
33
|
+
attr_accessor :invoice_id
|
34
|
+
|
35
|
+
# The API caller-provided external ID. Used to reconcile API
|
36
|
+
# caller-initiated transactions with PayPal transactions. Appears in
|
37
|
+
# transaction and settlement reports.
|
38
|
+
# @return [String]
|
39
|
+
attr_accessor :custom_id
|
40
|
+
|
41
|
+
# Reference values used by the card network to identify a transaction.
|
42
|
+
# @return [NetworkTransactionReference]
|
43
|
+
attr_accessor :network_transaction_reference
|
44
|
+
|
45
|
+
# The level of protection offered as defined by [PayPal Seller Protection
|
46
|
+
# for
|
47
|
+
# Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protectio
|
48
|
+
# n).
|
49
|
+
# @return [SellerProtection]
|
50
|
+
attr_accessor :seller_protection
|
51
|
+
|
52
|
+
# Indicates whether you can make additional captures against the authorized
|
53
|
+
# payment. Set to `true` if you do not intend to capture additional payments
|
54
|
+
# against the authorization. Set to `false` if you intend to capture
|
55
|
+
# additional payments against the authorization.
|
56
|
+
# @return [TrueClass | FalseClass]
|
57
|
+
attr_accessor :final_capture
|
58
|
+
|
59
|
+
# The detailed breakdown of the capture activity. This is not available for
|
60
|
+
# transactions that are in pending state.
|
61
|
+
# @return [SellerReceivableBreakdown]
|
62
|
+
attr_accessor :seller_receivable_breakdown
|
63
|
+
|
64
|
+
# The funds that are held on behalf of the merchant.
|
65
|
+
# @return [DisbursementMode]
|
66
|
+
attr_accessor :disbursement_mode
|
67
|
+
|
68
|
+
# An array of related [HATEOAS
|
69
|
+
# links](/docs/api/reference/api-responses/#hateoas-links).
|
70
|
+
# @return [Array[LinkDescription]]
|
71
|
+
attr_accessor :links
|
72
|
+
|
73
|
+
# The processor response information for payment requests, such as direct
|
74
|
+
# credit card transactions.
|
75
|
+
# @return [ProcessorResponse]
|
76
|
+
attr_accessor :processor_response
|
77
|
+
|
78
|
+
# The date and time, in [Internet date and time
|
79
|
+
# format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
|
80
|
+
# required while fractional seconds are
|
81
|
+
# optional.<blockquote><strong>Note:</strong> The regular expression
|
82
|
+
# provides guidance but does not reject all invalid dates.</blockquote>
|
83
|
+
# @return [String]
|
84
|
+
attr_accessor :create_time
|
85
|
+
|
86
|
+
# The date and time, in [Internet date and time
|
87
|
+
# format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
|
88
|
+
# required while fractional seconds are
|
89
|
+
# optional.<blockquote><strong>Note:</strong> The regular expression
|
90
|
+
# provides guidance but does not reject all invalid dates.</blockquote>
|
91
|
+
# @return [String]
|
92
|
+
attr_accessor :update_time
|
93
|
+
|
94
|
+
# A mapping from model property names to API property names.
|
95
|
+
def self.names
|
96
|
+
@_hash = {} if @_hash.nil?
|
97
|
+
@_hash['status'] = 'status'
|
98
|
+
@_hash['status_details'] = 'status_details'
|
99
|
+
@_hash['id'] = 'id'
|
100
|
+
@_hash['amount'] = 'amount'
|
101
|
+
@_hash['invoice_id'] = 'invoice_id'
|
102
|
+
@_hash['custom_id'] = 'custom_id'
|
103
|
+
@_hash['network_transaction_reference'] =
|
104
|
+
'network_transaction_reference'
|
105
|
+
@_hash['seller_protection'] = 'seller_protection'
|
106
|
+
@_hash['final_capture'] = 'final_capture'
|
107
|
+
@_hash['seller_receivable_breakdown'] = 'seller_receivable_breakdown'
|
108
|
+
@_hash['disbursement_mode'] = 'disbursement_mode'
|
109
|
+
@_hash['links'] = 'links'
|
110
|
+
@_hash['processor_response'] = 'processor_response'
|
111
|
+
@_hash['create_time'] = 'create_time'
|
112
|
+
@_hash['update_time'] = 'update_time'
|
113
|
+
@_hash
|
114
|
+
end
|
115
|
+
|
116
|
+
# An array for optional fields
|
117
|
+
def self.optionals
|
118
|
+
%w[
|
119
|
+
status
|
120
|
+
status_details
|
121
|
+
id
|
122
|
+
amount
|
123
|
+
invoice_id
|
124
|
+
custom_id
|
125
|
+
network_transaction_reference
|
126
|
+
seller_protection
|
127
|
+
final_capture
|
128
|
+
seller_receivable_breakdown
|
129
|
+
disbursement_mode
|
130
|
+
links
|
131
|
+
processor_response
|
132
|
+
create_time
|
133
|
+
update_time
|
134
|
+
]
|
135
|
+
end
|
136
|
+
|
137
|
+
# An array for nullable fields
|
138
|
+
def self.nullables
|
139
|
+
[]
|
140
|
+
end
|
141
|
+
|
142
|
+
def initialize(status: SKIP, status_details: SKIP, id: SKIP, amount: SKIP,
|
143
|
+
invoice_id: SKIP, custom_id: SKIP,
|
144
|
+
network_transaction_reference: SKIP, seller_protection: SKIP,
|
145
|
+
final_capture: false, seller_receivable_breakdown: SKIP,
|
146
|
+
disbursement_mode: DisbursementMode::INSTANT, links: SKIP,
|
147
|
+
processor_response: SKIP, create_time: SKIP,
|
148
|
+
update_time: SKIP)
|
149
|
+
@status = status unless status == SKIP
|
150
|
+
@status_details = status_details unless status_details == SKIP
|
151
|
+
@id = id unless id == SKIP
|
152
|
+
@amount = amount unless amount == SKIP
|
153
|
+
@invoice_id = invoice_id unless invoice_id == SKIP
|
154
|
+
@custom_id = custom_id unless custom_id == SKIP
|
155
|
+
unless network_transaction_reference == SKIP
|
156
|
+
@network_transaction_reference =
|
157
|
+
network_transaction_reference
|
158
|
+
end
|
159
|
+
@seller_protection = seller_protection unless seller_protection == SKIP
|
160
|
+
@final_capture = final_capture unless final_capture == SKIP
|
161
|
+
unless seller_receivable_breakdown == SKIP
|
162
|
+
@seller_receivable_breakdown =
|
163
|
+
seller_receivable_breakdown
|
164
|
+
end
|
165
|
+
@disbursement_mode = disbursement_mode unless disbursement_mode == SKIP
|
166
|
+
@links = links unless links == SKIP
|
167
|
+
@processor_response = processor_response unless processor_response == SKIP
|
168
|
+
@create_time = create_time unless create_time == SKIP
|
169
|
+
@update_time = update_time unless update_time == SKIP
|
170
|
+
end
|
171
|
+
|
172
|
+
# Creates an instance of the object from a hash.
|
173
|
+
def self.from_hash(hash)
|
174
|
+
return nil unless hash
|
175
|
+
|
176
|
+
# Extract variables from the hash.
|
177
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
178
|
+
status_details = CaptureStatusDetails.from_hash(hash['status_details']) if
|
179
|
+
hash['status_details']
|
180
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
181
|
+
amount = Money.from_hash(hash['amount']) if hash['amount']
|
182
|
+
invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP
|
183
|
+
custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP
|
184
|
+
if hash['network_transaction_reference']
|
185
|
+
network_transaction_reference = NetworkTransactionReference.from_hash(hash['network_transaction_reference'])
|
186
|
+
end
|
187
|
+
seller_protection = SellerProtection.from_hash(hash['seller_protection']) if
|
188
|
+
hash['seller_protection']
|
189
|
+
final_capture = hash['final_capture'] ||= false
|
190
|
+
if hash['seller_receivable_breakdown']
|
191
|
+
seller_receivable_breakdown = SellerReceivableBreakdown.from_hash(hash['seller_receivable_breakdown'])
|
192
|
+
end
|
193
|
+
disbursement_mode =
|
194
|
+
hash['disbursement_mode'] ||= DisbursementMode::INSTANT
|
195
|
+
# Parameter is an array, so we need to iterate through it
|
196
|
+
links = nil
|
197
|
+
unless hash['links'].nil?
|
198
|
+
links = []
|
199
|
+
hash['links'].each do |structure|
|
200
|
+
links << (LinkDescription.from_hash(structure) if structure)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
links = SKIP unless hash.key?('links')
|
205
|
+
processor_response = ProcessorResponse.from_hash(hash['processor_response']) if
|
206
|
+
hash['processor_response']
|
207
|
+
create_time = hash.key?('create_time') ? hash['create_time'] : SKIP
|
208
|
+
update_time = hash.key?('update_time') ? hash['update_time'] : SKIP
|
209
|
+
|
210
|
+
# Create object from extracted values.
|
211
|
+
Capture.new(status: status,
|
212
|
+
status_details: status_details,
|
213
|
+
id: id,
|
214
|
+
amount: amount,
|
215
|
+
invoice_id: invoice_id,
|
216
|
+
custom_id: custom_id,
|
217
|
+
network_transaction_reference: network_transaction_reference,
|
218
|
+
seller_protection: seller_protection,
|
219
|
+
final_capture: final_capture,
|
220
|
+
seller_receivable_breakdown: seller_receivable_breakdown,
|
221
|
+
disbursement_mode: disbursement_mode,
|
222
|
+
links: links,
|
223
|
+
processor_response: processor_response,
|
224
|
+
create_time: create_time,
|
225
|
+
update_time: update_time)
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# paypal_server_sdk
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaypalServerSdk
|
7
|
+
# The reason why the captured payment status is `PENDING` or `DENIED`.
|
8
|
+
class CaptureIncompleteReason
|
9
|
+
CAPTURE_INCOMPLETE_REASON = [
|
10
|
+
# TODO: Write general description for BUYER_COMPLAINT
|
11
|
+
BUYER_COMPLAINT = 'BUYER_COMPLAINT'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for CHARGEBACK
|
14
|
+
CHARGEBACK = 'CHARGEBACK'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for ECHECK
|
17
|
+
ECHECK = 'ECHECK'.freeze,
|
18
|
+
|
19
|
+
# TODO: Write general description for INTERNATIONAL_WITHDRAWAL
|
20
|
+
INTERNATIONAL_WITHDRAWAL = 'INTERNATIONAL_WITHDRAWAL'.freeze,
|
21
|
+
|
22
|
+
# TODO: Write general description for OTHER
|
23
|
+
OTHER = 'OTHER'.freeze,
|
24
|
+
|
25
|
+
# TODO: Write general description for PENDING_REVIEW
|
26
|
+
PENDING_REVIEW = 'PENDING_REVIEW'.freeze,
|
27
|
+
|
28
|
+
# TODO: Write general description for
|
29
|
+
# RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION
|
30
|
+
RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION = 'RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION'.freeze,
|
31
|
+
|
32
|
+
# TODO: Write general description for REFUNDED
|
33
|
+
REFUNDED = 'REFUNDED'.freeze,
|
34
|
+
|
35
|
+
# TODO: Write general description for
|
36
|
+
# TRANSACTION_APPROVED_AWAITING_FUNDING
|
37
|
+
TRANSACTION_APPROVED_AWAITING_FUNDING = 'TRANSACTION_APPROVED_AWAITING_FUNDING'.freeze,
|
38
|
+
|
39
|
+
# TODO: Write general description for UNILATERAL
|
40
|
+
UNILATERAL = 'UNILATERAL'.freeze,
|
41
|
+
|
42
|
+
# TODO: Write general description for VERIFICATION_REQUIRED
|
43
|
+
VERIFICATION_REQUIRED = 'VERIFICATION_REQUIRED'.freeze,
|
44
|
+
|
45
|
+
# TODO: Write general description for DECLINED_BY_RISK_FRAUD_FILTERS
|
46
|
+
DECLINED_BY_RISK_FRAUD_FILTERS = 'DECLINED_BY_RISK_FRAUD_FILTERS'.freeze
|
47
|
+
].freeze
|
48
|
+
|
49
|
+
def self.validate(value)
|
50
|
+
return false if value.nil?
|
51
|
+
|
52
|
+
true
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# paypal_server_sdk
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaypalServerSdk
|
7
|
+
# Any additional payment instructions to be consider during payment
|
8
|
+
# processing. This processing instruction is applicable for Capturing an order
|
9
|
+
# or Authorizing an Order.
|
10
|
+
class CapturePaymentInstruction < BaseModel
|
11
|
+
SKIP = Object.new
|
12
|
+
private_constant :SKIP
|
13
|
+
|
14
|
+
# An array of platform or partner fees, commissions, or brokerage fees that
|
15
|
+
# associated with the captured payment.
|
16
|
+
# @return [Array[PlatformFee]]
|
17
|
+
attr_accessor :platform_fees
|
18
|
+
|
19
|
+
# The funds that are held on behalf of the merchant.
|
20
|
+
# @return [DisbursementMode]
|
21
|
+
attr_accessor :disbursement_mode
|
22
|
+
|
23
|
+
# FX identifier generated returned by PayPal to be used for payment
|
24
|
+
# processing in order to honor FX rate (for eligible integrations) to be
|
25
|
+
# used when amount is settled/received into the payee account.
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :payee_receivable_fx_rate_id
|
28
|
+
|
29
|
+
# A mapping from model property names to API property names.
|
30
|
+
def self.names
|
31
|
+
@_hash = {} if @_hash.nil?
|
32
|
+
@_hash['platform_fees'] = 'platform_fees'
|
33
|
+
@_hash['disbursement_mode'] = 'disbursement_mode'
|
34
|
+
@_hash['payee_receivable_fx_rate_id'] = 'payee_receivable_fx_rate_id'
|
35
|
+
@_hash
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for optional fields
|
39
|
+
def self.optionals
|
40
|
+
%w[
|
41
|
+
platform_fees
|
42
|
+
disbursement_mode
|
43
|
+
payee_receivable_fx_rate_id
|
44
|
+
]
|
45
|
+
end
|
46
|
+
|
47
|
+
# An array for nullable fields
|
48
|
+
def self.nullables
|
49
|
+
[]
|
50
|
+
end
|
51
|
+
|
52
|
+
def initialize(platform_fees: SKIP,
|
53
|
+
disbursement_mode: DisbursementMode::INSTANT,
|
54
|
+
payee_receivable_fx_rate_id: SKIP)
|
55
|
+
@platform_fees = platform_fees unless platform_fees == SKIP
|
56
|
+
@disbursement_mode = disbursement_mode unless disbursement_mode == SKIP
|
57
|
+
unless payee_receivable_fx_rate_id == SKIP
|
58
|
+
@payee_receivable_fx_rate_id =
|
59
|
+
payee_receivable_fx_rate_id
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Creates an instance of the object from a hash.
|
64
|
+
def self.from_hash(hash)
|
65
|
+
return nil unless hash
|
66
|
+
|
67
|
+
# Extract variables from the hash.
|
68
|
+
# Parameter is an array, so we need to iterate through it
|
69
|
+
platform_fees = nil
|
70
|
+
unless hash['platform_fees'].nil?
|
71
|
+
platform_fees = []
|
72
|
+
hash['platform_fees'].each do |structure|
|
73
|
+
platform_fees << (PlatformFee.from_hash(structure) if structure)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
platform_fees = SKIP unless hash.key?('platform_fees')
|
78
|
+
disbursement_mode =
|
79
|
+
hash['disbursement_mode'] ||= DisbursementMode::INSTANT
|
80
|
+
payee_receivable_fx_rate_id =
|
81
|
+
hash.key?('payee_receivable_fx_rate_id') ? hash['payee_receivable_fx_rate_id'] : SKIP
|
82
|
+
|
83
|
+
# Create object from extracted values.
|
84
|
+
CapturePaymentInstruction.new(platform_fees: platform_fees,
|
85
|
+
disbursement_mode: disbursement_mode,
|
86
|
+
payee_receivable_fx_rate_id: payee_receivable_fx_rate_id)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# paypal_server_sdk
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaypalServerSdk
|
7
|
+
# CaptureRequest Model.
|
8
|
+
class CaptureRequest < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The API caller-provided external invoice number for this order. Appears in
|
13
|
+
# both the payer's transaction history and the emails that the payer
|
14
|
+
# receives.
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :invoice_id
|
17
|
+
|
18
|
+
# An informational note about this settlement. Appears in both the payer's
|
19
|
+
# transaction history and the emails that the payer receives.
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :note_to_payer
|
22
|
+
|
23
|
+
# The currency and amount for a financial transaction, such as a balance or
|
24
|
+
# payment due.
|
25
|
+
# @return [Money]
|
26
|
+
attr_accessor :amount
|
27
|
+
|
28
|
+
# Indicates whether you can make additional captures against the authorized
|
29
|
+
# payment. Set to `true` if you do not intend to capture additional payments
|
30
|
+
# against the authorization. Set to `false` if you intend to capture
|
31
|
+
# additional payments against the authorization.
|
32
|
+
# @return [TrueClass | FalseClass]
|
33
|
+
attr_accessor :final_capture
|
34
|
+
|
35
|
+
# Any additional payment instructions to be consider during payment
|
36
|
+
# processing. This processing instruction is applicable for Capturing an
|
37
|
+
# order or Authorizing an Order.
|
38
|
+
# @return [CapturePaymentInstruction]
|
39
|
+
attr_accessor :payment_instruction
|
40
|
+
|
41
|
+
# The payment descriptor on the payer's account statement.
|
42
|
+
# @return [String]
|
43
|
+
attr_accessor :soft_descriptor
|
44
|
+
|
45
|
+
# A mapping from model property names to API property names.
|
46
|
+
def self.names
|
47
|
+
@_hash = {} if @_hash.nil?
|
48
|
+
@_hash['invoice_id'] = 'invoice_id'
|
49
|
+
@_hash['note_to_payer'] = 'note_to_payer'
|
50
|
+
@_hash['amount'] = 'amount'
|
51
|
+
@_hash['final_capture'] = 'final_capture'
|
52
|
+
@_hash['payment_instruction'] = 'payment_instruction'
|
53
|
+
@_hash['soft_descriptor'] = 'soft_descriptor'
|
54
|
+
@_hash
|
55
|
+
end
|
56
|
+
|
57
|
+
# An array for optional fields
|
58
|
+
def self.optionals
|
59
|
+
%w[
|
60
|
+
invoice_id
|
61
|
+
note_to_payer
|
62
|
+
amount
|
63
|
+
final_capture
|
64
|
+
payment_instruction
|
65
|
+
soft_descriptor
|
66
|
+
]
|
67
|
+
end
|
68
|
+
|
69
|
+
# An array for nullable fields
|
70
|
+
def self.nullables
|
71
|
+
[]
|
72
|
+
end
|
73
|
+
|
74
|
+
def initialize(invoice_id: SKIP, note_to_payer: SKIP, amount: SKIP,
|
75
|
+
final_capture: false, payment_instruction: SKIP,
|
76
|
+
soft_descriptor: SKIP)
|
77
|
+
@invoice_id = invoice_id unless invoice_id == SKIP
|
78
|
+
@note_to_payer = note_to_payer unless note_to_payer == SKIP
|
79
|
+
@amount = amount unless amount == SKIP
|
80
|
+
@final_capture = final_capture unless final_capture == SKIP
|
81
|
+
@payment_instruction = payment_instruction unless payment_instruction == SKIP
|
82
|
+
@soft_descriptor = soft_descriptor unless soft_descriptor == SKIP
|
83
|
+
end
|
84
|
+
|
85
|
+
# Creates an instance of the object from a hash.
|
86
|
+
def self.from_hash(hash)
|
87
|
+
return nil unless hash
|
88
|
+
|
89
|
+
# Extract variables from the hash.
|
90
|
+
invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP
|
91
|
+
note_to_payer = hash.key?('note_to_payer') ? hash['note_to_payer'] : SKIP
|
92
|
+
amount = Money.from_hash(hash['amount']) if hash['amount']
|
93
|
+
final_capture = hash['final_capture'] ||= false
|
94
|
+
payment_instruction = CapturePaymentInstruction.from_hash(hash['payment_instruction']) if
|
95
|
+
hash['payment_instruction']
|
96
|
+
soft_descriptor =
|
97
|
+
hash.key?('soft_descriptor') ? hash['soft_descriptor'] : SKIP
|
98
|
+
|
99
|
+
# Create object from extracted values.
|
100
|
+
CaptureRequest.new(invoice_id: invoice_id,
|
101
|
+
note_to_payer: note_to_payer,
|
102
|
+
amount: amount,
|
103
|
+
final_capture: final_capture,
|
104
|
+
payment_instruction: payment_instruction,
|
105
|
+
soft_descriptor: soft_descriptor)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# paypal_server_sdk
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaypalServerSdk
|
7
|
+
# The status of the captured payment.
|
8
|
+
class CaptureStatus
|
9
|
+
CAPTURE_STATUS = [
|
10
|
+
# TODO: Write general description for COMPLETED
|
11
|
+
COMPLETED = 'COMPLETED'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for DECLINED
|
14
|
+
DECLINED = 'DECLINED'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for PARTIALLY_REFUNDED
|
17
|
+
PARTIALLY_REFUNDED = 'PARTIALLY_REFUNDED'.freeze,
|
18
|
+
|
19
|
+
# TODO: Write general description for PENDING
|
20
|
+
PENDING = 'PENDING'.freeze,
|
21
|
+
|
22
|
+
# TODO: Write general description for REFUNDED
|
23
|
+
REFUNDED = 'REFUNDED'.freeze,
|
24
|
+
|
25
|
+
# TODO: Write general description for FAILED
|
26
|
+
FAILED = 'FAILED'.freeze
|
27
|
+
].freeze
|
28
|
+
|
29
|
+
def self.validate(value)
|
30
|
+
return false if value.nil?
|
31
|
+
|
32
|
+
true
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# paypal_server_sdk
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaypalServerSdk
|
7
|
+
# The details of the captured payment status.
|
8
|
+
class CaptureStatusDetails < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The reason why the captured payment status is `PENDING` or `DENIED`.
|
13
|
+
# @return [CaptureIncompleteReason]
|
14
|
+
attr_accessor :reason
|
15
|
+
|
16
|
+
# A mapping from model property names to API property names.
|
17
|
+
def self.names
|
18
|
+
@_hash = {} if @_hash.nil?
|
19
|
+
@_hash['reason'] = 'reason'
|
20
|
+
@_hash
|
21
|
+
end
|
22
|
+
|
23
|
+
# An array for optional fields
|
24
|
+
def self.optionals
|
25
|
+
%w[
|
26
|
+
reason
|
27
|
+
]
|
28
|
+
end
|
29
|
+
|
30
|
+
# An array for nullable fields
|
31
|
+
def self.nullables
|
32
|
+
[]
|
33
|
+
end
|
34
|
+
|
35
|
+
def initialize(reason: SKIP)
|
36
|
+
@reason = reason unless reason == SKIP
|
37
|
+
end
|
38
|
+
|
39
|
+
# Creates an instance of the object from a hash.
|
40
|
+
def self.from_hash(hash)
|
41
|
+
return nil unless hash
|
42
|
+
|
43
|
+
# Extract variables from the hash.
|
44
|
+
reason = hash.key?('reason') ? hash['reason'] : SKIP
|
45
|
+
|
46
|
+
# Create object from extracted values.
|
47
|
+
CaptureStatusDetails.new(reason: reason)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# paypal_server_sdk
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaypalServerSdk
|
7
|
+
# The status and status details of a captured payment.
|
8
|
+
class CaptureStatusWithDetails < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The status of the captured payment.
|
13
|
+
# @return [CaptureStatus]
|
14
|
+
attr_accessor :status
|
15
|
+
|
16
|
+
# The details of the captured payment status.
|
17
|
+
# @return [CaptureStatusDetails]
|
18
|
+
attr_accessor :status_details
|
19
|
+
|
20
|
+
# A mapping from model property names to API property names.
|
21
|
+
def self.names
|
22
|
+
@_hash = {} if @_hash.nil?
|
23
|
+
@_hash['status'] = 'status'
|
24
|
+
@_hash['status_details'] = 'status_details'
|
25
|
+
@_hash
|
26
|
+
end
|
27
|
+
|
28
|
+
# An array for optional fields
|
29
|
+
def self.optionals
|
30
|
+
%w[
|
31
|
+
status
|
32
|
+
status_details
|
33
|
+
]
|
34
|
+
end
|
35
|
+
|
36
|
+
# An array for nullable fields
|
37
|
+
def self.nullables
|
38
|
+
[]
|
39
|
+
end
|
40
|
+
|
41
|
+
def initialize(status: SKIP, status_details: SKIP)
|
42
|
+
@status = status unless status == SKIP
|
43
|
+
@status_details = status_details unless status_details == SKIP
|
44
|
+
end
|
45
|
+
|
46
|
+
# Creates an instance of the object from a hash.
|
47
|
+
def self.from_hash(hash)
|
48
|
+
return nil unless hash
|
49
|
+
|
50
|
+
# Extract variables from the hash.
|
51
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
52
|
+
status_details = CaptureStatusDetails.from_hash(hash['status_details']) if
|
53
|
+
hash['status_details']
|
54
|
+
|
55
|
+
# Create object from extracted values.
|
56
|
+
CaptureStatusWithDetails.new(status: status,
|
57
|
+
status_details: status_details)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|