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,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
|
+
# Setup Token Request where the `source` defines the type of instrument to be
|
8
|
+
# stored.
|
9
|
+
class SetupTokenRequest < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# Customer in merchant's or partner's system of records.
|
14
|
+
# @return [CustomerRequest]
|
15
|
+
attr_accessor :customer
|
16
|
+
|
17
|
+
# The payment method to vault with the instrument details.
|
18
|
+
# @return [SetupTokenRequestPaymentSource]
|
19
|
+
attr_accessor :payment_source
|
20
|
+
|
21
|
+
# A mapping from model property names to API property names.
|
22
|
+
def self.names
|
23
|
+
@_hash = {} if @_hash.nil?
|
24
|
+
@_hash['customer'] = 'customer'
|
25
|
+
@_hash['payment_source'] = 'payment_source'
|
26
|
+
@_hash
|
27
|
+
end
|
28
|
+
|
29
|
+
# An array for optional fields
|
30
|
+
def self.optionals
|
31
|
+
%w[
|
32
|
+
customer
|
33
|
+
]
|
34
|
+
end
|
35
|
+
|
36
|
+
# An array for nullable fields
|
37
|
+
def self.nullables
|
38
|
+
[]
|
39
|
+
end
|
40
|
+
|
41
|
+
def initialize(payment_source:, customer: SKIP)
|
42
|
+
@customer = customer unless customer == SKIP
|
43
|
+
@payment_source = payment_source
|
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
|
+
payment_source = SetupTokenRequestPaymentSource.from_hash(hash['payment_source']) if
|
52
|
+
hash['payment_source']
|
53
|
+
customer = CustomerRequest.from_hash(hash['customer']) if hash['customer']
|
54
|
+
|
55
|
+
# Create object from extracted values.
|
56
|
+
SetupTokenRequest.new(payment_source: payment_source,
|
57
|
+
customer: customer)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,141 @@
|
|
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 Resource representing a request to vault a Card.
|
8
|
+
class SetupTokenRequestCard < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The card holder's name as it appears on the card.
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :name
|
15
|
+
|
16
|
+
# The primary account number (PAN) for the payment card.
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :number
|
19
|
+
|
20
|
+
# The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date
|
21
|
+
# and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :expiry
|
24
|
+
|
25
|
+
# The three- or four-digit security code of the card. Also known as the CVV,
|
26
|
+
# CVC, CVN, CVE, or CID. This parameter cannot be present in the request
|
27
|
+
# when `payment_initiator=MERCHANT`.
|
28
|
+
# @return [String]
|
29
|
+
attr_accessor :security_code
|
30
|
+
|
31
|
+
# The card network or brand. Applies to credit, debit, gift, and payment
|
32
|
+
# cards.
|
33
|
+
# @return [CardBrand]
|
34
|
+
attr_accessor :brand
|
35
|
+
|
36
|
+
# The portable international postal address. Maps to
|
37
|
+
# [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/
|
38
|
+
# wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls:
|
39
|
+
# the autocomplete
|
40
|
+
# attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-co
|
41
|
+
# ntrols-the-autocomplete-attribute).
|
42
|
+
# @return [Address]
|
43
|
+
attr_accessor :billing_address
|
44
|
+
|
45
|
+
# The verification method of the card.
|
46
|
+
# @return [String]
|
47
|
+
attr_accessor :verification_method
|
48
|
+
|
49
|
+
# Customizes the Vault creation flow experience for your customers.
|
50
|
+
# @return [SetupTokenCardExperienceContext]
|
51
|
+
attr_accessor :experience_context
|
52
|
+
|
53
|
+
# Customizes the Vault creation flow experience for your customers.
|
54
|
+
# @return [Object]
|
55
|
+
attr_accessor :network_transaction_reference
|
56
|
+
|
57
|
+
# A mapping from model property names to API property names.
|
58
|
+
def self.names
|
59
|
+
@_hash = {} if @_hash.nil?
|
60
|
+
@_hash['name'] = 'name'
|
61
|
+
@_hash['number'] = 'number'
|
62
|
+
@_hash['expiry'] = 'expiry'
|
63
|
+
@_hash['security_code'] = 'security_code'
|
64
|
+
@_hash['brand'] = 'brand'
|
65
|
+
@_hash['billing_address'] = 'billing_address'
|
66
|
+
@_hash['verification_method'] = 'verification_method'
|
67
|
+
@_hash['experience_context'] = 'experience_context'
|
68
|
+
@_hash['network_transaction_reference'] =
|
69
|
+
'network_transaction_reference'
|
70
|
+
@_hash
|
71
|
+
end
|
72
|
+
|
73
|
+
# An array for optional fields
|
74
|
+
def self.optionals
|
75
|
+
%w[
|
76
|
+
name
|
77
|
+
number
|
78
|
+
expiry
|
79
|
+
security_code
|
80
|
+
brand
|
81
|
+
billing_address
|
82
|
+
verification_method
|
83
|
+
experience_context
|
84
|
+
network_transaction_reference
|
85
|
+
]
|
86
|
+
end
|
87
|
+
|
88
|
+
# An array for nullable fields
|
89
|
+
def self.nullables
|
90
|
+
[]
|
91
|
+
end
|
92
|
+
|
93
|
+
def initialize(name: SKIP, number: SKIP, expiry: SKIP, security_code: SKIP,
|
94
|
+
brand: SKIP, billing_address: SKIP,
|
95
|
+
verification_method: SKIP, experience_context: SKIP,
|
96
|
+
network_transaction_reference: SKIP)
|
97
|
+
@name = name unless name == SKIP
|
98
|
+
@number = number unless number == SKIP
|
99
|
+
@expiry = expiry unless expiry == SKIP
|
100
|
+
@security_code = security_code unless security_code == SKIP
|
101
|
+
@brand = brand unless brand == SKIP
|
102
|
+
@billing_address = billing_address unless billing_address == SKIP
|
103
|
+
@verification_method = verification_method unless verification_method == SKIP
|
104
|
+
@experience_context = experience_context unless experience_context == SKIP
|
105
|
+
unless network_transaction_reference == SKIP
|
106
|
+
@network_transaction_reference =
|
107
|
+
network_transaction_reference
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
# Creates an instance of the object from a hash.
|
112
|
+
def self.from_hash(hash)
|
113
|
+
return nil unless hash
|
114
|
+
|
115
|
+
# Extract variables from the hash.
|
116
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
117
|
+
number = hash.key?('number') ? hash['number'] : SKIP
|
118
|
+
expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
|
119
|
+
security_code = hash.key?('security_code') ? hash['security_code'] : SKIP
|
120
|
+
brand = hash.key?('brand') ? hash['brand'] : SKIP
|
121
|
+
billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address']
|
122
|
+
verification_method =
|
123
|
+
hash.key?('verification_method') ? hash['verification_method'] : SKIP
|
124
|
+
experience_context = SetupTokenCardExperienceContext.from_hash(hash['experience_context']) if
|
125
|
+
hash['experience_context']
|
126
|
+
network_transaction_reference =
|
127
|
+
hash.key?('network_transaction_reference') ? hash['network_transaction_reference'] : SKIP
|
128
|
+
|
129
|
+
# Create object from extracted values.
|
130
|
+
SetupTokenRequestCard.new(name: name,
|
131
|
+
number: number,
|
132
|
+
expiry: expiry,
|
133
|
+
security_code: security_code,
|
134
|
+
brand: brand,
|
135
|
+
billing_address: billing_address,
|
136
|
+
verification_method: verification_method,
|
137
|
+
experience_context: experience_context,
|
138
|
+
network_transaction_reference: network_transaction_reference)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
@@ -0,0 +1,77 @@
|
|
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 payment method to vault with the instrument details.
|
8
|
+
class SetupTokenRequestPaymentSource < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# A Resource representing a request to vault a Card.
|
13
|
+
# @return [SetupTokenRequestCard]
|
14
|
+
attr_accessor :card
|
15
|
+
|
16
|
+
# A resource representing a request to vault PayPal Wallet.
|
17
|
+
# @return [VaultPayPalWalletRequest]
|
18
|
+
attr_accessor :paypal
|
19
|
+
|
20
|
+
# A resource representing a request to vault PayPal Wallet.
|
21
|
+
# @return [VaultVenmoRequest]
|
22
|
+
attr_accessor :venmo
|
23
|
+
|
24
|
+
# The Tokenized Payment Source representing a Request to Vault a Token.
|
25
|
+
# @return [VaultTokenRequest]
|
26
|
+
attr_accessor :token
|
27
|
+
|
28
|
+
# A mapping from model property names to API property names.
|
29
|
+
def self.names
|
30
|
+
@_hash = {} if @_hash.nil?
|
31
|
+
@_hash['card'] = 'card'
|
32
|
+
@_hash['paypal'] = 'paypal'
|
33
|
+
@_hash['venmo'] = 'venmo'
|
34
|
+
@_hash['token'] = 'token'
|
35
|
+
@_hash
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for optional fields
|
39
|
+
def self.optionals
|
40
|
+
%w[
|
41
|
+
card
|
42
|
+
paypal
|
43
|
+
venmo
|
44
|
+
token
|
45
|
+
]
|
46
|
+
end
|
47
|
+
|
48
|
+
# An array for nullable fields
|
49
|
+
def self.nullables
|
50
|
+
[]
|
51
|
+
end
|
52
|
+
|
53
|
+
def initialize(card: SKIP, paypal: SKIP, venmo: SKIP, token: SKIP)
|
54
|
+
@card = card unless card == SKIP
|
55
|
+
@paypal = paypal unless paypal == SKIP
|
56
|
+
@venmo = venmo unless venmo == SKIP
|
57
|
+
@token = token unless token == SKIP
|
58
|
+
end
|
59
|
+
|
60
|
+
# Creates an instance of the object from a hash.
|
61
|
+
def self.from_hash(hash)
|
62
|
+
return nil unless hash
|
63
|
+
|
64
|
+
# Extract variables from the hash.
|
65
|
+
card = SetupTokenRequestCard.from_hash(hash['card']) if hash['card']
|
66
|
+
paypal = VaultPayPalWalletRequest.from_hash(hash['paypal']) if hash['paypal']
|
67
|
+
venmo = VaultVenmoRequest.from_hash(hash['venmo']) if hash['venmo']
|
68
|
+
token = VaultTokenRequest.from_hash(hash['token']) if hash['token']
|
69
|
+
|
70
|
+
# Create object from extracted values.
|
71
|
+
SetupTokenRequestPaymentSource.new(card: card,
|
72
|
+
paypal: paypal,
|
73
|
+
venmo: venmo,
|
74
|
+
token: token)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# paypal_server_sdk
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaypalServerSdk
|
7
|
+
# Minimal representation of a cached setup token.
|
8
|
+
class SetupTokenResponse < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The PayPal-generated ID for the vault token.
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :id
|
15
|
+
|
16
|
+
# Ordinal number for sorting.
|
17
|
+
# @return [Integer]
|
18
|
+
attr_accessor :ordinal
|
19
|
+
|
20
|
+
# Customer in merchant's or partner's system of records.
|
21
|
+
# @return [CustomerRequest]
|
22
|
+
attr_accessor :customer
|
23
|
+
|
24
|
+
# The status of the payment token.
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :status
|
27
|
+
|
28
|
+
# The setup payment method details.
|
29
|
+
# @return [SetupTokenResponsePaymentSource]
|
30
|
+
attr_accessor :payment_source
|
31
|
+
|
32
|
+
# An array of related [HATEOAS links](/api/rest/responses/#hateoas).
|
33
|
+
# @return [Array[LinkDescription]]
|
34
|
+
attr_accessor :links
|
35
|
+
|
36
|
+
# A mapping from model property names to API property names.
|
37
|
+
def self.names
|
38
|
+
@_hash = {} if @_hash.nil?
|
39
|
+
@_hash['id'] = 'id'
|
40
|
+
@_hash['ordinal'] = 'ordinal'
|
41
|
+
@_hash['customer'] = 'customer'
|
42
|
+
@_hash['status'] = 'status'
|
43
|
+
@_hash['payment_source'] = 'payment_source'
|
44
|
+
@_hash['links'] = 'links'
|
45
|
+
@_hash
|
46
|
+
end
|
47
|
+
|
48
|
+
# An array for optional fields
|
49
|
+
def self.optionals
|
50
|
+
%w[
|
51
|
+
id
|
52
|
+
ordinal
|
53
|
+
customer
|
54
|
+
status
|
55
|
+
payment_source
|
56
|
+
links
|
57
|
+
]
|
58
|
+
end
|
59
|
+
|
60
|
+
# An array for nullable fields
|
61
|
+
def self.nullables
|
62
|
+
[]
|
63
|
+
end
|
64
|
+
|
65
|
+
def initialize(id: SKIP, ordinal: SKIP, customer: SKIP, status: 'CREATED',
|
66
|
+
payment_source: SKIP, links: SKIP)
|
67
|
+
@id = id unless id == SKIP
|
68
|
+
@ordinal = ordinal unless ordinal == SKIP
|
69
|
+
@customer = customer unless customer == SKIP
|
70
|
+
@status = status unless status == SKIP
|
71
|
+
@payment_source = payment_source unless payment_source == SKIP
|
72
|
+
@links = links unless links == SKIP
|
73
|
+
end
|
74
|
+
|
75
|
+
# Creates an instance of the object from a hash.
|
76
|
+
def self.from_hash(hash)
|
77
|
+
return nil unless hash
|
78
|
+
|
79
|
+
# Extract variables from the hash.
|
80
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
81
|
+
ordinal = hash.key?('ordinal') ? hash['ordinal'] : SKIP
|
82
|
+
customer = CustomerRequest.from_hash(hash['customer']) if hash['customer']
|
83
|
+
status = hash['status'] ||= 'CREATED'
|
84
|
+
payment_source = SetupTokenResponsePaymentSource.from_hash(hash['payment_source']) if
|
85
|
+
hash['payment_source']
|
86
|
+
# Parameter is an array, so we need to iterate through it
|
87
|
+
links = nil
|
88
|
+
unless hash['links'].nil?
|
89
|
+
links = []
|
90
|
+
hash['links'].each do |structure|
|
91
|
+
links << (LinkDescription.from_hash(structure) if structure)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
links = SKIP unless hash.key?('links')
|
96
|
+
|
97
|
+
# Create object from extracted values.
|
98
|
+
SetupTokenResponse.new(id: id,
|
99
|
+
ordinal: ordinal,
|
100
|
+
customer: customer,
|
101
|
+
status: status,
|
102
|
+
payment_source: payment_source,
|
103
|
+
links: links)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,156 @@
|
|
1
|
+
# paypal_server_sdk
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaypalServerSdk
|
7
|
+
# SetupTokenResponseCard Model.
|
8
|
+
class SetupTokenResponseCard < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The card holder's name as it appears on the card.
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :name
|
15
|
+
|
16
|
+
# The last digits of the payment card.
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :last_digits
|
19
|
+
|
20
|
+
# The card network or brand. Applies to credit, debit, gift, and payment
|
21
|
+
# cards.
|
22
|
+
# @return [CardBrand]
|
23
|
+
attr_accessor :brand
|
24
|
+
|
25
|
+
# The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date
|
26
|
+
# and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
|
27
|
+
# @return [String]
|
28
|
+
attr_accessor :expiry
|
29
|
+
|
30
|
+
# Address request details.
|
31
|
+
# @return [AddressDetails]
|
32
|
+
attr_accessor :billing_address
|
33
|
+
|
34
|
+
# Verification status of Card.
|
35
|
+
# @return [String]
|
36
|
+
attr_accessor :verification_status
|
37
|
+
|
38
|
+
# Card Verification details including the authorization details and 3D
|
39
|
+
# SECURE details.
|
40
|
+
# @return [CardVerificationDetails]
|
41
|
+
attr_accessor :verification
|
42
|
+
|
43
|
+
# Previous network transaction reference including id in response.
|
44
|
+
# @return [NetworkTransactionReferenceEntity]
|
45
|
+
attr_accessor :network_transaction_reference
|
46
|
+
|
47
|
+
# Results of Authentication such as 3D Secure.
|
48
|
+
# @return [CardAuthenticationResponse]
|
49
|
+
attr_accessor :authentication_result
|
50
|
+
|
51
|
+
# Bank Identification Number (BIN) details used to fund a payment.
|
52
|
+
# @return [BinDetails]
|
53
|
+
attr_accessor :bin_details
|
54
|
+
|
55
|
+
# Type of card. i.e Credit, Debit and so on.
|
56
|
+
# @return [CardType]
|
57
|
+
attr_accessor :type
|
58
|
+
|
59
|
+
# A mapping from model property names to API property names.
|
60
|
+
def self.names
|
61
|
+
@_hash = {} if @_hash.nil?
|
62
|
+
@_hash['name'] = 'name'
|
63
|
+
@_hash['last_digits'] = 'last_digits'
|
64
|
+
@_hash['brand'] = 'brand'
|
65
|
+
@_hash['expiry'] = 'expiry'
|
66
|
+
@_hash['billing_address'] = 'billing_address'
|
67
|
+
@_hash['verification_status'] = 'verification_status'
|
68
|
+
@_hash['verification'] = 'verification'
|
69
|
+
@_hash['network_transaction_reference'] =
|
70
|
+
'network_transaction_reference'
|
71
|
+
@_hash['authentication_result'] = 'authentication_result'
|
72
|
+
@_hash['bin_details'] = 'bin_details'
|
73
|
+
@_hash['type'] = 'type'
|
74
|
+
@_hash
|
75
|
+
end
|
76
|
+
|
77
|
+
# An array for optional fields
|
78
|
+
def self.optionals
|
79
|
+
%w[
|
80
|
+
name
|
81
|
+
last_digits
|
82
|
+
brand
|
83
|
+
expiry
|
84
|
+
billing_address
|
85
|
+
verification_status
|
86
|
+
verification
|
87
|
+
network_transaction_reference
|
88
|
+
authentication_result
|
89
|
+
bin_details
|
90
|
+
type
|
91
|
+
]
|
92
|
+
end
|
93
|
+
|
94
|
+
# An array for nullable fields
|
95
|
+
def self.nullables
|
96
|
+
[]
|
97
|
+
end
|
98
|
+
|
99
|
+
def initialize(name: SKIP, last_digits: SKIP, brand: SKIP, expiry: SKIP,
|
100
|
+
billing_address: SKIP, verification_status: SKIP,
|
101
|
+
verification: SKIP, network_transaction_reference: SKIP,
|
102
|
+
authentication_result: SKIP, bin_details: SKIP, type: SKIP)
|
103
|
+
@name = name unless name == SKIP
|
104
|
+
@last_digits = last_digits unless last_digits == SKIP
|
105
|
+
@brand = brand unless brand == SKIP
|
106
|
+
@expiry = expiry unless expiry == SKIP
|
107
|
+
@billing_address = billing_address unless billing_address == SKIP
|
108
|
+
@verification_status = verification_status unless verification_status == SKIP
|
109
|
+
@verification = verification unless verification == SKIP
|
110
|
+
unless network_transaction_reference == SKIP
|
111
|
+
@network_transaction_reference =
|
112
|
+
network_transaction_reference
|
113
|
+
end
|
114
|
+
@authentication_result = authentication_result unless authentication_result == SKIP
|
115
|
+
@bin_details = bin_details unless bin_details == SKIP
|
116
|
+
@type = type unless type == SKIP
|
117
|
+
end
|
118
|
+
|
119
|
+
# Creates an instance of the object from a hash.
|
120
|
+
def self.from_hash(hash)
|
121
|
+
return nil unless hash
|
122
|
+
|
123
|
+
# Extract variables from the hash.
|
124
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
125
|
+
last_digits = hash.key?('last_digits') ? hash['last_digits'] : SKIP
|
126
|
+
brand = hash.key?('brand') ? hash['brand'] : SKIP
|
127
|
+
expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
|
128
|
+
billing_address = AddressDetails.from_hash(hash['billing_address']) if
|
129
|
+
hash['billing_address']
|
130
|
+
verification_status =
|
131
|
+
hash.key?('verification_status') ? hash['verification_status'] : SKIP
|
132
|
+
verification = CardVerificationDetails.from_hash(hash['verification']) if
|
133
|
+
hash['verification']
|
134
|
+
if hash['network_transaction_reference']
|
135
|
+
network_transaction_reference = NetworkTransactionReferenceEntity.from_hash(hash['network_transaction_reference'])
|
136
|
+
end
|
137
|
+
authentication_result = CardAuthenticationResponse.from_hash(hash['authentication_result']) if
|
138
|
+
hash['authentication_result']
|
139
|
+
bin_details = BinDetails.from_hash(hash['bin_details']) if hash['bin_details']
|
140
|
+
type = hash.key?('type') ? hash['type'] : SKIP
|
141
|
+
|
142
|
+
# Create object from extracted values.
|
143
|
+
SetupTokenResponseCard.new(name: name,
|
144
|
+
last_digits: last_digits,
|
145
|
+
brand: brand,
|
146
|
+
expiry: expiry,
|
147
|
+
billing_address: billing_address,
|
148
|
+
verification_status: verification_status,
|
149
|
+
verification: verification,
|
150
|
+
network_transaction_reference: network_transaction_reference,
|
151
|
+
authentication_result: authentication_result,
|
152
|
+
bin_details: bin_details,
|
153
|
+
type: type)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
@@ -0,0 +1,68 @@
|
|
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 setup payment method details.
|
8
|
+
class SetupTokenResponsePaymentSource < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [SetupTokenResponseCard]
|
14
|
+
attr_accessor :card
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [PayPalPaymentToken]
|
18
|
+
attr_accessor :paypal
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [VenmoPaymentToken]
|
22
|
+
attr_accessor :venmo
|
23
|
+
|
24
|
+
# A mapping from model property names to API property names.
|
25
|
+
def self.names
|
26
|
+
@_hash = {} if @_hash.nil?
|
27
|
+
@_hash['card'] = 'card'
|
28
|
+
@_hash['paypal'] = 'paypal'
|
29
|
+
@_hash['venmo'] = 'venmo'
|
30
|
+
@_hash
|
31
|
+
end
|
32
|
+
|
33
|
+
# An array for optional fields
|
34
|
+
def self.optionals
|
35
|
+
%w[
|
36
|
+
card
|
37
|
+
paypal
|
38
|
+
venmo
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
# An array for nullable fields
|
43
|
+
def self.nullables
|
44
|
+
[]
|
45
|
+
end
|
46
|
+
|
47
|
+
def initialize(card: SKIP, paypal: SKIP, venmo: SKIP)
|
48
|
+
@card = card unless card == SKIP
|
49
|
+
@paypal = paypal unless paypal == SKIP
|
50
|
+
@venmo = venmo unless venmo == SKIP
|
51
|
+
end
|
52
|
+
|
53
|
+
# Creates an instance of the object from a hash.
|
54
|
+
def self.from_hash(hash)
|
55
|
+
return nil unless hash
|
56
|
+
|
57
|
+
# Extract variables from the hash.
|
58
|
+
card = SetupTokenResponseCard.from_hash(hash['card']) if hash['card']
|
59
|
+
paypal = PayPalPaymentToken.from_hash(hash['paypal']) if hash['paypal']
|
60
|
+
venmo = VenmoPaymentToken.from_hash(hash['venmo']) if hash['venmo']
|
61
|
+
|
62
|
+
# Create object from extracted values.
|
63
|
+
SetupTokenResponsePaymentSource.new(card: card,
|
64
|
+
paypal: paypal,
|
65
|
+
venmo: venmo)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|