paypal-server-sdk 0.6.0 → 0.7.0
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 +4 -4
- data/LICENSE +34 -34
- data/README.md +19 -30
- data/lib/paypal_server_sdk/controllers/base_controller.rb +1 -1
- data/lib/paypal_server_sdk/controllers/orders_controller.rb +228 -234
- data/lib/paypal_server_sdk/controllers/payments_controller.rb +139 -91
- data/lib/paypal_server_sdk/controllers/vault_controller.rb +57 -57
- data/lib/paypal_server_sdk/exceptions/api_exception.rb +11 -0
- data/lib/paypal_server_sdk/exceptions/error_exception.rb +14 -0
- data/lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb +14 -0
- data/lib/paypal_server_sdk/models/activity_timestamps.rb +17 -6
- data/lib/paypal_server_sdk/models/address.rb +24 -9
- data/lib/paypal_server_sdk/models/amount_breakdown.rb +17 -0
- data/lib/paypal_server_sdk/models/amount_with_breakdown.rb +22 -9
- data/lib/paypal_server_sdk/models/apple_pay_attributes.rb +12 -0
- data/lib/paypal_server_sdk/models/apple_pay_attributes_response.rb +12 -0
- data/lib/paypal_server_sdk/models/apple_pay_card.rb +14 -0
- data/lib/paypal_server_sdk/models/apple_pay_card_response.rb +48 -6
- data/lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb +16 -0
- data/lib/paypal_server_sdk/models/apple_pay_payment_data.rb +14 -0
- data/lib/paypal_server_sdk/models/apple_pay_payment_data_type.rb +6 -2
- data/lib/paypal_server_sdk/models/apple_pay_payment_object.rb +43 -7
- data/lib/paypal_server_sdk/models/apple_pay_payment_token.rb +12 -0
- data/lib/paypal_server_sdk/models/apple_pay_request.rb +27 -13
- data/lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb +15 -0
- data/lib/paypal_server_sdk/models/assurance_details.rb +14 -0
- data/lib/paypal_server_sdk/models/authentication_response.rb +13 -0
- data/lib/paypal_server_sdk/models/authorization.rb +28 -9
- data/lib/paypal_server_sdk/models/authorization_incomplete_reason.rb +2 -2
- data/lib/paypal_server_sdk/models/authorization_status.rb +12 -6
- data/lib/paypal_server_sdk/models/authorization_status_details.rb +12 -0
- data/lib/paypal_server_sdk/models/authorization_status_with_details.rb +12 -0
- data/lib/paypal_server_sdk/models/authorization_with_additional_data.rb +29 -9
- data/lib/paypal_server_sdk/models/avs_code.rb +102 -71
- data/lib/paypal_server_sdk/models/bancontact_payment_object.rb +19 -5
- data/lib/paypal_server_sdk/models/bancontact_payment_request.rb +18 -5
- data/lib/paypal_server_sdk/models/base_model.rb +76 -28
- data/lib/paypal_server_sdk/models/billing_cycle.rb +129 -0
- data/lib/paypal_server_sdk/models/bin_details.rb +18 -5
- data/lib/paypal_server_sdk/models/blik_experience_context.rb +17 -0
- data/lib/paypal_server_sdk/models/blik_level0_payment_object.rb +12 -0
- data/lib/paypal_server_sdk/models/blik_one_click_payment_object.rb +12 -0
- data/lib/paypal_server_sdk/models/blik_one_click_payment_request.rb +15 -0
- data/lib/paypal_server_sdk/models/blik_payment_object.rb +22 -10
- data/lib/paypal_server_sdk/models/blik_payment_request.rb +24 -10
- data/lib/paypal_server_sdk/models/callback_configuration.rb +75 -0
- data/lib/paypal_server_sdk/models/callback_events.rb +27 -0
- data/lib/paypal_server_sdk/models/capture_incomplete_reason.rb +22 -14
- data/lib/paypal_server_sdk/models/capture_payment_instruction.rb +15 -0
- data/lib/paypal_server_sdk/models/capture_request.rb +17 -0
- data/lib/paypal_server_sdk/models/capture_status.rb +10 -6
- data/lib/paypal_server_sdk/models/capture_status_details.rb +12 -0
- data/lib/paypal_server_sdk/models/capture_status_with_details.rb +12 -0
- data/lib/paypal_server_sdk/models/captured_payment.rb +36 -10
- data/lib/paypal_server_sdk/models/card_attributes.rb +13 -0
- data/lib/paypal_server_sdk/models/card_attributes_response.rb +12 -0
- data/lib/paypal_server_sdk/models/card_authentication_response.rb +14 -2
- data/lib/paypal_server_sdk/models/card_brand.rb +29 -25
- data/lib/paypal_server_sdk/models/card_customer_information.rb +18 -5
- data/lib/paypal_server_sdk/models/card_experience_context.rb +12 -0
- data/lib/paypal_server_sdk/models/card_from_request.rb +12 -0
- data/lib/paypal_server_sdk/models/{card_response_entity.rb → card_payment_token_entity.rb} +37 -15
- data/lib/paypal_server_sdk/models/card_request.rb +32 -17
- data/lib/paypal_server_sdk/models/card_response.rb +43 -2
- data/lib/paypal_server_sdk/models/{address_details.rb → card_response_address.rb} +33 -57
- data/lib/paypal_server_sdk/models/card_stored_credential.rb +23 -7
- data/lib/paypal_server_sdk/models/card_supplementary_data.rb +13 -5
- data/lib/paypal_server_sdk/models/card_type.rb +5 -5
- data/lib/paypal_server_sdk/models/card_vault_response.rb +13 -0
- data/lib/paypal_server_sdk/models/card_verification.rb +16 -3
- data/lib/paypal_server_sdk/models/card_verification_details.rb +40 -11
- data/lib/paypal_server_sdk/models/card_verification_processor_response.rb +12 -0
- data/lib/paypal_server_sdk/models/card_verification_status.rb +23 -0
- data/lib/paypal_server_sdk/models/checkout_payment_intent.rb +10 -2
- data/lib/paypal_server_sdk/models/cobranded_card.rb +13 -0
- data/lib/paypal_server_sdk/models/confirm_order_request.rb +15 -15
- data/lib/paypal_server_sdk/models/{customer_request.rb → customer.rb} +18 -4
- data/lib/paypal_server_sdk/models/customer_information.rb +17 -5
- data/lib/paypal_server_sdk/models/customer_response.rb +76 -0
- data/lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb +21 -4
- data/lib/paypal_server_sdk/models/cvv_code.rb +35 -27
- data/lib/paypal_server_sdk/models/disbursement_mode.rb +5 -2
- data/lib/paypal_server_sdk/models/dispute_category.rb +2 -2
- data/lib/paypal_server_sdk/models/eci_flag.rb +6 -8
- data/lib/paypal_server_sdk/models/enrollment_status.rb +11 -8
- data/lib/paypal_server_sdk/models/eps_payment_object.rb +17 -5
- data/lib/paypal_server_sdk/models/eps_payment_request.rb +18 -5
- data/lib/paypal_server_sdk/models/error_details.rb +15 -0
- data/lib/paypal_server_sdk/models/exchange_rate.rb +14 -0
- data/lib/paypal_server_sdk/models/experience_context.rb +15 -0
- data/lib/paypal_server_sdk/models/fulfillment_type.rb +36 -0
- data/lib/paypal_server_sdk/models/giropay_payment_object.rb +17 -5
- data/lib/paypal_server_sdk/models/giropay_payment_request.rb +18 -5
- data/lib/paypal_server_sdk/models/google_pay_authentication_method.rb +8 -2
- data/lib/paypal_server_sdk/models/google_pay_card.rb +128 -0
- data/lib/paypal_server_sdk/models/google_pay_card_response.rb +16 -0
- data/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb +28 -2
- data/lib/paypal_server_sdk/models/google_pay_payment_method.rb +1 -1
- data/lib/paypal_server_sdk/models/google_pay_request.rb +22 -17
- data/lib/paypal_server_sdk/models/google_pay_request_card.rb +14 -0
- data/lib/paypal_server_sdk/models/google_pay_wallet_response.rb +18 -5
- data/lib/paypal_server_sdk/models/ideal_payment_object.rb +18 -5
- data/lib/paypal_server_sdk/models/ideal_payment_request.rb +18 -5
- data/lib/paypal_server_sdk/models/item.rb +17 -0
- data/lib/paypal_server_sdk/models/item_category.rb +6 -3
- data/lib/paypal_server_sdk/models/level2_card_processing_data.rb +12 -0
- data/lib/paypal_server_sdk/models/level3_card_processing_data.rb +17 -0
- data/lib/paypal_server_sdk/models/liability_shift_indicator.rb +3 -3
- data/lib/paypal_server_sdk/models/line_item.rb +21 -0
- data/lib/paypal_server_sdk/models/link_description.rb +12 -0
- data/lib/paypal_server_sdk/models/money.rb +16 -4
- data/lib/paypal_server_sdk/models/mybank_payment_object.rb +18 -5
- data/lib/paypal_server_sdk/models/mybank_payment_request.rb +18 -5
- data/lib/paypal_server_sdk/models/name.rb +12 -0
- data/lib/paypal_server_sdk/models/net_amount_breakdown_item.rb +14 -0
- data/lib/paypal_server_sdk/models/network_token.rb +15 -0
- data/lib/paypal_server_sdk/models/network_transaction_reference.rb +14 -0
- data/lib/paypal_server_sdk/models/network_transaction_reference_entity.rb +15 -3
- data/lib/paypal_server_sdk/models/one_time_charge.rb +118 -0
- data/lib/paypal_server_sdk/models/order.rb +28 -25
- data/lib/paypal_server_sdk/models/order_application_context.rb +40 -25
- data/lib/paypal_server_sdk/models/order_application_context_landing_page.rb +10 -3
- data/lib/paypal_server_sdk/models/order_application_context_shipping_preference.rb +14 -10
- data/lib/paypal_server_sdk/models/order_application_context_user_action.rb +11 -6
- data/lib/paypal_server_sdk/models/order_authorize_request.rb +12 -0
- data/lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb +20 -9
- data/lib/paypal_server_sdk/models/order_authorize_response.rb +26 -23
- data/lib/paypal_server_sdk/models/order_authorize_response_payment_source.rb +14 -0
- data/lib/paypal_server_sdk/models/order_capture_request.rb +12 -0
- data/lib/paypal_server_sdk/models/order_capture_request_payment_source.rb +20 -9
- data/lib/paypal_server_sdk/models/order_confirm_application_context.rb +21 -8
- data/lib/paypal_server_sdk/models/order_request.rb +18 -4
- data/lib/paypal_server_sdk/models/order_status.rb +19 -6
- data/lib/paypal_server_sdk/models/order_tracker_item.rb +15 -0
- data/lib/paypal_server_sdk/models/order_tracker_request.rb +22 -5
- data/lib/paypal_server_sdk/models/order_tracker_response.rb +19 -6
- data/lib/paypal_server_sdk/models/order_tracker_status.rb +5 -2
- data/lib/paypal_server_sdk/models/order_update_callback_error_response.rb +89 -0
- data/lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb +81 -0
- data/lib/paypal_server_sdk/models/order_update_callback_request.rb +111 -0
- data/lib/paypal_server_sdk/models/order_update_callback_response.rb +72 -0
- data/lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb +107 -0
- data/lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb +93 -0
- data/lib/paypal_server_sdk/models/{capture.rb → orders_capture.rb} +46 -22
- data/lib/paypal_server_sdk/models/orders_card_verification_method.rb +51 -0
- data/lib/paypal_server_sdk/models/p24_payment_object.rb +24 -10
- data/lib/paypal_server_sdk/models/p24_payment_request.rb +22 -10
- data/lib/paypal_server_sdk/models/pa_res_status.rb +16 -16
- data/lib/paypal_server_sdk/models/participant_metadata.rb +64 -0
- data/lib/paypal_server_sdk/models/patch.rb +20 -10
- data/lib/paypal_server_sdk/models/patch_op.rb +43 -6
- data/lib/paypal_server_sdk/models/payee_base.rb +17 -5
- data/lib/paypal_server_sdk/models/payee_payment_method_preference.rb +4 -2
- data/lib/paypal_server_sdk/models/payer.rb +20 -5
- data/lib/paypal_server_sdk/models/payer_base.rb +16 -5
- data/lib/paypal_server_sdk/models/payment_advice_code.rb +53 -8
- data/lib/paypal_server_sdk/models/payment_authorization.rb +32 -11
- data/lib/paypal_server_sdk/models/payment_collection.rb +16 -2
- data/lib/paypal_server_sdk/models/payment_initiator.rb +5 -2
- data/lib/paypal_server_sdk/models/payment_instruction.rb +16 -0
- data/lib/paypal_server_sdk/models/payment_method_preference.rb +14 -0
- data/lib/paypal_server_sdk/models/payment_source.rb +25 -9
- data/lib/paypal_server_sdk/models/payment_source_response.rb +19 -0
- data/lib/paypal_server_sdk/models/payment_supplementary_data.rb +12 -0
- data/lib/paypal_server_sdk/models/payment_token_request.rb +17 -3
- data/lib/paypal_server_sdk/models/payment_token_request_card.rb +17 -22
- data/lib/paypal_server_sdk/models/payment_token_request_payment_source.rb +12 -0
- data/lib/paypal_server_sdk/models/payment_token_response.rb +18 -3
- data/lib/paypal_server_sdk/models/payment_token_response_payment_source.rb +18 -14
- data/lib/paypal_server_sdk/models/payment_token_status.rb +36 -0
- data/lib/paypal_server_sdk/models/payments_capture.rb +252 -0
- data/lib/paypal_server_sdk/models/payments_payment_advice_code.rb +42 -0
- data/lib/paypal_server_sdk/models/payments_processor_response.rb +98 -0
- data/lib/paypal_server_sdk/models/paypal_experience_landing_page.rb +11 -3
- data/lib/paypal_server_sdk/models/paypal_experience_user_action.rb +9 -4
- data/lib/paypal_server_sdk/models/paypal_payment_token.rb +38 -8
- data/lib/paypal_server_sdk/models/paypal_payment_token_customer_type.rb +7 -3
- data/lib/paypal_server_sdk/models/paypal_payment_token_usage_type.rb +7 -3
- data/lib/paypal_server_sdk/models/paypal_wallet.rb +41 -11
- data/lib/paypal_server_sdk/models/paypal_wallet_account_verification_status.rb +6 -2
- data/lib/paypal_server_sdk/models/paypal_wallet_attributes.rb +12 -0
- data/lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb +12 -0
- data/lib/paypal_server_sdk/models/paypal_wallet_context_shipping_preference.rb +31 -0
- data/lib/paypal_server_sdk/models/paypal_wallet_customer.rb +18 -5
- data/lib/paypal_server_sdk/models/paypal_wallet_customer_request.rb +18 -5
- data/lib/paypal_server_sdk/models/paypal_wallet_experience_context.rb +45 -12
- data/lib/paypal_server_sdk/models/paypal_wallet_response.rb +39 -7
- data/lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb +98 -0
- data/lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb +18 -1
- data/lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb +13 -0
- data/lib/paypal_server_sdk/models/paypal_wallet_vault_status.rb +8 -3
- data/lib/paypal_server_sdk/models/phone.rb +14 -0
- data/lib/paypal_server_sdk/models/phone_number.rb +12 -0
- data/lib/paypal_server_sdk/models/phone_number_with_country_code.rb +15 -0
- data/lib/paypal_server_sdk/models/phone_with_type.rb +13 -0
- data/lib/paypal_server_sdk/models/plan.rb +102 -0
- data/lib/paypal_server_sdk/models/platform_fee.rb +12 -0
- data/lib/paypal_server_sdk/models/pricing_model.rb +28 -0
- data/lib/paypal_server_sdk/models/pricing_scheme.rb +84 -0
- data/lib/paypal_server_sdk/models/processor_response.rb +15 -0
- data/lib/paypal_server_sdk/models/processor_response_code.rb +312 -308
- data/lib/paypal_server_sdk/models/purchase_unit.rb +43 -25
- data/lib/paypal_server_sdk/models/purchase_unit_request.rb +36 -20
- data/lib/paypal_server_sdk/models/reauthorize_request.rb +19 -8
- data/lib/paypal_server_sdk/models/refund.rb +25 -6
- data/lib/paypal_server_sdk/models/refund_incomplete_reason.rb +2 -1
- data/lib/paypal_server_sdk/models/refund_payment_instruction.rb +12 -0
- data/lib/paypal_server_sdk/models/refund_platform_fee.rb +12 -0
- data/lib/paypal_server_sdk/models/refund_request.rb +17 -2
- data/lib/paypal_server_sdk/models/refund_status.rb +4 -4
- data/lib/paypal_server_sdk/models/refund_status_details.rb +12 -0
- data/lib/paypal_server_sdk/models/refund_status_with_details.rb +12 -0
- data/lib/paypal_server_sdk/models/related_identifiers.rb +14 -0
- data/lib/paypal_server_sdk/models/risk_supplementary_data.rb +63 -0
- data/lib/paypal_server_sdk/models/seller_payable_breakdown.rb +21 -0
- data/lib/paypal_server_sdk/models/seller_protection.rb +13 -0
- data/lib/paypal_server_sdk/models/seller_protection_status.rb +6 -3
- data/lib/paypal_server_sdk/models/seller_receivable_breakdown.rb +18 -0
- data/lib/paypal_server_sdk/models/setup_token_card_experience_context.rb +21 -5
- data/lib/paypal_server_sdk/models/setup_token_request.rb +17 -3
- data/lib/paypal_server_sdk/models/setup_token_request_card.rb +20 -18
- data/lib/paypal_server_sdk/models/setup_token_request_payment_source.rb +13 -0
- data/lib/paypal_server_sdk/models/setup_token_response.rb +23 -16
- data/lib/paypal_server_sdk/models/setup_token_response_card.rb +25 -3
- data/lib/paypal_server_sdk/models/setup_token_response_payment_source.rb +13 -0
- data/lib/paypal_server_sdk/models/shipment_carrier.rb +1594 -1295
- data/lib/paypal_server_sdk/models/shipping_details.rb +30 -3
- data/lib/paypal_server_sdk/models/shipping_name.rb +12 -0
- data/lib/paypal_server_sdk/models/shipping_option.rb +14 -0
- data/lib/paypal_server_sdk/models/shipping_options_purchase_unit.rb +102 -0
- data/lib/paypal_server_sdk/models/shipping_preference.rb +6 -3
- data/lib/paypal_server_sdk/models/shipping_type.rb +12 -4
- data/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb +31 -3
- data/lib/paypal_server_sdk/models/sofort_payment_object.rb +18 -5
- data/lib/paypal_server_sdk/models/sofort_payment_request.rb +18 -5
- data/lib/paypal_server_sdk/models/standard_entry_class_code.rb +12 -4
- data/lib/paypal_server_sdk/models/store_in_vault_instruction.rb +2 -1
- data/lib/paypal_server_sdk/models/stored_payment_source.rb +23 -7
- data/lib/paypal_server_sdk/models/stored_payment_source_payment_type.rb +6 -3
- data/lib/paypal_server_sdk/models/stored_payment_source_usage_type.rb +6 -3
- data/lib/paypal_server_sdk/models/supplementary_data.rb +25 -7
- data/lib/paypal_server_sdk/models/supplementary_purchase_data.rb +13 -0
- data/lib/paypal_server_sdk/models/tax_id_type.rb +2 -2
- data/lib/paypal_server_sdk/models/tax_info.rb +12 -0
- data/lib/paypal_server_sdk/models/tenure_type.rb +28 -0
- data/lib/paypal_server_sdk/models/three_d_secure_authentication_response.rb +14 -0
- data/lib/paypal_server_sdk/models/three_d_secure_card_authentication_response.rb +89 -0
- data/lib/paypal_server_sdk/models/token.rb +12 -0
- data/lib/paypal_server_sdk/models/token_type.rb +2 -1
- data/lib/paypal_server_sdk/models/trustly_payment_object.rb +31 -6
- data/lib/paypal_server_sdk/models/trustly_payment_request.rb +30 -6
- data/lib/paypal_server_sdk/models/universal_product_code.rb +12 -0
- data/lib/paypal_server_sdk/models/upc_type.rb +14 -14
- data/lib/paypal_server_sdk/models/usage_pattern.rb +72 -0
- data/lib/paypal_server_sdk/models/vault_card_verification_method.rb +39 -0
- data/lib/paypal_server_sdk/models/vault_customer.rb +12 -0
- data/lib/paypal_server_sdk/models/vault_experience_context.rb +26 -7
- data/lib/paypal_server_sdk/models/vault_instruction.rb +12 -0
- data/lib/paypal_server_sdk/models/vault_instruction_action.rb +26 -0
- data/lib/paypal_server_sdk/models/vault_instruction_base.rb +12 -0
- data/lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb +43 -4
- data/lib/paypal_server_sdk/models/vault_response.rb +13 -0
- data/lib/paypal_server_sdk/models/vault_response_customer.rb +86 -0
- data/lib/paypal_server_sdk/models/vault_status.rb +8 -3
- data/lib/paypal_server_sdk/models/vault_token_request.rb +13 -1
- data/lib/paypal_server_sdk/models/vault_token_request_type.rb +20 -0
- data/lib/paypal_server_sdk/models/vault_venmo_experience_context.rb +24 -6
- data/lib/paypal_server_sdk/models/vault_venmo_request.rb +31 -3
- data/lib/paypal_server_sdk/models/vaulted_digital_wallet.rb +29 -3
- data/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb +27 -2
- data/lib/paypal_server_sdk/models/venmo_payment_token.rb +37 -8
- data/lib/paypal_server_sdk/models/venmo_payment_token_customer_type.rb +4 -2
- data/lib/paypal_server_sdk/models/venmo_payment_token_usage_pattern.rb +12 -6
- data/lib/paypal_server_sdk/models/venmo_payment_token_usage_type.rb +5 -2
- data/lib/paypal_server_sdk/models/venmo_wallet_additional_attributes.rb +12 -0
- data/lib/paypal_server_sdk/models/venmo_wallet_attributes_response.rb +12 -0
- data/lib/paypal_server_sdk/models/venmo_wallet_customer_information.rb +16 -5
- data/lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb +34 -5
- data/lib/paypal_server_sdk/models/venmo_wallet_request.rb +21 -8
- data/lib/paypal_server_sdk/models/venmo_wallet_response.rb +21 -5
- data/lib/paypal_server_sdk/models/venmo_wallet_vault_attributes.rb +17 -0
- data/lib/paypal_server_sdk/utilities/file_wrapper.rb +14 -2
- data/lib/paypal_server_sdk.rb +183 -152
- metadata +42 -16
- data/lib/paypal_server_sdk/models/card_payment_token.rb +0 -166
- data/lib/paypal_server_sdk/models/card_verification_method.rb +0 -29
- data/lib/paypal_server_sdk/models/fullfillment_type.rb +0 -31
- data/lib/paypal_server_sdk/models/google_pay_card_attributes.rb +0 -51
- data/lib/paypal_server_sdk/models/payee.rb +0 -65
- data/lib/paypal_server_sdk/models/paypal_payment_token_usage_pattern.rb +0 -35
- data/lib/paypal_server_sdk/models/processing_instruction.rb +0 -23
- data/lib/paypal_server_sdk/models/token_request_type.rb +0 -23
@@ -167,5 +167,24 @@ module PaypalServerSdk
|
|
167
167
|
google_pay: google_pay,
|
168
168
|
venmo: venmo)
|
169
169
|
end
|
170
|
+
|
171
|
+
# Provides a human-readable string representation of the object.
|
172
|
+
def to_s
|
173
|
+
class_name = self.class.name.split('::').last
|
174
|
+
"<#{class_name} card: #{@card}, paypal: #{@paypal}, bancontact: #{@bancontact}, blik:"\
|
175
|
+
" #{@blik}, eps: #{@eps}, giropay: #{@giropay}, ideal: #{@ideal}, mybank: #{@mybank}, p24:"\
|
176
|
+
" #{@p24}, sofort: #{@sofort}, trustly: #{@trustly}, apple_pay: #{@apple_pay}, google_pay:"\
|
177
|
+
" #{@google_pay}, venmo: #{@venmo}>"
|
178
|
+
end
|
179
|
+
|
180
|
+
# Provides a debugging-friendly string with detailed object information.
|
181
|
+
def inspect
|
182
|
+
class_name = self.class.name.split('::').last
|
183
|
+
"<#{class_name} card: #{@card.inspect}, paypal: #{@paypal.inspect}, bancontact:"\
|
184
|
+
" #{@bancontact.inspect}, blik: #{@blik.inspect}, eps: #{@eps.inspect}, giropay:"\
|
185
|
+
" #{@giropay.inspect}, ideal: #{@ideal.inspect}, mybank: #{@mybank.inspect}, p24:"\
|
186
|
+
" #{@p24.inspect}, sofort: #{@sofort.inspect}, trustly: #{@trustly.inspect}, apple_pay:"\
|
187
|
+
" #{@apple_pay.inspect}, google_pay: #{@google_pay.inspect}, venmo: #{@venmo.inspect}>"
|
188
|
+
end
|
170
189
|
end
|
171
190
|
end
|
@@ -46,5 +46,17 @@ module PaypalServerSdk
|
|
46
46
|
# Create object from extracted values.
|
47
47
|
PaymentSupplementaryData.new(related_ids: related_ids)
|
48
48
|
end
|
49
|
+
|
50
|
+
# Provides a human-readable string representation of the object.
|
51
|
+
def to_s
|
52
|
+
class_name = self.class.name.split('::').last
|
53
|
+
"<#{class_name} related_ids: #{@related_ids}>"
|
54
|
+
end
|
55
|
+
|
56
|
+
# Provides a debugging-friendly string with detailed object information.
|
57
|
+
def inspect
|
58
|
+
class_name = self.class.name.split('::').last
|
59
|
+
"<#{class_name} related_ids: #{@related_ids.inspect}>"
|
60
|
+
end
|
49
61
|
end
|
50
62
|
end
|
@@ -10,8 +10,9 @@ module PaypalServerSdk
|
|
10
10
|
SKIP = Object.new
|
11
11
|
private_constant :SKIP
|
12
12
|
|
13
|
-
#
|
14
|
-
#
|
13
|
+
# This object defines a customer in your system. Use it to manage customer
|
14
|
+
# profiles, save payment methods and contact details.
|
15
|
+
# @return [Customer]
|
15
16
|
attr_accessor :customer
|
16
17
|
|
17
18
|
# The payment method to vault with the instrument details.
|
@@ -50,11 +51,24 @@ module PaypalServerSdk
|
|
50
51
|
# Extract variables from the hash.
|
51
52
|
payment_source = PaymentTokenRequestPaymentSource.from_hash(hash['payment_source']) if
|
52
53
|
hash['payment_source']
|
53
|
-
customer =
|
54
|
+
customer = Customer.from_hash(hash['customer']) if hash['customer']
|
54
55
|
|
55
56
|
# Create object from extracted values.
|
56
57
|
PaymentTokenRequest.new(payment_source: payment_source,
|
57
58
|
customer: customer)
|
58
59
|
end
|
60
|
+
|
61
|
+
# Provides a human-readable string representation of the object.
|
62
|
+
def to_s
|
63
|
+
class_name = self.class.name.split('::').last
|
64
|
+
"<#{class_name} customer: #{@customer}, payment_source: #{@payment_source}>"
|
65
|
+
end
|
66
|
+
|
67
|
+
# Provides a debugging-friendly string with detailed object information.
|
68
|
+
def inspect
|
69
|
+
class_name = self.class.name.split('::').last
|
70
|
+
"<#{class_name} customer: #{@customer.inspect}, payment_source:"\
|
71
|
+
" #{@payment_source.inspect}>"
|
72
|
+
end
|
59
73
|
end
|
60
74
|
end
|
@@ -42,15 +42,6 @@ module PaypalServerSdk
|
|
42
42
|
# @return [Address]
|
43
43
|
attr_accessor :billing_address
|
44
44
|
|
45
|
-
# The portable international postal address. Maps to
|
46
|
-
# [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/
|
47
|
-
# wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls:
|
48
|
-
# the autocomplete
|
49
|
-
# attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-co
|
50
|
-
# ntrols-the-autocomplete-attribute).
|
51
|
-
# @return [Object]
|
52
|
-
attr_accessor :network_transaction_reference
|
53
|
-
|
54
45
|
# A mapping from model property names to API property names.
|
55
46
|
def self.names
|
56
47
|
@_hash = {} if @_hash.nil?
|
@@ -60,8 +51,6 @@ module PaypalServerSdk
|
|
60
51
|
@_hash['security_code'] = 'security_code'
|
61
52
|
@_hash['brand'] = 'brand'
|
62
53
|
@_hash['billing_address'] = 'billing_address'
|
63
|
-
@_hash['network_transaction_reference'] =
|
64
|
-
'network_transaction_reference'
|
65
54
|
@_hash
|
66
55
|
end
|
67
56
|
|
@@ -74,7 +63,6 @@ module PaypalServerSdk
|
|
74
63
|
security_code
|
75
64
|
brand
|
76
65
|
billing_address
|
77
|
-
network_transaction_reference
|
78
66
|
]
|
79
67
|
end
|
80
68
|
|
@@ -84,18 +72,13 @@ module PaypalServerSdk
|
|
84
72
|
end
|
85
73
|
|
86
74
|
def initialize(name: SKIP, number: SKIP, expiry: SKIP, security_code: SKIP,
|
87
|
-
brand: SKIP, billing_address: SKIP
|
88
|
-
network_transaction_reference: SKIP)
|
75
|
+
brand: SKIP, billing_address: SKIP)
|
89
76
|
@name = name unless name == SKIP
|
90
77
|
@number = number unless number == SKIP
|
91
78
|
@expiry = expiry unless expiry == SKIP
|
92
79
|
@security_code = security_code unless security_code == SKIP
|
93
80
|
@brand = brand unless brand == SKIP
|
94
81
|
@billing_address = billing_address unless billing_address == SKIP
|
95
|
-
unless network_transaction_reference == SKIP
|
96
|
-
@network_transaction_reference =
|
97
|
-
network_transaction_reference
|
98
|
-
end
|
99
82
|
end
|
100
83
|
|
101
84
|
# Creates an instance of the object from a hash.
|
@@ -109,8 +92,6 @@ module PaypalServerSdk
|
|
109
92
|
security_code = hash.key?('security_code') ? hash['security_code'] : SKIP
|
110
93
|
brand = hash.key?('brand') ? hash['brand'] : SKIP
|
111
94
|
billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address']
|
112
|
-
network_transaction_reference =
|
113
|
-
hash.key?('network_transaction_reference') ? hash['network_transaction_reference'] : SKIP
|
114
95
|
|
115
96
|
# Create object from extracted values.
|
116
97
|
PaymentTokenRequestCard.new(name: name,
|
@@ -118,8 +99,22 @@ module PaypalServerSdk
|
|
118
99
|
expiry: expiry,
|
119
100
|
security_code: security_code,
|
120
101
|
brand: brand,
|
121
|
-
billing_address: billing_address
|
122
|
-
|
102
|
+
billing_address: billing_address)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Provides a human-readable string representation of the object.
|
106
|
+
def to_s
|
107
|
+
class_name = self.class.name.split('::').last
|
108
|
+
"<#{class_name} name: #{@name}, number: #{@number}, expiry: #{@expiry}, security_code:"\
|
109
|
+
" #{@security_code}, brand: #{@brand}, billing_address: #{@billing_address}>"
|
110
|
+
end
|
111
|
+
|
112
|
+
# Provides a debugging-friendly string with detailed object information.
|
113
|
+
def inspect
|
114
|
+
class_name = self.class.name.split('::').last
|
115
|
+
"<#{class_name} name: #{@name.inspect}, number: #{@number.inspect}, expiry:"\
|
116
|
+
" #{@expiry.inspect}, security_code: #{@security_code.inspect}, brand: #{@brand.inspect},"\
|
117
|
+
" billing_address: #{@billing_address.inspect}>"
|
123
118
|
end
|
124
119
|
end
|
125
120
|
end
|
@@ -55,5 +55,17 @@ module PaypalServerSdk
|
|
55
55
|
PaymentTokenRequestPaymentSource.new(card: card,
|
56
56
|
token: token)
|
57
57
|
end
|
58
|
+
|
59
|
+
# Provides a human-readable string representation of the object.
|
60
|
+
def to_s
|
61
|
+
class_name = self.class.name.split('::').last
|
62
|
+
"<#{class_name} card: #{@card}, token: #{@token}>"
|
63
|
+
end
|
64
|
+
|
65
|
+
# Provides a debugging-friendly string with detailed object information.
|
66
|
+
def inspect
|
67
|
+
class_name = self.class.name.split('::').last
|
68
|
+
"<#{class_name} card: #{@card.inspect}, token: #{@token.inspect}>"
|
69
|
+
end
|
58
70
|
end
|
59
71
|
end
|
@@ -13,8 +13,9 @@ module PaypalServerSdk
|
|
13
13
|
# @return [String]
|
14
14
|
attr_accessor :id
|
15
15
|
|
16
|
-
#
|
17
|
-
#
|
16
|
+
# This object defines a customer in your system. Use it to manage customer
|
17
|
+
# profiles, save payment methods and contact details.
|
18
|
+
# @return [CustomerResponse]
|
18
19
|
attr_accessor :customer
|
19
20
|
|
20
21
|
# The vaulted payment method details.
|
@@ -63,7 +64,7 @@ module PaypalServerSdk
|
|
63
64
|
|
64
65
|
# Extract variables from the hash.
|
65
66
|
id = hash.key?('id') ? hash['id'] : SKIP
|
66
|
-
customer =
|
67
|
+
customer = CustomerResponse.from_hash(hash['customer']) if hash['customer']
|
67
68
|
payment_source = PaymentTokenResponsePaymentSource.from_hash(hash['payment_source']) if
|
68
69
|
hash['payment_source']
|
69
70
|
# Parameter is an array, so we need to iterate through it
|
@@ -83,5 +84,19 @@ module PaypalServerSdk
|
|
83
84
|
payment_source: payment_source,
|
84
85
|
links: links)
|
85
86
|
end
|
87
|
+
|
88
|
+
# Provides a human-readable string representation of the object.
|
89
|
+
def to_s
|
90
|
+
class_name = self.class.name.split('::').last
|
91
|
+
"<#{class_name} id: #{@id}, customer: #{@customer}, payment_source: #{@payment_source},"\
|
92
|
+
" links: #{@links}>"
|
93
|
+
end
|
94
|
+
|
95
|
+
# Provides a debugging-friendly string with detailed object information.
|
96
|
+
def inspect
|
97
|
+
class_name = self.class.name.split('::').last
|
98
|
+
"<#{class_name} id: #{@id.inspect}, customer: #{@customer.inspect}, payment_source:"\
|
99
|
+
" #{@payment_source.inspect}, links: #{@links.inspect}>"
|
100
|
+
end
|
86
101
|
end
|
87
102
|
end
|
@@ -10,7 +10,7 @@ module PaypalServerSdk
|
|
10
10
|
private_constant :SKIP
|
11
11
|
|
12
12
|
# Full representation of a Card Payment Token including network token.
|
13
|
-
# @return [
|
13
|
+
# @return [CardPaymentTokenEntity]
|
14
14
|
attr_accessor :card
|
15
15
|
|
16
16
|
# Full representation of a Card Payment Token including network token.
|
@@ -25,10 +25,6 @@ module PaypalServerSdk
|
|
25
25
|
# @return [ApplePayPaymentToken]
|
26
26
|
attr_accessor :apple_pay
|
27
27
|
|
28
|
-
# Full representation of a Bank Payment Token.
|
29
|
-
# @return [Hash]
|
30
|
-
attr_accessor :bank
|
31
|
-
|
32
28
|
# A mapping from model property names to API property names.
|
33
29
|
def self.names
|
34
30
|
@_hash = {} if @_hash.nil?
|
@@ -36,7 +32,6 @@ module PaypalServerSdk
|
|
36
32
|
@_hash['paypal'] = 'paypal'
|
37
33
|
@_hash['venmo'] = 'venmo'
|
38
34
|
@_hash['apple_pay'] = 'apple_pay'
|
39
|
-
@_hash['bank'] = 'bank'
|
40
35
|
@_hash
|
41
36
|
end
|
42
37
|
|
@@ -47,7 +42,6 @@ module PaypalServerSdk
|
|
47
42
|
paypal
|
48
43
|
venmo
|
49
44
|
apple_pay
|
50
|
-
bank
|
51
45
|
]
|
52
46
|
end
|
53
47
|
|
@@ -56,13 +50,11 @@ module PaypalServerSdk
|
|
56
50
|
[]
|
57
51
|
end
|
58
52
|
|
59
|
-
def initialize(card: SKIP, paypal: SKIP, venmo: SKIP, apple_pay: SKIP
|
60
|
-
bank: SKIP)
|
53
|
+
def initialize(card: SKIP, paypal: SKIP, venmo: SKIP, apple_pay: SKIP)
|
61
54
|
@card = card unless card == SKIP
|
62
55
|
@paypal = paypal unless paypal == SKIP
|
63
56
|
@venmo = venmo unless venmo == SKIP
|
64
57
|
@apple_pay = apple_pay unless apple_pay == SKIP
|
65
|
-
@bank = bank unless bank == SKIP
|
66
58
|
end
|
67
59
|
|
68
60
|
# Creates an instance of the object from a hash.
|
@@ -70,18 +62,30 @@ module PaypalServerSdk
|
|
70
62
|
return nil unless hash
|
71
63
|
|
72
64
|
# Extract variables from the hash.
|
73
|
-
card =
|
65
|
+
card = CardPaymentTokenEntity.from_hash(hash['card']) if hash['card']
|
74
66
|
paypal = PaypalPaymentToken.from_hash(hash['paypal']) if hash['paypal']
|
75
67
|
venmo = VenmoPaymentToken.from_hash(hash['venmo']) if hash['venmo']
|
76
68
|
apple_pay = ApplePayPaymentToken.from_hash(hash['apple_pay']) if hash['apple_pay']
|
77
|
-
bank = hash.key?('bank') ? hash['bank'] : SKIP
|
78
69
|
|
79
70
|
# Create object from extracted values.
|
80
71
|
PaymentTokenResponsePaymentSource.new(card: card,
|
81
72
|
paypal: paypal,
|
82
73
|
venmo: venmo,
|
83
|
-
apple_pay: apple_pay
|
84
|
-
|
74
|
+
apple_pay: apple_pay)
|
75
|
+
end
|
76
|
+
|
77
|
+
# Provides a human-readable string representation of the object.
|
78
|
+
def to_s
|
79
|
+
class_name = self.class.name.split('::').last
|
80
|
+
"<#{class_name} card: #{@card}, paypal: #{@paypal}, venmo: #{@venmo}, apple_pay:"\
|
81
|
+
" #{@apple_pay}>"
|
82
|
+
end
|
83
|
+
|
84
|
+
# Provides a debugging-friendly string with detailed object information.
|
85
|
+
def inspect
|
86
|
+
class_name = self.class.name.split('::').last
|
87
|
+
"<#{class_name} card: #{@card.inspect}, paypal: #{@paypal.inspect}, venmo:"\
|
88
|
+
" #{@venmo.inspect}, apple_pay: #{@apple_pay.inspect}>"
|
85
89
|
end
|
86
90
|
end
|
87
91
|
end
|
@@ -0,0 +1,36 @@
|
|
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 payment token.
|
8
|
+
class PaymentTokenStatus
|
9
|
+
PAYMENT_TOKEN_STATUS = [
|
10
|
+
# A setup token is initialized with minimal information, more data must be
|
11
|
+
# added to the setup-token to be vaulted
|
12
|
+
CREATED = 'CREATED'.freeze,
|
13
|
+
|
14
|
+
# A contingecy on payer approval is required before the payment method can
|
15
|
+
# be saved.
|
16
|
+
PAYER_ACTION_REQUIRED = 'PAYER_ACTION_REQUIRED'.freeze,
|
17
|
+
|
18
|
+
# Setup token is ready to be vaulted. If a buyer approval contigency was
|
19
|
+
# returned, it is has been approved.
|
20
|
+
APPROVED = 'APPROVED'.freeze,
|
21
|
+
|
22
|
+
# The payment token has been vaulted.
|
23
|
+
VAULTED = 'VAULTED'.freeze,
|
24
|
+
|
25
|
+
# A vaulted payment method token has been tokenized for short term (one
|
26
|
+
# time) use.
|
27
|
+
TOKENIZED = 'TOKENIZED'.freeze
|
28
|
+
].freeze
|
29
|
+
|
30
|
+
def self.validate(value)
|
31
|
+
return false if value.nil?
|
32
|
+
|
33
|
+
true
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,252 @@
|
|
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 PaymentsCapture < 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 [PaymentsProcessorResponse]
|
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 optional. Note: The regular
|
81
|
+
# expression provides guidance but does not reject all invalid dates.
|
82
|
+
# @return [String]
|
83
|
+
attr_accessor :create_time
|
84
|
+
|
85
|
+
# The date and time, in [Internet date and time
|
86
|
+
# format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
|
87
|
+
# required while fractional seconds are optional. Note: The regular
|
88
|
+
# expression provides guidance but does not reject all invalid dates.
|
89
|
+
# @return [String]
|
90
|
+
attr_accessor :update_time
|
91
|
+
|
92
|
+
# A mapping from model property names to API property names.
|
93
|
+
def self.names
|
94
|
+
@_hash = {} if @_hash.nil?
|
95
|
+
@_hash['status'] = 'status'
|
96
|
+
@_hash['status_details'] = 'status_details'
|
97
|
+
@_hash['id'] = 'id'
|
98
|
+
@_hash['amount'] = 'amount'
|
99
|
+
@_hash['invoice_id'] = 'invoice_id'
|
100
|
+
@_hash['custom_id'] = 'custom_id'
|
101
|
+
@_hash['network_transaction_reference'] =
|
102
|
+
'network_transaction_reference'
|
103
|
+
@_hash['seller_protection'] = 'seller_protection'
|
104
|
+
@_hash['final_capture'] = 'final_capture'
|
105
|
+
@_hash['seller_receivable_breakdown'] = 'seller_receivable_breakdown'
|
106
|
+
@_hash['disbursement_mode'] = 'disbursement_mode'
|
107
|
+
@_hash['links'] = 'links'
|
108
|
+
@_hash['processor_response'] = 'processor_response'
|
109
|
+
@_hash['create_time'] = 'create_time'
|
110
|
+
@_hash['update_time'] = 'update_time'
|
111
|
+
@_hash
|
112
|
+
end
|
113
|
+
|
114
|
+
# An array for optional fields
|
115
|
+
def self.optionals
|
116
|
+
%w[
|
117
|
+
status
|
118
|
+
status_details
|
119
|
+
id
|
120
|
+
amount
|
121
|
+
invoice_id
|
122
|
+
custom_id
|
123
|
+
network_transaction_reference
|
124
|
+
seller_protection
|
125
|
+
final_capture
|
126
|
+
seller_receivable_breakdown
|
127
|
+
disbursement_mode
|
128
|
+
links
|
129
|
+
processor_response
|
130
|
+
create_time
|
131
|
+
update_time
|
132
|
+
]
|
133
|
+
end
|
134
|
+
|
135
|
+
# An array for nullable fields
|
136
|
+
def self.nullables
|
137
|
+
[]
|
138
|
+
end
|
139
|
+
|
140
|
+
def initialize(status: SKIP, status_details: SKIP, id: SKIP, amount: SKIP,
|
141
|
+
invoice_id: SKIP, custom_id: SKIP,
|
142
|
+
network_transaction_reference: SKIP, seller_protection: SKIP,
|
143
|
+
final_capture: false, seller_receivable_breakdown: SKIP,
|
144
|
+
disbursement_mode: DisbursementMode::INSTANT, links: SKIP,
|
145
|
+
processor_response: SKIP, create_time: SKIP,
|
146
|
+
update_time: SKIP)
|
147
|
+
@status = status unless status == SKIP
|
148
|
+
@status_details = status_details unless status_details == SKIP
|
149
|
+
@id = id unless id == SKIP
|
150
|
+
@amount = amount unless amount == SKIP
|
151
|
+
@invoice_id = invoice_id unless invoice_id == SKIP
|
152
|
+
@custom_id = custom_id unless custom_id == SKIP
|
153
|
+
unless network_transaction_reference == SKIP
|
154
|
+
@network_transaction_reference =
|
155
|
+
network_transaction_reference
|
156
|
+
end
|
157
|
+
@seller_protection = seller_protection unless seller_protection == SKIP
|
158
|
+
@final_capture = final_capture unless final_capture == SKIP
|
159
|
+
unless seller_receivable_breakdown == SKIP
|
160
|
+
@seller_receivable_breakdown =
|
161
|
+
seller_receivable_breakdown
|
162
|
+
end
|
163
|
+
@disbursement_mode = disbursement_mode unless disbursement_mode == SKIP
|
164
|
+
@links = links unless links == SKIP
|
165
|
+
@processor_response = processor_response unless processor_response == SKIP
|
166
|
+
@create_time = create_time unless create_time == SKIP
|
167
|
+
@update_time = update_time unless update_time == SKIP
|
168
|
+
end
|
169
|
+
|
170
|
+
# Creates an instance of the object from a hash.
|
171
|
+
def self.from_hash(hash)
|
172
|
+
return nil unless hash
|
173
|
+
|
174
|
+
# Extract variables from the hash.
|
175
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
176
|
+
status_details = CaptureStatusDetails.from_hash(hash['status_details']) if
|
177
|
+
hash['status_details']
|
178
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
179
|
+
amount = Money.from_hash(hash['amount']) if hash['amount']
|
180
|
+
invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP
|
181
|
+
custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP
|
182
|
+
if hash['network_transaction_reference']
|
183
|
+
network_transaction_reference = NetworkTransactionReference.from_hash(hash['network_transaction_reference'])
|
184
|
+
end
|
185
|
+
seller_protection = SellerProtection.from_hash(hash['seller_protection']) if
|
186
|
+
hash['seller_protection']
|
187
|
+
final_capture = hash['final_capture'] ||= false
|
188
|
+
if hash['seller_receivable_breakdown']
|
189
|
+
seller_receivable_breakdown = SellerReceivableBreakdown.from_hash(hash['seller_receivable_breakdown'])
|
190
|
+
end
|
191
|
+
disbursement_mode =
|
192
|
+
hash['disbursement_mode'] ||= DisbursementMode::INSTANT
|
193
|
+
# Parameter is an array, so we need to iterate through it
|
194
|
+
links = nil
|
195
|
+
unless hash['links'].nil?
|
196
|
+
links = []
|
197
|
+
hash['links'].each do |structure|
|
198
|
+
links << (LinkDescription.from_hash(structure) if structure)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
links = SKIP unless hash.key?('links')
|
203
|
+
processor_response = PaymentsProcessorResponse.from_hash(hash['processor_response']) if
|
204
|
+
hash['processor_response']
|
205
|
+
create_time = hash.key?('create_time') ? hash['create_time'] : SKIP
|
206
|
+
update_time = hash.key?('update_time') ? hash['update_time'] : SKIP
|
207
|
+
|
208
|
+
# Create object from extracted values.
|
209
|
+
PaymentsCapture.new(status: status,
|
210
|
+
status_details: status_details,
|
211
|
+
id: id,
|
212
|
+
amount: amount,
|
213
|
+
invoice_id: invoice_id,
|
214
|
+
custom_id: custom_id,
|
215
|
+
network_transaction_reference: network_transaction_reference,
|
216
|
+
seller_protection: seller_protection,
|
217
|
+
final_capture: final_capture,
|
218
|
+
seller_receivable_breakdown: seller_receivable_breakdown,
|
219
|
+
disbursement_mode: disbursement_mode,
|
220
|
+
links: links,
|
221
|
+
processor_response: processor_response,
|
222
|
+
create_time: create_time,
|
223
|
+
update_time: update_time)
|
224
|
+
end
|
225
|
+
|
226
|
+
# Provides a human-readable string representation of the object.
|
227
|
+
def to_s
|
228
|
+
class_name = self.class.name.split('::').last
|
229
|
+
"<#{class_name} status: #{@status}, status_details: #{@status_details}, id: #{@id}, amount:"\
|
230
|
+
" #{@amount}, invoice_id: #{@invoice_id}, custom_id: #{@custom_id},"\
|
231
|
+
" network_transaction_reference: #{@network_transaction_reference}, seller_protection:"\
|
232
|
+
" #{@seller_protection}, final_capture: #{@final_capture}, seller_receivable_breakdown:"\
|
233
|
+
" #{@seller_receivable_breakdown}, disbursement_mode: #{@disbursement_mode}, links:"\
|
234
|
+
" #{@links}, processor_response: #{@processor_response}, create_time: #{@create_time},"\
|
235
|
+
" update_time: #{@update_time}>"
|
236
|
+
end
|
237
|
+
|
238
|
+
# Provides a debugging-friendly string with detailed object information.
|
239
|
+
def inspect
|
240
|
+
class_name = self.class.name.split('::').last
|
241
|
+
"<#{class_name} status: #{@status.inspect}, status_details: #{@status_details.inspect}, id:"\
|
242
|
+
" #{@id.inspect}, amount: #{@amount.inspect}, invoice_id: #{@invoice_id.inspect}, custom_id:"\
|
243
|
+
" #{@custom_id.inspect}, network_transaction_reference:"\
|
244
|
+
" #{@network_transaction_reference.inspect}, seller_protection:"\
|
245
|
+
" #{@seller_protection.inspect}, final_capture: #{@final_capture.inspect},"\
|
246
|
+
" seller_receivable_breakdown: #{@seller_receivable_breakdown.inspect}, disbursement_mode:"\
|
247
|
+
" #{@disbursement_mode.inspect}, links: #{@links.inspect}, processor_response:"\
|
248
|
+
" #{@processor_response.inspect}, create_time: #{@create_time.inspect}, update_time:"\
|
249
|
+
" #{@update_time.inspect}>"
|
250
|
+
end
|
251
|
+
end
|
252
|
+
end
|
@@ -0,0 +1,42 @@
|
|
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 declined payment transactions might have payment advice codes. The card
|
8
|
+
# networks, like Visa and Mastercard, return payment advice codes.
|
9
|
+
class PaymentsPaymentAdviceCode
|
10
|
+
PAYMENTS_PAYMENT_ADVICE_CODE = [
|
11
|
+
# For Mastercard, expired card account upgrade or portfolio sale
|
12
|
+
# conversion. Obtain new account information before next billing cycle.
|
13
|
+
PAYMENTADVICE_01 = '01'.freeze,
|
14
|
+
|
15
|
+
# For Mastercard, over credit limit or insufficient funds. Retry the
|
16
|
+
# transaction 72 hours later. For Visa, the card holder wants to stop only
|
17
|
+
# one specific payment in the recurring payment relationship. The merchant
|
18
|
+
# must NOT resubmit the same transaction. The merchant can continue the
|
19
|
+
# billing process in the subsequent billing period.
|
20
|
+
PAYMENTADVICE_02 = '02'.freeze,
|
21
|
+
|
22
|
+
# For Mastercard, account closed as fraudulent. Obtain another type of
|
23
|
+
# payment from customer due to account being closed or fraud. Possible
|
24
|
+
# reason: Account closed as fraudulent. For Visa, the card holder wants to
|
25
|
+
# stop all recurring payment transactions for a specific merchant. Stop
|
26
|
+
# recurring payment requests.
|
27
|
+
PAYMENTADVICE_03 = '03'.freeze,
|
28
|
+
|
29
|
+
# For Mastercard, the card holder has been unsuccessful at canceling
|
30
|
+
# recurring payment through merchant. Stop recurring payment requests. For
|
31
|
+
# Visa, all recurring payments were canceled for the card number
|
32
|
+
# requested. Stop recurring payment requests.
|
33
|
+
PAYMENTADVICE_21 = '21'.freeze
|
34
|
+
].freeze
|
35
|
+
|
36
|
+
def self.validate(value)
|
37
|
+
return false if value.nil?
|
38
|
+
|
39
|
+
true
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|