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
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Address request details.
|
8
|
-
class
|
8
|
+
class CardResponseAddress < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -25,10 +25,9 @@ module PaypalServerSdk
|
|
25
25
|
|
26
26
|
# The highest-level sub-division in a country, which is usually a province,
|
27
27
|
# state, or ISO-3166-2 subdivision. This data is formatted for postal
|
28
|
-
# delivery, for example, `CA` and not `California`. Value, by country,
|
29
|
-
#
|
30
|
-
#
|
31
|
-
# *kanton*.</li></ul>
|
28
|
+
# delivery, for example, `CA` and not `California`. Value, by country, is:
|
29
|
+
# UK. A county. US. A state. Canada. A province. Japan. A prefecture.
|
30
|
+
# Switzerland. A *kanton*.
|
32
31
|
# @return [String]
|
33
32
|
attr_accessor :admin_area_1
|
34
33
|
|
@@ -39,36 +38,17 @@ module PaypalServerSdk
|
|
39
38
|
attr_accessor :postal_code
|
40
39
|
|
41
40
|
# The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that
|
42
|
-
# identifies the country or region
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
# method, bank card, and cross-border transactions.</blockquote>
|
41
|
+
# identifies the country or region. Note: The country code for Great Britain
|
42
|
+
# is GB and not UK as used in the top-level domain names for that country.
|
43
|
+
# Use the `C2` country code for China worldwide for comparable uncontrolled
|
44
|
+
# price (CUP) method, bank card, and cross-border transactions.
|
47
45
|
# @return [String]
|
48
46
|
attr_accessor :country_code
|
49
47
|
|
50
|
-
# The name of the party.
|
51
|
-
# @return [Name]
|
52
|
-
attr_accessor :name
|
53
|
-
|
54
48
|
# The resource ID of the address.
|
55
49
|
# @return [String]
|
56
50
|
attr_accessor :id
|
57
51
|
|
58
|
-
# The name of the company or business associated to the address.
|
59
|
-
# @return [String]
|
60
|
-
attr_accessor :company
|
61
|
-
|
62
|
-
# The phone number that can go on the mailing label with the address to
|
63
|
-
# track the shipping. Phone number is in E.164 format.
|
64
|
-
# @return [String]
|
65
|
-
attr_accessor :phone
|
66
|
-
|
67
|
-
# The phone number, in its canonical international [E.164 numbering plan
|
68
|
-
# format](https://www.itu.int/rec/T-REC-E.164/en).
|
69
|
-
# @return [Phone]
|
70
|
-
attr_accessor :phone_number
|
71
|
-
|
72
52
|
# A mapping from model property names to API property names.
|
73
53
|
def self.names
|
74
54
|
@_hash = {} if @_hash.nil?
|
@@ -78,11 +58,7 @@ module PaypalServerSdk
|
|
78
58
|
@_hash['admin_area_1'] = 'admin_area_1'
|
79
59
|
@_hash['postal_code'] = 'postal_code'
|
80
60
|
@_hash['country_code'] = 'country_code'
|
81
|
-
@_hash['name'] = 'name'
|
82
61
|
@_hash['id'] = 'id'
|
83
|
-
@_hash['company'] = 'company'
|
84
|
-
@_hash['phone'] = 'phone'
|
85
|
-
@_hash['phone_number'] = 'phone_number'
|
86
62
|
@_hash
|
87
63
|
end
|
88
64
|
|
@@ -94,11 +70,7 @@ module PaypalServerSdk
|
|
94
70
|
admin_area_2
|
95
71
|
admin_area_1
|
96
72
|
postal_code
|
97
|
-
name
|
98
73
|
id
|
99
|
-
company
|
100
|
-
phone
|
101
|
-
phone_number
|
102
74
|
]
|
103
75
|
end
|
104
76
|
|
@@ -109,19 +81,14 @@ module PaypalServerSdk
|
|
109
81
|
|
110
82
|
def initialize(country_code:, address_line_1: SKIP, address_line_2: SKIP,
|
111
83
|
admin_area_2: SKIP, admin_area_1: SKIP, postal_code: SKIP,
|
112
|
-
|
113
|
-
phone_number: SKIP)
|
84
|
+
id: SKIP)
|
114
85
|
@address_line_1 = address_line_1 unless address_line_1 == SKIP
|
115
86
|
@address_line_2 = address_line_2 unless address_line_2 == SKIP
|
116
87
|
@admin_area_2 = admin_area_2 unless admin_area_2 == SKIP
|
117
88
|
@admin_area_1 = admin_area_1 unless admin_area_1 == SKIP
|
118
89
|
@postal_code = postal_code unless postal_code == SKIP
|
119
90
|
@country_code = country_code
|
120
|
-
@name = name unless name == SKIP
|
121
91
|
@id = id unless id == SKIP
|
122
|
-
@company = company unless company == SKIP
|
123
|
-
@phone = phone unless phone == SKIP
|
124
|
-
@phone_number = phone_number unless phone_number == SKIP
|
125
92
|
end
|
126
93
|
|
127
94
|
# Creates an instance of the object from a hash.
|
@@ -137,24 +104,33 @@ module PaypalServerSdk
|
|
137
104
|
admin_area_2 = hash.key?('admin_area_2') ? hash['admin_area_2'] : SKIP
|
138
105
|
admin_area_1 = hash.key?('admin_area_1') ? hash['admin_area_1'] : SKIP
|
139
106
|
postal_code = hash.key?('postal_code') ? hash['postal_code'] : SKIP
|
140
|
-
name = Name.from_hash(hash['name']) if hash['name']
|
141
107
|
id = hash.key?('id') ? hash['id'] : SKIP
|
142
|
-
company = hash.key?('company') ? hash['company'] : SKIP
|
143
|
-
phone = hash.key?('phone') ? hash['phone'] : SKIP
|
144
|
-
phone_number = Phone.from_hash(hash['phone_number']) if hash['phone_number']
|
145
108
|
|
146
109
|
# Create object from extracted values.
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
110
|
+
CardResponseAddress.new(country_code: country_code,
|
111
|
+
address_line_1: address_line_1,
|
112
|
+
address_line_2: address_line_2,
|
113
|
+
admin_area_2: admin_area_2,
|
114
|
+
admin_area_1: admin_area_1,
|
115
|
+
postal_code: postal_code,
|
116
|
+
id: id)
|
117
|
+
end
|
118
|
+
|
119
|
+
# Provides a human-readable string representation of the object.
|
120
|
+
def to_s
|
121
|
+
class_name = self.class.name.split('::').last
|
122
|
+
"<#{class_name} address_line_1: #{@address_line_1}, address_line_2: #{@address_line_2},"\
|
123
|
+
" admin_area_2: #{@admin_area_2}, admin_area_1: #{@admin_area_1}, postal_code:"\
|
124
|
+
" #{@postal_code}, country_code: #{@country_code}, id: #{@id}>"
|
125
|
+
end
|
126
|
+
|
127
|
+
# Provides a debugging-friendly string with detailed object information.
|
128
|
+
def inspect
|
129
|
+
class_name = self.class.name.split('::').last
|
130
|
+
"<#{class_name} address_line_1: #{@address_line_1.inspect}, address_line_2:"\
|
131
|
+
" #{@address_line_2.inspect}, admin_area_2: #{@admin_area_2.inspect}, admin_area_1:"\
|
132
|
+
" #{@admin_area_1.inspect}, postal_code: #{@postal_code.inspect}, country_code:"\
|
133
|
+
" #{@country_code.inspect}, id: #{@id.inspect}>"
|
158
134
|
end
|
159
135
|
end
|
160
136
|
end
|
@@ -6,15 +6,14 @@
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Provides additional details to process a payment using a `card` that has
|
8
8
|
# been stored or is intended to be stored (also referred to as
|
9
|
-
# stored_credential or card-on-file)
|
10
|
-
#
|
11
|
-
# `payment_initiator=CUSTOMER
|
12
|
-
# `payment_initiator=CUSTOMER
|
9
|
+
# stored_credential or card-on-file). Parameter compatibility:
|
10
|
+
# `payment_type=ONE_TIME` is compatible only with
|
11
|
+
# `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with
|
12
|
+
# `payment_initiator=CUSTOMER`. `previous_transaction_reference` or
|
13
13
|
# `previous_network_transaction_reference` is compatible only with
|
14
|
-
# `payment_initiator=MERCHANT
|
14
|
+
# `payment_initiator=MERCHANT`. Only one of the parameters -
|
15
15
|
# `previous_transaction_reference` and
|
16
|
-
# `previous_network_transaction_reference` - can be present in the
|
17
|
-
# request.</li></ul>
|
16
|
+
# `previous_network_transaction_reference` - can be present in the request.
|
18
17
|
class CardStoredCredential < BaseModel
|
19
18
|
SKIP = Object.new
|
20
19
|
private_constant :SKIP
|
@@ -91,5 +90,22 @@ module PaypalServerSdk
|
|
91
90
|
usage: usage,
|
92
91
|
previous_network_transaction_reference: previous_network_transaction_reference)
|
93
92
|
end
|
93
|
+
|
94
|
+
# Provides a human-readable string representation of the object.
|
95
|
+
def to_s
|
96
|
+
class_name = self.class.name.split('::').last
|
97
|
+
"<#{class_name} payment_initiator: #{@payment_initiator}, payment_type: #{@payment_type},"\
|
98
|
+
" usage: #{@usage}, previous_network_transaction_reference:"\
|
99
|
+
" #{@previous_network_transaction_reference}>"
|
100
|
+
end
|
101
|
+
|
102
|
+
# Provides a debugging-friendly string with detailed object information.
|
103
|
+
def inspect
|
104
|
+
class_name = self.class.name.split('::').last
|
105
|
+
"<#{class_name} payment_initiator: #{@payment_initiator.inspect}, payment_type:"\
|
106
|
+
" #{@payment_type.inspect}, usage: #{@usage.inspect},"\
|
107
|
+
' previous_network_transaction_reference:'\
|
108
|
+
" #{@previous_network_transaction_reference.inspect}>"
|
109
|
+
end
|
94
110
|
end
|
95
111
|
end
|
@@ -6,11 +6,7 @@
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Merchants and partners can add Level 2 and 3 data to payments to reduce risk
|
8
8
|
# and payment processing costs. For more information about processing
|
9
|
-
# payments, see
|
10
|
-
# href="https://developer.paypal.com/docs/checkout/advanced/processing/">check
|
11
|
-
# out</a> or <a
|
12
|
-
# href="https://developer.paypal.com/docs/multiparty/checkout/advanced/process
|
13
|
-
# ing/">multiparty checkout</a>.
|
9
|
+
# payments, see checkout or multiparty checkout.
|
14
10
|
class CardSupplementaryData < BaseModel
|
15
11
|
SKIP = Object.new
|
16
12
|
private_constant :SKIP
|
@@ -67,5 +63,17 @@ module PaypalServerSdk
|
|
67
63
|
CardSupplementaryData.new(level_2: level_2,
|
68
64
|
level_3: level_3)
|
69
65
|
end
|
66
|
+
|
67
|
+
# Provides a human-readable string representation of the object.
|
68
|
+
def to_s
|
69
|
+
class_name = self.class.name.split('::').last
|
70
|
+
"<#{class_name} level_2: #{@level_2}, level_3: #{@level_3}>"
|
71
|
+
end
|
72
|
+
|
73
|
+
# Provides a debugging-friendly string with detailed object information.
|
74
|
+
def inspect
|
75
|
+
class_name = self.class.name.split('::').last
|
76
|
+
"<#{class_name} level_2: #{@level_2.inspect}, level_3: #{@level_3.inspect}>"
|
77
|
+
end
|
70
78
|
end
|
71
79
|
end
|
@@ -7,19 +7,19 @@ module PaypalServerSdk
|
|
7
7
|
# Type of card. i.e Credit, Debit and so on.
|
8
8
|
class CardType
|
9
9
|
CARD_TYPE = [
|
10
|
-
#
|
10
|
+
# A credit card.
|
11
11
|
CREDIT = 'CREDIT'.freeze,
|
12
12
|
|
13
|
-
#
|
13
|
+
# A debit card.
|
14
14
|
DEBIT = 'DEBIT'.freeze,
|
15
15
|
|
16
|
-
#
|
16
|
+
# A Prepaid card.
|
17
17
|
PREPAID = 'PREPAID'.freeze,
|
18
18
|
|
19
|
-
#
|
19
|
+
# A store card.
|
20
20
|
STORE = 'STORE'.freeze,
|
21
21
|
|
22
|
-
#
|
22
|
+
# Card type cannot be determined.
|
23
23
|
UNKNOWN = 'UNKNOWN'.freeze
|
24
24
|
].freeze
|
25
25
|
|
@@ -82,5 +82,18 @@ module PaypalServerSdk
|
|
82
82
|
links: links,
|
83
83
|
customer: customer)
|
84
84
|
end
|
85
|
+
|
86
|
+
# Provides a human-readable string representation of the object.
|
87
|
+
def to_s
|
88
|
+
class_name = self.class.name.split('::').last
|
89
|
+
"<#{class_name} id: #{@id}, status: #{@status}, links: #{@links}, customer: #{@customer}>"
|
90
|
+
end
|
91
|
+
|
92
|
+
# Provides a debugging-friendly string with detailed object information.
|
93
|
+
def inspect
|
94
|
+
class_name = self.class.name.split('::').last
|
95
|
+
"<#{class_name} id: #{@id.inspect}, status: #{@status.inspect}, links: #{@links.inspect},"\
|
96
|
+
" customer: #{@customer.inspect}>"
|
97
|
+
end
|
85
98
|
end
|
86
99
|
end
|
@@ -11,7 +11,7 @@ module PaypalServerSdk
|
|
11
11
|
private_constant :SKIP
|
12
12
|
|
13
13
|
# The method used for card verification.
|
14
|
-
# @return [
|
14
|
+
# @return [OrdersCardVerificationMethod]
|
15
15
|
attr_accessor :method
|
16
16
|
|
17
17
|
# A mapping from model property names to API property names.
|
@@ -33,7 +33,7 @@ module PaypalServerSdk
|
|
33
33
|
[]
|
34
34
|
end
|
35
35
|
|
36
|
-
def initialize(method:
|
36
|
+
def initialize(method: OrdersCardVerificationMethod::SCA_WHEN_REQUIRED)
|
37
37
|
@method = method unless method == SKIP
|
38
38
|
end
|
39
39
|
|
@@ -42,10 +42,23 @@ module PaypalServerSdk
|
|
42
42
|
return nil unless hash
|
43
43
|
|
44
44
|
# Extract variables from the hash.
|
45
|
-
method =
|
45
|
+
method =
|
46
|
+
hash['method'] ||= OrdersCardVerificationMethod::SCA_WHEN_REQUIRED
|
46
47
|
|
47
48
|
# Create object from extracted values.
|
48
49
|
CardVerification.new(method: method)
|
49
50
|
end
|
51
|
+
|
52
|
+
# Provides a human-readable string representation of the object.
|
53
|
+
def to_s
|
54
|
+
class_name = self.class.name.split('::').last
|
55
|
+
"<#{class_name} method: #{@method}>"
|
56
|
+
end
|
57
|
+
|
58
|
+
# Provides a debugging-friendly string with detailed object information.
|
59
|
+
def inspect
|
60
|
+
class_name = self.class.name.split('::').last
|
61
|
+
"<#{class_name} method: #{@method.inspect}>"
|
62
|
+
end
|
50
63
|
end
|
51
64
|
end
|
@@ -10,15 +10,15 @@ module PaypalServerSdk
|
|
10
10
|
SKIP = Object.new
|
11
11
|
private_constant :SKIP
|
12
12
|
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
13
|
+
# DEPRECATED. This field is DEPRECATED. Please find the network transaction
|
14
|
+
# id data in the 'id' field under the 'network_transaction_reference' object
|
15
|
+
# instead of the 'verification' object.
|
16
16
|
# @return [String]
|
17
17
|
attr_accessor :network_transaction_id
|
18
18
|
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
19
|
+
# DEPRECATED. This field is DEPRECATED. Please find the date data in the
|
20
|
+
# 'date' field under the 'network_transaction_reference' object instead of
|
21
|
+
# the 'verification' object.
|
22
22
|
# @return [String]
|
23
23
|
attr_accessor :date
|
24
24
|
|
@@ -29,9 +29,8 @@ module PaypalServerSdk
|
|
29
29
|
|
30
30
|
# The date and time, in [Internet date and time
|
31
31
|
# format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
|
32
|
-
# required while fractional seconds are
|
33
|
-
#
|
34
|
-
# provides guidance but does not reject all invalid dates.</blockquote>
|
32
|
+
# required while fractional seconds are optional. Note: The regular
|
33
|
+
# expression provides guidance but does not reject all invalid dates.
|
35
34
|
# @return [String]
|
36
35
|
attr_accessor :time
|
37
36
|
|
@@ -45,6 +44,12 @@ module PaypalServerSdk
|
|
45
44
|
# @return [CardVerificationProcessorResponse]
|
46
45
|
attr_accessor :processor_response
|
47
46
|
|
47
|
+
# DEPRECATED. This field is DEPRECATED. Please find the 3D secure
|
48
|
+
# authentication data in the 'three_d_secure' object under the
|
49
|
+
# 'authentication_result' object instead of the 'verification' object.
|
50
|
+
# @return [Object]
|
51
|
+
attr_accessor :three_d_secure
|
52
|
+
|
48
53
|
# A mapping from model property names to API property names.
|
49
54
|
def self.names
|
50
55
|
@_hash = {} if @_hash.nil?
|
@@ -54,6 +59,7 @@ module PaypalServerSdk
|
|
54
59
|
@_hash['time'] = 'time'
|
55
60
|
@_hash['amount'] = 'amount'
|
56
61
|
@_hash['processor_response'] = 'processor_response'
|
62
|
+
@_hash['three_d_secure'] = 'three_d_secure'
|
57
63
|
@_hash
|
58
64
|
end
|
59
65
|
|
@@ -66,6 +72,7 @@ module PaypalServerSdk
|
|
66
72
|
time
|
67
73
|
amount
|
68
74
|
processor_response
|
75
|
+
three_d_secure
|
69
76
|
]
|
70
77
|
end
|
71
78
|
|
@@ -75,13 +82,15 @@ module PaypalServerSdk
|
|
75
82
|
end
|
76
83
|
|
77
84
|
def initialize(network_transaction_id: SKIP, date: SKIP, network: SKIP,
|
78
|
-
time: SKIP, amount: SKIP, processor_response: SKIP
|
85
|
+
time: SKIP, amount: SKIP, processor_response: SKIP,
|
86
|
+
three_d_secure: SKIP)
|
79
87
|
@network_transaction_id = network_transaction_id unless network_transaction_id == SKIP
|
80
88
|
@date = date unless date == SKIP
|
81
89
|
@network = network unless network == SKIP
|
82
90
|
@time = time unless time == SKIP
|
83
91
|
@amount = amount unless amount == SKIP
|
84
92
|
@processor_response = processor_response unless processor_response == SKIP
|
93
|
+
@three_d_secure = three_d_secure unless three_d_secure == SKIP
|
85
94
|
end
|
86
95
|
|
87
96
|
# Creates an instance of the object from a hash.
|
@@ -98,6 +107,8 @@ module PaypalServerSdk
|
|
98
107
|
if hash['processor_response']
|
99
108
|
processor_response = CardVerificationProcessorResponse.from_hash(hash['processor_response'])
|
100
109
|
end
|
110
|
+
three_d_secure =
|
111
|
+
hash.key?('three_d_secure') ? hash['three_d_secure'] : SKIP
|
101
112
|
|
102
113
|
# Create object from extracted values.
|
103
114
|
CardVerificationDetails.new(network_transaction_id: network_transaction_id,
|
@@ -105,7 +116,25 @@ module PaypalServerSdk
|
|
105
116
|
network: network,
|
106
117
|
time: time,
|
107
118
|
amount: amount,
|
108
|
-
processor_response: processor_response
|
119
|
+
processor_response: processor_response,
|
120
|
+
three_d_secure: three_d_secure)
|
121
|
+
end
|
122
|
+
|
123
|
+
# Provides a human-readable string representation of the object.
|
124
|
+
def to_s
|
125
|
+
class_name = self.class.name.split('::').last
|
126
|
+
"<#{class_name} network_transaction_id: #{@network_transaction_id}, date: #{@date},"\
|
127
|
+
" network: #{@network}, time: #{@time}, amount: #{@amount}, processor_response:"\
|
128
|
+
" #{@processor_response}, three_d_secure: #{@three_d_secure}>"
|
129
|
+
end
|
130
|
+
|
131
|
+
# Provides a debugging-friendly string with detailed object information.
|
132
|
+
def inspect
|
133
|
+
class_name = self.class.name.split('::').last
|
134
|
+
"<#{class_name} network_transaction_id: #{@network_transaction_id.inspect}, date:"\
|
135
|
+
" #{@date.inspect}, network: #{@network.inspect}, time: #{@time.inspect}, amount:"\
|
136
|
+
" #{@amount.inspect}, processor_response: #{@processor_response.inspect}, three_d_secure:"\
|
137
|
+
" #{@three_d_secure.inspect}>"
|
109
138
|
end
|
110
139
|
end
|
111
140
|
end
|
@@ -58,5 +58,17 @@ module PaypalServerSdk
|
|
58
58
|
CardVerificationProcessorResponse.new(avs_code: avs_code,
|
59
59
|
cvv_code: cvv_code)
|
60
60
|
end
|
61
|
+
|
62
|
+
# Provides a human-readable string representation of the object.
|
63
|
+
def to_s
|
64
|
+
class_name = self.class.name.split('::').last
|
65
|
+
"<#{class_name} avs_code: #{@avs_code}, cvv_code: #{@cvv_code}>"
|
66
|
+
end
|
67
|
+
|
68
|
+
# Provides a debugging-friendly string with detailed object information.
|
69
|
+
def inspect
|
70
|
+
class_name = self.class.name.split('::').last
|
71
|
+
"<#{class_name} avs_code: #{@avs_code.inspect}, cvv_code: #{@cvv_code.inspect}>"
|
72
|
+
end
|
61
73
|
end
|
62
74
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# paypal_server_sdk
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaypalServerSdk
|
7
|
+
# Verification status of Card.
|
8
|
+
class CardVerificationStatus
|
9
|
+
CARD_VERIFICATION_STATUS = [
|
10
|
+
# Card has been verified
|
11
|
+
VERIFIED = 'VERIFIED'.freeze,
|
12
|
+
|
13
|
+
# Card verification has failed
|
14
|
+
FAILED = 'FAILED'.freeze
|
15
|
+
].freeze
|
16
|
+
|
17
|
+
def self.validate(value)
|
18
|
+
return false if value.nil?
|
19
|
+
|
20
|
+
true
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -8,10 +8,18 @@ module PaypalServerSdk
|
|
8
8
|
# an order after order creation.
|
9
9
|
class CheckoutPaymentIntent
|
10
10
|
CHECKOUT_PAYMENT_INTENT = [
|
11
|
-
#
|
11
|
+
# The merchant intends to capture payment immediately after the customer
|
12
|
+
# makes a payment.
|
12
13
|
CAPTURE = 'CAPTURE'.freeze,
|
13
14
|
|
14
|
-
#
|
15
|
+
# The merchant intends to authorize a payment and place funds on hold
|
16
|
+
# after the customer makes a payment. Authorized payments are best
|
17
|
+
# captured within three days of authorization but are available to capture
|
18
|
+
# for up to 29 days. After the three-day honor period, the original
|
19
|
+
# authorized payment expires and you must re-authorize the payment. You
|
20
|
+
# must make a separate request to capture payments on demand. This intent
|
21
|
+
# is not supported when you have more than one `purchase_unit` within your
|
22
|
+
# order.
|
15
23
|
AUTHORIZE = 'AUTHORIZE'.freeze
|
16
24
|
].freeze
|
17
25
|
|
@@ -66,5 +66,18 @@ module PaypalServerSdk
|
|
66
66
|
payee: payee,
|
67
67
|
amount: amount)
|
68
68
|
end
|
69
|
+
|
70
|
+
# Provides a human-readable string representation of the object.
|
71
|
+
def to_s
|
72
|
+
class_name = self.class.name.split('::').last
|
73
|
+
"<#{class_name} labels: #{@labels}, payee: #{@payee}, amount: #{@amount}>"
|
74
|
+
end
|
75
|
+
|
76
|
+
# Provides a debugging-friendly string with detailed object information.
|
77
|
+
def inspect
|
78
|
+
class_name = self.class.name.split('::').last
|
79
|
+
"<#{class_name} labels: #{@labels.inspect}, payee: #{@payee.inspect}, amount:"\
|
80
|
+
" #{@amount.inspect}>"
|
81
|
+
end
|
69
82
|
end
|
70
83
|
end
|
@@ -14,10 +14,6 @@ module PaypalServerSdk
|
|
14
14
|
# @return [PaymentSource]
|
15
15
|
attr_accessor :payment_source
|
16
16
|
|
17
|
-
# The instruction to process an order.
|
18
|
-
# @return [ProcessingInstruction]
|
19
|
-
attr_accessor :processing_instruction
|
20
|
-
|
21
17
|
# Customizes the payer confirmation experience.
|
22
18
|
# @return [OrderConfirmApplicationContext]
|
23
19
|
attr_accessor :application_context
|
@@ -26,7 +22,6 @@ module PaypalServerSdk
|
|
26
22
|
def self.names
|
27
23
|
@_hash = {} if @_hash.nil?
|
28
24
|
@_hash['payment_source'] = 'payment_source'
|
29
|
-
@_hash['processing_instruction'] = 'processing_instruction'
|
30
25
|
@_hash['application_context'] = 'application_context'
|
31
26
|
@_hash
|
32
27
|
end
|
@@ -34,7 +29,6 @@ module PaypalServerSdk
|
|
34
29
|
# An array for optional fields
|
35
30
|
def self.optionals
|
36
31
|
%w[
|
37
|
-
processing_instruction
|
38
32
|
application_context
|
39
33
|
]
|
40
34
|
end
|
@@ -44,13 +38,8 @@ module PaypalServerSdk
|
|
44
38
|
[]
|
45
39
|
end
|
46
40
|
|
47
|
-
def initialize(
|
48
|
-
payment_source:,
|
49
|
-
processing_instruction: ProcessingInstruction::NO_INSTRUCTION,
|
50
|
-
application_context: SKIP
|
51
|
-
)
|
41
|
+
def initialize(payment_source:, application_context: SKIP)
|
52
42
|
@payment_source = payment_source
|
53
|
-
@processing_instruction = processing_instruction unless processing_instruction == SKIP
|
54
43
|
@application_context = application_context unless application_context == SKIP
|
55
44
|
end
|
56
45
|
|
@@ -60,15 +49,26 @@ module PaypalServerSdk
|
|
60
49
|
|
61
50
|
# Extract variables from the hash.
|
62
51
|
payment_source = PaymentSource.from_hash(hash['payment_source']) if hash['payment_source']
|
63
|
-
processing_instruction =
|
64
|
-
hash['processing_instruction'] ||= ProcessingInstruction::NO_INSTRUCTION
|
65
52
|
application_context = OrderConfirmApplicationContext.from_hash(hash['application_context']) if
|
66
53
|
hash['application_context']
|
67
54
|
|
68
55
|
# Create object from extracted values.
|
69
56
|
ConfirmOrderRequest.new(payment_source: payment_source,
|
70
|
-
processing_instruction: processing_instruction,
|
71
57
|
application_context: application_context)
|
72
58
|
end
|
59
|
+
|
60
|
+
# Provides a human-readable string representation of the object.
|
61
|
+
def to_s
|
62
|
+
class_name = self.class.name.split('::').last
|
63
|
+
"<#{class_name} payment_source: #{@payment_source}, application_context:"\
|
64
|
+
" #{@application_context}>"
|
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} payment_source: #{@payment_source.inspect}, application_context:"\
|
71
|
+
" #{@application_context.inspect}>"
|
72
|
+
end
|
73
73
|
end
|
74
74
|
end
|
@@ -4,8 +4,9 @@
|
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
|
-
#
|
8
|
-
|
7
|
+
# This object defines a customer in your system. Use it to manage customer
|
8
|
+
# profiles, save payment methods and contact details.
|
9
|
+
class Customer < BaseModel
|
9
10
|
SKIP = Object.new
|
10
11
|
private_constant :SKIP
|
11
12
|
|
@@ -55,8 +56,21 @@ module PaypalServerSdk
|
|
55
56
|
hash.key?('merchant_customer_id') ? hash['merchant_customer_id'] : SKIP
|
56
57
|
|
57
58
|
# Create object from extracted values.
|
58
|
-
|
59
|
-
|
59
|
+
Customer.new(id: id,
|
60
|
+
merchant_customer_id: merchant_customer_id)
|
61
|
+
end
|
62
|
+
|
63
|
+
# Provides a human-readable string representation of the object.
|
64
|
+
def to_s
|
65
|
+
class_name = self.class.name.split('::').last
|
66
|
+
"<#{class_name} id: #{@id}, merchant_customer_id: #{@merchant_customer_id}>"
|
67
|
+
end
|
68
|
+
|
69
|
+
# Provides a debugging-friendly string with detailed object information.
|
70
|
+
def inspect
|
71
|
+
class_name = self.class.name.split('::').last
|
72
|
+
"<#{class_name} id: #{@id.inspect}, merchant_customer_id:"\
|
73
|
+
" #{@merchant_customer_id.inspect}>"
|
60
74
|
end
|
61
75
|
end
|
62
76
|
end
|
@@ -13,11 +13,10 @@ module PaypalServerSdk
|
|
13
13
|
# @return [String]
|
14
14
|
attr_accessor :id
|
15
15
|
|
16
|
-
# The internationalized email address
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
# unquoted <code>@</code> sign exists.</blockquote>
|
16
|
+
# The internationalized email address. Note: Up to 64 characters are allowed
|
17
|
+
# before and 255 characters are allowed after the @ sign. However, the
|
18
|
+
# generally accepted maximum length for an email address is 254 characters.
|
19
|
+
# The pattern verifies that an unquoted @ sign exists.
|
21
20
|
# @return [String]
|
22
21
|
attr_accessor :email_address
|
23
22
|
|
@@ -68,5 +67,18 @@ module PaypalServerSdk
|
|
68
67
|
email_address: email_address,
|
69
68
|
phone: phone)
|
70
69
|
end
|
70
|
+
|
71
|
+
# Provides a human-readable string representation of the object.
|
72
|
+
def to_s
|
73
|
+
class_name = self.class.name.split('::').last
|
74
|
+
"<#{class_name} id: #{@id}, email_address: #{@email_address}, phone: #{@phone}>"
|
75
|
+
end
|
76
|
+
|
77
|
+
# Provides a debugging-friendly string with detailed object information.
|
78
|
+
def inspect
|
79
|
+
class_name = self.class.name.split('::').last
|
80
|
+
"<#{class_name} id: #{@id.inspect}, email_address: #{@email_address.inspect}, phone:"\
|
81
|
+
" #{@phone.inspect}>"
|
82
|
+
end
|
71
83
|
end
|
72
84
|
end
|