From cbf5a36b35e0feee2502063599d342910c9ec78b Mon Sep 17 00:00:00 2001 From: PayPalServerSDKs Date: Thu, 6 Nov 2025 20:07:39 +0000 Subject: [PATCH] Automated commit message --- .rubocop.yml | 3 + CHANGELOG.md | 8 - README.md | 53 +- doc/abstract-logger.md | 5 +- doc/auth/oauth-2-client-credentials-grant.md | 15 +- doc/client.md | 8 +- doc/controllers/orders.md | 242 +++-- doc/controllers/payments.md | 148 ++- doc/controllers/subscriptions.md | 893 ++++++++++++++++++ doc/controllers/transactionsearch.md | 117 +++ doc/controllers/vault.md | 156 +-- doc/models/activate-subscription-request.md | 23 + doc/models/amount-breakdown.md | 2 +- doc/models/app-switch-context.md | 31 + doc/models/apple-pay-card-response.md | 6 +- doc/models/apple-pay-card.md | 2 +- doc/models/apple-pay-decrypted-token-data.md | 2 +- doc/models/apple-pay-payment-token.md | 2 +- doc/models/apple-pay-request-card.md | 34 + doc/models/apple-pay-request.md | 2 +- doc/models/apple-pay-tokenized-card.md | 2 +- doc/models/application-context-user-action.md | 16 + doc/models/auction-information.md | 29 + .../authorization-with-additional-data.md | 4 +- doc/models/authorization.md | 4 +- doc/models/balance-information.md | 40 + doc/models/balances-response.md | 78 ++ doc/models/bank-request.md | 34 + doc/models/billing-cycle-override.md | 61 ++ doc/models/billing-cycle.md | 5 - doc/models/billing-plan.md | 40 + doc/models/bin-details.md | 2 +- doc/models/blik-experience-context.md | 2 +- doc/models/callback-configuration.md | 2 +- doc/models/cancel-subscription-request.md | 23 + doc/models/capture-payment-instruction.md | 2 +- doc/models/capture-request.md | 12 +- doc/models/capture-subscription-request.md | 30 + doc/models/capture-type.md | 15 + doc/models/captured-payment.md | 6 +- doc/models/card-brand.md | 5 + doc/models/card-customer.md | 34 + .../card-response-with-billing-address.md | 36 + doc/models/card-response.md | 10 +- doc/models/card-stored-credential.md | 4 +- doc/models/card-vault-response.md | 2 +- doc/models/card-verification-details.md | 6 +- doc/models/cart-information.md | 35 + doc/models/checkout-option.md | 25 + doc/models/cobranded-card.md | 2 +- doc/models/confirm-order-request.md | 2 +- doc/models/create-subscription-request.md | 82 ++ .../customer-vault-payment-tokens-response.md | 16 +- doc/models/cycle-execution.md | 33 + doc/models/default-error-exception.md | 47 + doc/models/error-details.md | 2 +- doc/models/error-exception.md | 4 +- .../experience-context-shipping-preference.md | 17 + doc/models/experience-context.md | 2 +- doc/models/experience-status.md | 18 + doc/models/failed-payment-details.md | 32 + doc/models/frequency.md | 25 + doc/models/google-pay-card-response.md | 2 +- doc/models/google-pay-request-card.md | 2 +- doc/models/google-pay-request.md | 2 +- doc/models/google-pay-wallet-response.md | 2 +- doc/models/incentive-details.md | 32 + doc/models/incentive-information.md | 51 + doc/models/interval-unit.md | 18 + doc/models/item-details.md | 45 + doc/models/item-request.md | 46 + doc/models/item.md | 2 +- doc/models/last-payment-details.md | 26 + doc/models/level-3-card-processing-data.md | 2 +- doc/models/line-item.md | 2 +- doc/models/link-http-method.md | 20 +- doc/models/merchant-preferences.md | 25 + doc/models/mobile-return-flow.md | 16 + doc/models/mobile-web-context.md | 25 + doc/models/modify-subscription-request.md | 66 ++ doc/models/modify-subscription-response.md | 152 +++ doc/models/native-app-context.md | 25 + .../network-transaction-reference-entity.md | 2 +- ...on-reference.md => network-transaction.md} | 16 +- ...application-context-shipping-preference.md | 2 +- doc/models/order-application-context.md | 6 +- .../order-authorize-request-payment-source.md | 4 +- doc/models/order-authorize-request.md | 4 +- ...order-authorize-response-payment-source.md | 6 +- doc/models/order-authorize-response.md | 14 +- doc/models/order-billing-plan.md | 6 +- .../order-capture-request-payment-source.md | 4 +- doc/models/order-capture-request.md | 4 +- .../order-confirm-application-context.md | 2 +- doc/models/order-request.md | 4 +- doc/models/order-tracker-request.md | 4 +- doc/models/order-tracker-response.md | 4 +- ...-update-callback-error-response-details.md | 27 - .../order-update-callback-error-response.md | 38 - doc/models/order-update-callback-request.md | 115 --- doc/models/order-update-callback-response.md | 83 -- .../order-update-callback-shipping-address.md | 29 - .../order-update-callback-shipping-option.md | 32 - doc/models/order.md | 10 +- doc/models/orders-capture.md | 4 +- doc/models/os-type.md | 17 + doc/models/payer-information.md | 38 + doc/models/payer-name.md | 33 + doc/models/payer.md | 2 + doc/models/payment-authorization.md | 4 +- doc/models/payment-collection.md | 6 +- doc/models/payment-instruction.md | 2 +- doc/models/payment-method.md | 23 + doc/models/payment-preferences-override.md | 32 + doc/models/payment-preferences.md | 32 + doc/models/payment-source-response.md | 4 +- doc/models/payment-token-request-card.md | 2 +- .../payment-token-request-payment-source.md | 2 +- doc/models/payment-token-request.md | 2 +- .../payment-token-response-payment-source.md | 10 +- doc/models/payment-token-response.md | 10 +- doc/models/payment-token-status.md | 2 +- doc/models/payments-capture.md | 6 +- doc/models/payments-payment-advice-code.md | 18 - doc/models/payments-processor-response.md | 29 - doc/models/paypal-experience-landing-page.md | 1 + doc/models/paypal-payment-token.md | 5 +- doc/models/paypal-reference-id-type.md | 18 + .../paypal-wallet-attributes-response.md | 2 +- doc/models/paypal-wallet-attributes.md | 3 +- .../paypal-wallet-experience-context.md | 1 + doc/models/paypal-wallet-response.md | 1 + doc/models/paypal-wallet-stored-credential.md | 2 +- doc/models/paypal-wallet-vault-instruction.md | 4 +- doc/models/paypal-wallet-vault-response.md | 2 +- doc/models/phone-number-with-country-code.md | 2 +- ...phone-number-with-optional-country-code.md | 25 + doc/models/phone-number.md | 2 +- doc/models/phone-type.md | 14 +- doc/models/plan-collection.md | 53 ++ doc/models/plan-details.md | 176 ++++ doc/models/plan-override.md | 156 +++ doc/models/plan-request-status.md | 17 + doc/models/plan-request.md | 98 ++ doc/models/plan.md | 11 +- doc/models/pricing-tier.md | 30 + doc/models/purchase-unit-request.md | 8 +- doc/models/purchase-unit.md | 4 +- doc/models/reason-code.md | 22 + doc/models/reauthorize-request.md | 2 +- doc/models/refund-payment-instruction.md | 2 +- doc/models/refund.md | 2 +- doc/models/return-flow.md | 16 + doc/models/search-error-exception.md | 51 + doc/models/search-response.md | 228 +++++ doc/models/seller-payable-breakdown.md | 4 +- doc/models/seller-protection.md | 2 +- doc/models/seller-receivable-breakdown.md | 2 +- doc/models/sepa-debit-experience-context.md | 27 + doc/models/sepa-debit-request.md | 27 + doc/models/setup-fee-failure-action.md | 16 + doc/models/setup-token-request-card.md | 4 +- .../setup-token-request-payment-source.md | 23 +- doc/models/setup-token-request.md | 19 +- doc/models/setup-token-response-card.md | 2 +- .../setup-token-response-payment-source.md | 8 +- doc/models/setup-token-response.md | 8 +- doc/models/shipment-carrier.md | 36 + doc/models/shipping-details.md | 2 +- doc/models/shipping-information.md | 43 + doc/models/shipping-options-purchase-unit.md | 108 --- doc/models/shipping-with-tracking-details.md | 86 +- .../simple-postal-address-coarse-grained.md | 33 + doc/models/store-information.md | 25 + doc/models/stored-payment-source.md | 4 +- doc/models/subscriber-request.md | 67 ++ doc/models/subscriber.md | 66 ++ .../subscription-amount-with-breakdown.md | 51 + .../subscription-application-context.md | 37 + doc/models/subscription-billing-cycle.md | 68 ++ .../subscription-billing-information.md | 69 ++ doc/models/subscription-card-request.md | 34 + doc/models/subscription-collection.md | 52 + .../subscription-customer-information.md | 32 + doc/models/subscription-error-exception.md | 107 +++ .../subscription-patch-application-context.md | 35 + doc/models/subscription-payer-name.md | 32 + .../subscription-payment-source-response.md | 35 + doc/models/subscription-payment-source.md | 29 + doc/models/subscription-plan-status.md | 17 + doc/models/subscription-pricing-model.md | 16 + doc/models/subscription-pricing-scheme.md | 60 ++ .../subscription-transaction-details.md | 64 ++ doc/models/subscription.md | 42 + doc/models/subscriptions-card-attributes.md | 41 + doc/models/subscriptions-card-brand.md | 39 + doc/models/supplementary-purchase-data.md | 25 - doc/models/suspend-subscription.md | 23 + doc/models/tax-amount.md | 26 + doc/models/taxes-override.md | 25 + doc/models/taxes.md | 25 + doc/models/tenure-type.md | 2 +- doc/models/transaction-details.md | 90 ++ doc/models/transaction-information.md | 60 ++ .../transaction-search-error-details.md | 31 + doc/models/transactions-list.md | 80 ++ doc/models/update-pricing-scheme.md | 59 ++ doc/models/update-pricing-schemes-request.md | 62 ++ doc/models/vault-apple-pay-request.md | 36 + ...xt.md => vault-card-experience-context.md} | 20 +- doc/models/vault-experience-context.md | 10 +- doc/models/vault-paypal-wallet-request.md | 3 +- doc/models/vault-response-customer.md | 2 +- doc/models/vault-response.md | 2 +- doc/models/vault-user-action.md | 16 + doc/models/vault-venmo-experience-context.md | 27 - doc/models/vault-venmo-request.md | 5 +- ...vaulted-digital-wallet-shipping-details.md | 2 + doc/models/vaulted-digital-wallet.md | 1 + doc/models/venmo-experience-context.md | 29 + doc/models/venmo-payment-token.md | 5 +- doc/models/venmo-vault-response-status.md | 17 + doc/models/venmo-vault-response.md | 58 ++ .../venmo-wallet-attributes-response.md | 25 +- ...experience-context-shipping-preference.md} | 4 +- ...o-wallet-experience-context-user-action.md | 16 + doc/models/venmo-wallet-experience-context.md | 4 +- doc/models/venmo-wallet-request.md | 3 +- doc/models/venmo-wallet-response.md | 2 + doc/proxy-settings.md | 31 + lib/paypal_server_sdk.rb | 412 ++++---- lib/paypal_server_sdk/api_helper.rb | 4 +- lib/paypal_server_sdk/client.rb | 19 +- lib/paypal_server_sdk/configuration.rb | 18 +- .../controllers/base_controller.rb | 12 +- .../o_auth_authorization_controller.rb | 8 +- .../controllers/orders_controller.rb | 422 ++++----- .../controllers/payments_controller.rb | 213 +++-- .../controllers/subscriptions_controller.rb | 843 +++++++++++++++++ .../transaction_search_controller.rb | 178 ++++ .../controllers/vault_controller.rb | 190 ++-- .../exceptions/api_exception.rb | 4 +- .../exceptions/default_error_exception.rb | 95 ++ .../exceptions/error_exception.rb | 4 +- .../exceptions/o_auth_provider_exception.rb | 4 +- .../exceptions/search_error_exception.rb | 107 +++ .../subscription_error_exception.rb | 95 ++ lib/paypal_server_sdk/http/api_response.rb | 6 +- lib/paypal_server_sdk/http/auth/o_auth2.rb | 6 +- lib/paypal_server_sdk/http/http_call_back.rb | 4 +- .../http/http_method_enum.rb | 4 +- lib/paypal_server_sdk/http/http_request.rb | 4 +- lib/paypal_server_sdk/http/http_response.rb | 4 +- lib/paypal_server_sdk/http/proxy_settings.rb | 13 + .../api_logging_configuration.rb | 4 +- lib/paypal_server_sdk/logging/sdk_logger.rb | 4 +- .../models/activate_subscription_request.rb | 63 ++ .../models/activity_timestamps.rb | 4 +- lib/paypal_server_sdk/models/address.rb | 4 +- .../models/amount_breakdown.rb | 8 +- .../models/amount_with_breakdown.rb | 4 +- .../models/app_switch_context.rb | 74 ++ .../models/apple_pay_attributes.rb | 4 +- .../models/apple_pay_attributes_response.rb | 4 +- .../models/apple_pay_card.rb | 4 +- .../models/apple_pay_card_response.rb | 4 +- .../models/apple_pay_decrypted_token_data.rb | 4 +- .../models/apple_pay_experience_context.rb | 4 +- .../models/apple_pay_payment_data.rb | 4 +- .../models/apple_pay_payment_data_type.rb | 4 +- .../models/apple_pay_payment_object.rb | 4 +- .../models/apple_pay_payment_token.rb | 4 +- .../models/apple_pay_request.rb | 4 +- .../models/apple_pay_request_card.rb | 88 ++ .../models/apple_pay_tokenized_card.rb | 7 +- .../models/application_context_user_action.rb | 29 + .../models/assurance_details.rb | 4 +- .../models/auction_information.rb | 100 ++ .../models/authentication_response.rb | 4 +- lib/paypal_server_sdk/models/authorization.rb | 8 +- .../models/authorization_incomplete_reason.rb | 4 +- .../models/authorization_status.rb | 4 +- .../models/authorization_status_details.rb | 4 +- .../authorization_status_with_details.rb | 4 +- .../authorization_with_additional_data.rb | 8 +- lib/paypal_server_sdk/models/avs_code.rb | 4 +- .../models/balance_information.rb | 106 +++ .../models/balances_response.rb | 111 +++ .../models/bancontact_payment_object.rb | 4 +- .../models/bancontact_payment_request.rb | 4 +- lib/paypal_server_sdk/models/bank_request.rb | 71 ++ lib/paypal_server_sdk/models/base_model.rb | 4 +- lib/paypal_server_sdk/models/billing_cycle.rb | 25 +- .../models/billing_cycle_override.rb | 91 ++ lib/paypal_server_sdk/models/billing_plan.rb | 212 +++++ lib/paypal_server_sdk/models/bin_details.rb | 4 +- .../models/blik_experience_context.rb | 18 +- .../models/blik_level0_payment_object.rb | 4 +- .../models/blik_one_click_payment_object.rb | 4 +- .../models/blik_one_click_payment_request.rb | 4 +- .../models/blik_payment_object.rb | 4 +- .../models/blik_payment_request.rb | 4 +- .../models/callback_configuration.rb | 4 +- .../models/callback_events.rb | 4 +- .../models/cancel_subscription_request.rb | 60 ++ .../models/capture_incomplete_reason.rb | 4 +- .../models/capture_payment_instruction.rb | 4 +- .../models/capture_request.rb | 65 +- .../models/capture_status.rb | 4 +- .../models/capture_status_details.rb | 4 +- .../models/capture_status_with_details.rb | 4 +- .../models/capture_subscription_request.rb | 78 ++ lib/paypal_server_sdk/models/capture_type.rb | 20 + .../models/captured_payment.rb | 12 +- .../models/card_attributes.rb | 4 +- .../models/card_attributes_response.rb | 4 +- .../models/card_authentication_response.rb | 4 +- lib/paypal_server_sdk/models/card_brand.rb | 19 +- lib/paypal_server_sdk/models/card_customer.rb | 98 ++ .../models/card_customer_information.rb | 4 +- .../models/card_experience_context.rb | 4 +- .../models/card_from_request.rb | 4 +- .../models/card_payment_token_entity.rb | 4 +- lib/paypal_server_sdk/models/card_request.rb | 4 +- lib/paypal_server_sdk/models/card_response.rb | 4 +- .../models/card_response_address.rb | 4 +- .../card_response_with_billing_address.rb | 100 ++ .../models/card_stored_credential.rb | 8 +- .../models/card_supplementary_data.rb | 4 +- lib/paypal_server_sdk/models/card_type.rb | 4 +- .../models/card_vault_response.rb | 4 +- .../models/card_verification.rb | 4 +- .../models/card_verification_details.rb | 16 +- .../card_verification_processor_response.rb | 4 +- .../models/card_verification_status.rb | 4 +- .../models/cart_information.rb | 94 ++ .../models/checkout_option.rb | 77 ++ .../models/checkout_payment_intent.rb | 4 +- .../models/cobranded_card.rb | 4 +- .../models/confirm_order_request.rb | 4 +- .../models/create_subscription_request.rb | 151 +++ lib/paypal_server_sdk/models/customer.rb | 4 +- .../models/customer_information.rb | 4 +- .../models/customer_response.rb | 4 +- .../customer_vault_payment_tokens_response.rb | 4 +- lib/paypal_server_sdk/models/cvv_code.rb | 4 +- .../models/cycle_execution.rb | 124 +++ .../models/disbursement_mode.rb | 4 +- .../models/dispute_category.rb | 4 +- lib/paypal_server_sdk/models/eci_flag.rb | 4 +- .../models/enrollment_status.rb | 4 +- .../models/eps_payment_object.rb | 4 +- .../models/eps_payment_request.rb | 4 +- lib/paypal_server_sdk/models/error_details.rb | 4 +- lib/paypal_server_sdk/models/exchange_rate.rb | 4 +- .../models/experience_context.rb | 16 +- .../experience_context_shipping_preference.rb | 32 + .../models/experience_status.rb | 33 + .../models/failed_payment_details.rb | 98 ++ lib/paypal_server_sdk/models/frequency.rb | 75 ++ .../models/fulfillment_type.rb | 4 +- .../models/giropay_payment_object.rb | 4 +- .../models/giropay_payment_request.rb | 4 +- .../google_pay_authentication_method.rb | 4 +- .../models/google_pay_card.rb | 4 +- .../models/google_pay_card_response.rb | 4 +- .../models/google_pay_decrypted_token_data.rb | 4 +- .../models/google_pay_experience_context.rb | 4 +- .../models/google_pay_payment_method.rb | 4 +- .../models/google_pay_request.rb | 4 +- .../models/google_pay_request_card.rb | 4 +- .../models/google_pay_wallet_response.rb | 4 +- .../models/ideal_payment_object.rb | 4 +- .../models/ideal_payment_request.rb | 4 +- .../models/incentive_details.rb | 99 ++ .../models/incentive_information.rb | 71 ++ lib/paypal_server_sdk/models/interval_unit.rb | 29 + lib/paypal_server_sdk/models/item.rb | 4 +- lib/paypal_server_sdk/models/item_category.rb | 4 +- lib/paypal_server_sdk/models/item_details.rb | 287 ++++++ lib/paypal_server_sdk/models/item_request.rb | 163 ++++ .../models/last_payment_details.rb | 75 ++ .../models/level2_card_processing_data.rb | 4 +- .../models/level3_card_processing_data.rb | 4 +- .../models/liability_shift_indicator.rb | 4 +- lib/paypal_server_sdk/models/line_item.rb | 4 +- .../models/link_description.rb | 4 +- .../models/link_http_method.rb | 20 +- .../models/merchant_preferences.rb | 73 ++ .../models/mobile_return_flow.rb | 28 + .../models/mobile_web_context.rb | 76 ++ .../models/modify_subscription_request.rb | 124 +++ .../models/modify_subscription_response.rb | 141 +++ lib/paypal_server_sdk/models/money.rb | 4 +- .../models/mybank_payment_object.rb | 4 +- .../models/mybank_payment_request.rb | 4 +- lib/paypal_server_sdk/models/name.rb | 4 +- .../models/native_app_context.rb | 72 ++ .../models/net_amount_breakdown_item.rb | 4 +- lib/paypal_server_sdk/models/network_token.rb | 4 +- ...on_reference.rb => network_transaction.rb} | 25 +- .../network_transaction_reference_entity.rb | 4 +- .../models/o_auth_provider_error.rb | 4 +- lib/paypal_server_sdk/models/o_auth_token.rb | 4 +- .../models/one_time_charge.rb | 4 +- lib/paypal_server_sdk/models/order.rb | 11 +- .../models/order_application_context.rb | 41 +- .../order_application_context_landing_page.rb | 4 +- ...application_context_shipping_preference.rb | 8 +- .../order_application_context_user_action.rb | 4 +- .../models/order_authorize_request.rb | 4 +- .../order_authorize_request_payment_source.rb | 4 +- .../models/order_authorize_response.rb | 25 +- ...order_authorize_response_payment_source.rb | 4 +- .../models/order_billing_plan.rb | 4 +- .../models/order_capture_request.rb | 4 +- .../order_capture_request_payment_source.rb | 4 +- .../order_confirm_application_context.rb | 4 +- lib/paypal_server_sdk/models/order_request.rb | 11 +- lib/paypal_server_sdk/models/order_status.rb | 4 +- .../models/order_tracker_item.rb | 4 +- .../models/order_tracker_request.rb | 4 +- .../models/order_tracker_response.rb | 4 +- .../models/order_tracker_status.rb | 4 +- .../order_update_callback_error_response.rb | 89 -- .../models/order_update_callback_request.rb | 111 --- .../models/order_update_callback_response.rb | 72 -- .../order_update_callback_shipping_address.rb | 107 --- .../order_update_callback_shipping_option.rb | 93 -- .../models/orders_capture.rb | 8 +- .../models/orders_card_verification_method.rb | 4 +- lib/paypal_server_sdk/models/os_type.rb | 26 + .../models/p24_payment_object.rb | 4 +- .../models/p24_payment_request.rb | 4 +- lib/paypal_server_sdk/models/pa_res_status.rb | 4 +- .../models/participant_metadata.rb | 4 +- lib/paypal_server_sdk/models/patch.rb | 4 +- lib/paypal_server_sdk/models/patch_op.rb | 4 +- lib/paypal_server_sdk/models/payee_base.rb | 4 +- .../models/payee_payment_method_preference.rb | 4 +- lib/paypal_server_sdk/models/payer.rb | 7 +- lib/paypal_server_sdk/models/payer_base.rb | 4 +- .../models/payer_information.rb | 146 +++ lib/paypal_server_sdk/models/payer_name.rb | 128 +++ .../models/payment_advice_code.rb | 4 +- .../models/payment_authorization.rb | 8 +- .../models/payment_collection.rb | 4 +- .../models/payment_initiator.rb | 4 +- .../models/payment_instruction.rb | 4 +- .../models/payment_method.rb | 63 ++ .../models/payment_method_preference.rb | 4 +- .../models/payment_preferences.rb | 105 ++ .../models/payment_preferences_override.rb | 107 +++ .../models/payment_source.rb | 4 +- .../models/payment_source_response.rb | 4 +- .../models/payment_supplementary_data.rb | 4 +- .../models/payment_token_request.rb | 4 +- .../models/payment_token_request_card.rb | 4 +- .../payment_token_request_payment_source.rb | 4 +- .../models/payment_token_response.rb | 8 +- .../payment_token_response_payment_source.rb | 8 +- .../models/payment_token_status.rb | 8 +- .../models/payments_capture.rb | 12 +- .../models/payments_payment_advice_code.rb | 42 - .../models/payments_processor_response.rb | 98 -- .../models/paypal_experience_landing_page.rb | 13 +- .../models/paypal_experience_user_action.rb | 4 +- .../models/paypal_payment_token.rb | 15 +- .../paypal_payment_token_customer_type.rb | 4 +- .../models/paypal_payment_token_usage_type.rb | 4 +- .../models/paypal_reference_id_type.rb | 29 + lib/paypal_server_sdk/models/paypal_wallet.rb | 4 +- ...ypal_wallet_account_verification_status.rb | 4 +- .../models/paypal_wallet_attributes.rb | 7 +- .../paypal_wallet_attributes_response.rb | 4 +- .../paypal_wallet_contact_preference.rb | 4 +- ...ypal_wallet_context_shipping_preference.rb | 4 +- .../models/paypal_wallet_customer.rb | 4 +- .../models/paypal_wallet_customer_request.rb | 4 +- .../paypal_wallet_experience_context.rb | 31 +- .../models/paypal_wallet_response.rb | 27 +- .../models/paypal_wallet_stored_credential.rb | 7 +- .../models/paypal_wallet_vault_instruction.rb | 34 +- .../models/paypal_wallet_vault_response.rb | 4 +- .../models/paypal_wallet_vault_status.rb | 4 +- lib/paypal_server_sdk/models/phone.rb | 4 +- lib/paypal_server_sdk/models/phone_number.rb | 6 +- .../models/phone_number_with_country_code.rb | 6 +- ...phone_number_with_optional_country_code.rb | 81 ++ lib/paypal_server_sdk/models/phone_type.rb | 14 +- .../models/phone_with_type.rb | 4 +- lib/paypal_server_sdk/models/plan.rb | 24 +- .../models/plan_collection.rb | 111 +++ lib/paypal_server_sdk/models/plan_details.rb | 147 +++ lib/paypal_server_sdk/models/plan_override.rb | 96 ++ lib/paypal_server_sdk/models/plan_request.rb | 154 +++ .../models/plan_request_status.rb | 28 + lib/paypal_server_sdk/models/platform_fee.rb | 4 +- lib/paypal_server_sdk/models/pricing_model.rb | 4 +- .../models/pricing_scheme.rb | 4 +- lib/paypal_server_sdk/models/pricing_tier.rb | 83 ++ .../models/processor_response.rb | 4 +- .../models/processor_response_code.rb | 4 +- lib/paypal_server_sdk/models/purchase_unit.rb | 4 +- .../models/purchase_unit_request.rb | 38 +- lib/paypal_server_sdk/models/reason_code.rb | 41 + .../models/reauthorize_request.rb | 5 +- lib/paypal_server_sdk/models/refund.rb | 4 +- .../models/refund_incomplete_reason.rb | 4 +- .../models/refund_payment_instruction.rb | 4 +- .../models/refund_platform_fee.rb | 4 +- .../models/refund_request.rb | 4 +- lib/paypal_server_sdk/models/refund_status.rb | 4 +- .../models/refund_status_details.rb | 4 +- .../models/refund_status_with_details.rb | 4 +- .../models/related_identifiers.rb | 4 +- lib/paypal_server_sdk/models/return_flow.rb | 28 + .../models/risk_supplementary_data.rb | 4 +- .../models/search_response.rb | 176 ++++ .../models/seller_payable_breakdown.rb | 4 +- .../models/seller_protection.rb | 4 +- .../models/seller_protection_status.rb | 4 +- .../models/seller_receivable_breakdown.rb | 4 +- .../models/sepa_debit_experience_context.rb | 88 ++ .../models/sepa_debit_request.rb | 64 ++ .../models/setup_fee_failure_action.rb | 24 + .../models/setup_token_request.rb | 4 +- .../models/setup_token_request_card.rb | 10 +- .../setup_token_request_payment_source.rb | 35 +- .../models/setup_token_response.rb | 8 +- .../models/setup_token_response_card.rb | 4 +- .../setup_token_response_payment_source.rb | 8 +- .../models/shipment_carrier.rb | 114 ++- .../models/shipping_details.rb | 4 +- .../models/shipping_information.rb | 101 ++ lib/paypal_server_sdk/models/shipping_name.rb | 4 +- .../models/shipping_option.rb | 4 +- .../models/shipping_options_purchase_unit.rb | 121 --- lib/paypal_server_sdk/models/shipping_type.rb | 4 +- .../models/shipping_with_tracking_details.rb | 66 +- .../simple_postal_address_coarse_grained.rb | 130 +++ .../models/sofort_payment_object.rb | 4 +- .../models/sofort_payment_request.rb | 4 +- .../models/standard_entry_class_code.rb | 4 +- .../models/store_in_vault_instruction.rb | 4 +- .../models/store_information.rb | 71 ++ .../models/stored_payment_source.rb | 8 +- .../stored_payment_source_payment_type.rb | 4 +- .../stored_payment_source_usage_type.rb | 4 +- lib/paypal_server_sdk/models/subscriber.rb | 84 ++ .../models/subscriber_request.rb | 97 ++ lib/paypal_server_sdk/models/subscription.rb | 205 ++++ .../subscription_amount_with_breakdown.rb | 119 +++ .../subscription_application_context.rb | 134 +++ .../models/subscription_billing_cycle.rb | 108 +++ .../subscription_billing_information.rb | 148 +++ .../models/subscription_card_request.rb | 141 +++ .../models/subscription_collection.rb | 90 ++ .../subscription_customer_information.rb | 84 ++ .../subscription_patch_application_context.rb | 122 +++ .../models/subscription_payer_name.rb | 114 +++ .../models/subscription_payment_source.rb | 65 ++ .../subscription_payment_source_response.rb | 63 ++ .../models/subscription_plan_status.rb | 28 + .../models/subscription_pricing_model.rb | 23 + .../models/subscription_pricing_scheme.rb | 129 +++ .../subscription_transaction_details.rb | 118 +++ .../models/subscriptions_card_attributes.rb | 83 ++ .../models/subscriptions_card_brand.rb | 97 ++ .../models/supplementary_data.rb | 4 +- .../models/supplementary_purchase_data.rb | 76 -- .../models/suspend_subscription.rb | 60 ++ lib/paypal_server_sdk/models/tax_amount.rb | 63 ++ lib/paypal_server_sdk/models/tax_id_type.rb | 4 +- lib/paypal_server_sdk/models/tax_info.rb | 4 +- lib/paypal_server_sdk/models/taxes.rb | 71 ++ .../models/taxes_override.rb | 72 ++ lib/paypal_server_sdk/models/tenure_type.rb | 8 +- .../three_d_secure_authentication_response.rb | 4 +- ...e_d_secure_card_authentication_response.rb | 4 +- lib/paypal_server_sdk/models/token.rb | 4 +- lib/paypal_server_sdk/models/token_type.rb | 4 +- .../models/transaction_details.rb | 126 +++ .../models/transaction_information.rb | 494 ++++++++++ ...rb => transaction_search_error_details.rb} | 42 +- .../models/transactions_list.rb | 111 +++ .../models/trustly_payment_object.rb | 4 +- .../models/trustly_payment_request.rb | 4 +- .../models/universal_product_code.rb | 4 +- lib/paypal_server_sdk/models/upc_type.rb | 4 +- .../models/update_pricing_scheme.rb | 72 ++ .../models/update_pricing_schemes_request.rb | 69 ++ lib/paypal_server_sdk/models/usage_pattern.rb | 4 +- .../models/vault_apple_pay_request.rb | 73 ++ ...xt.rb => vault_card_experience_context.rb} | 45 +- .../models/vault_card_verification_method.rb | 4 +- .../models/vault_customer.rb | 4 +- .../models/vault_experience_context.rb | 47 +- .../models/vault_instruction.rb | 4 +- .../models/vault_instruction_action.rb | 4 +- .../models/vault_instruction_base.rb | 4 +- .../models/vault_paypal_wallet_request.rb | 6 +- .../models/vault_response.rb | 4 +- .../models/vault_response_customer.rb | 4 +- lib/paypal_server_sdk/models/vault_status.rb | 4 +- .../models/vault_token_request.rb | 4 +- .../models/vault_token_request_type.rb | 4 +- .../models/vault_user_action.rb | 29 + .../models/vault_venmo_request.rb | 12 +- .../models/vaulted_digital_wallet.rb | 4 +- ...vaulted_digital_wallet_shipping_details.rb | 28 +- ...context.rb => venmo_experience_context.rb} | 42 +- .../models/venmo_payment_token.rb | 15 +- .../venmo_payment_token_customer_type.rb | 4 +- .../venmo_payment_token_usage_pattern.rb | 4 +- .../models/venmo_payment_token_usage_type.rb | 4 +- .../models/venmo_vault_response.rb | 100 ++ .../models/venmo_vault_response_status.rb | 31 + .../venmo_wallet_additional_attributes.rb | 4 +- .../venmo_wallet_attributes_response.rb | 10 +- .../venmo_wallet_customer_information.rb | 4 +- .../models/venmo_wallet_experience_context.rb | 34 +- ...experience_context_shipping_preference.rb} | 8 +- ...o_wallet_experience_context_user_action.rb | 29 + .../models/venmo_wallet_request.rb | 4 +- .../models/venmo_wallet_response.rb | 22 +- .../models/venmo_wallet_vault_attributes.rb | 4 +- .../utilities/date_time_helper.rb | 4 +- .../utilities/file_wrapper.rb | 4 +- paypal_server_sdk.gemspec | 8 +- 630 files changed, 18020 insertions(+), 3342 deletions(-) delete mode 100644 CHANGELOG.md create mode 100644 doc/controllers/subscriptions.md create mode 100644 doc/controllers/transactionsearch.md create mode 100644 doc/models/activate-subscription-request.md create mode 100644 doc/models/app-switch-context.md create mode 100644 doc/models/apple-pay-request-card.md create mode 100644 doc/models/application-context-user-action.md create mode 100644 doc/models/auction-information.md create mode 100644 doc/models/balance-information.md create mode 100644 doc/models/balances-response.md create mode 100644 doc/models/bank-request.md create mode 100644 doc/models/billing-cycle-override.md create mode 100644 doc/models/billing-plan.md create mode 100644 doc/models/cancel-subscription-request.md create mode 100644 doc/models/capture-subscription-request.md create mode 100644 doc/models/capture-type.md create mode 100644 doc/models/card-customer.md create mode 100644 doc/models/card-response-with-billing-address.md create mode 100644 doc/models/cart-information.md create mode 100644 doc/models/checkout-option.md create mode 100644 doc/models/create-subscription-request.md create mode 100644 doc/models/cycle-execution.md create mode 100644 doc/models/default-error-exception.md create mode 100644 doc/models/experience-context-shipping-preference.md create mode 100644 doc/models/experience-status.md create mode 100644 doc/models/failed-payment-details.md create mode 100644 doc/models/frequency.md create mode 100644 doc/models/incentive-details.md create mode 100644 doc/models/incentive-information.md create mode 100644 doc/models/interval-unit.md create mode 100644 doc/models/item-details.md create mode 100644 doc/models/item-request.md create mode 100644 doc/models/last-payment-details.md create mode 100644 doc/models/merchant-preferences.md create mode 100644 doc/models/mobile-return-flow.md create mode 100644 doc/models/mobile-web-context.md create mode 100644 doc/models/modify-subscription-request.md create mode 100644 doc/models/modify-subscription-response.md create mode 100644 doc/models/native-app-context.md rename doc/models/{network-transaction-reference.md => network-transaction.md} (74%) delete mode 100644 doc/models/order-update-callback-error-response-details.md delete mode 100644 doc/models/order-update-callback-error-response.md delete mode 100644 doc/models/order-update-callback-request.md delete mode 100644 doc/models/order-update-callback-response.md delete mode 100644 doc/models/order-update-callback-shipping-address.md delete mode 100644 doc/models/order-update-callback-shipping-option.md create mode 100644 doc/models/os-type.md create mode 100644 doc/models/payer-information.md create mode 100644 doc/models/payer-name.md create mode 100644 doc/models/payment-method.md create mode 100644 doc/models/payment-preferences-override.md create mode 100644 doc/models/payment-preferences.md delete mode 100644 doc/models/payments-payment-advice-code.md delete mode 100644 doc/models/payments-processor-response.md create mode 100644 doc/models/paypal-reference-id-type.md create mode 100644 doc/models/phone-number-with-optional-country-code.md create mode 100644 doc/models/plan-collection.md create mode 100644 doc/models/plan-details.md create mode 100644 doc/models/plan-override.md create mode 100644 doc/models/plan-request-status.md create mode 100644 doc/models/plan-request.md create mode 100644 doc/models/pricing-tier.md create mode 100644 doc/models/reason-code.md create mode 100644 doc/models/return-flow.md create mode 100644 doc/models/search-error-exception.md create mode 100644 doc/models/search-response.md create mode 100644 doc/models/sepa-debit-experience-context.md create mode 100644 doc/models/sepa-debit-request.md create mode 100644 doc/models/setup-fee-failure-action.md create mode 100644 doc/models/shipping-information.md delete mode 100644 doc/models/shipping-options-purchase-unit.md create mode 100644 doc/models/simple-postal-address-coarse-grained.md create mode 100644 doc/models/store-information.md create mode 100644 doc/models/subscriber-request.md create mode 100644 doc/models/subscriber.md create mode 100644 doc/models/subscription-amount-with-breakdown.md create mode 100644 doc/models/subscription-application-context.md create mode 100644 doc/models/subscription-billing-cycle.md create mode 100644 doc/models/subscription-billing-information.md create mode 100644 doc/models/subscription-card-request.md create mode 100644 doc/models/subscription-collection.md create mode 100644 doc/models/subscription-customer-information.md create mode 100644 doc/models/subscription-error-exception.md create mode 100644 doc/models/subscription-patch-application-context.md create mode 100644 doc/models/subscription-payer-name.md create mode 100644 doc/models/subscription-payment-source-response.md create mode 100644 doc/models/subscription-payment-source.md create mode 100644 doc/models/subscription-plan-status.md create mode 100644 doc/models/subscription-pricing-model.md create mode 100644 doc/models/subscription-pricing-scheme.md create mode 100644 doc/models/subscription-transaction-details.md create mode 100644 doc/models/subscription.md create mode 100644 doc/models/subscriptions-card-attributes.md create mode 100644 doc/models/subscriptions-card-brand.md delete mode 100644 doc/models/supplementary-purchase-data.md create mode 100644 doc/models/suspend-subscription.md create mode 100644 doc/models/tax-amount.md create mode 100644 doc/models/taxes-override.md create mode 100644 doc/models/taxes.md create mode 100644 doc/models/transaction-details.md create mode 100644 doc/models/transaction-information.md create mode 100644 doc/models/transaction-search-error-details.md create mode 100644 doc/models/transactions-list.md create mode 100644 doc/models/update-pricing-scheme.md create mode 100644 doc/models/update-pricing-schemes-request.md create mode 100644 doc/models/vault-apple-pay-request.md rename doc/models/{setup-token-card-experience-context.md => vault-card-experience-context.md} (66%) create mode 100644 doc/models/vault-user-action.md delete mode 100644 doc/models/vault-venmo-experience-context.md create mode 100644 doc/models/venmo-experience-context.md create mode 100644 doc/models/venmo-vault-response-status.md create mode 100644 doc/models/venmo-vault-response.md rename doc/models/{shipping-preference.md => venmo-wallet-experience-context-shipping-preference.md} (83%) create mode 100644 doc/models/venmo-wallet-experience-context-user-action.md create mode 100644 doc/proxy-settings.md create mode 100644 lib/paypal_server_sdk/controllers/subscriptions_controller.rb create mode 100644 lib/paypal_server_sdk/controllers/transaction_search_controller.rb create mode 100644 lib/paypal_server_sdk/exceptions/default_error_exception.rb create mode 100644 lib/paypal_server_sdk/exceptions/search_error_exception.rb create mode 100644 lib/paypal_server_sdk/exceptions/subscription_error_exception.rb create mode 100644 lib/paypal_server_sdk/http/proxy_settings.rb create mode 100644 lib/paypal_server_sdk/models/activate_subscription_request.rb create mode 100644 lib/paypal_server_sdk/models/app_switch_context.rb create mode 100644 lib/paypal_server_sdk/models/apple_pay_request_card.rb create mode 100644 lib/paypal_server_sdk/models/application_context_user_action.rb create mode 100644 lib/paypal_server_sdk/models/auction_information.rb create mode 100644 lib/paypal_server_sdk/models/balance_information.rb create mode 100644 lib/paypal_server_sdk/models/balances_response.rb create mode 100644 lib/paypal_server_sdk/models/bank_request.rb create mode 100644 lib/paypal_server_sdk/models/billing_cycle_override.rb create mode 100644 lib/paypal_server_sdk/models/billing_plan.rb create mode 100644 lib/paypal_server_sdk/models/cancel_subscription_request.rb create mode 100644 lib/paypal_server_sdk/models/capture_subscription_request.rb create mode 100644 lib/paypal_server_sdk/models/capture_type.rb create mode 100644 lib/paypal_server_sdk/models/card_customer.rb create mode 100644 lib/paypal_server_sdk/models/card_response_with_billing_address.rb create mode 100644 lib/paypal_server_sdk/models/cart_information.rb create mode 100644 lib/paypal_server_sdk/models/checkout_option.rb create mode 100644 lib/paypal_server_sdk/models/create_subscription_request.rb create mode 100644 lib/paypal_server_sdk/models/cycle_execution.rb create mode 100644 lib/paypal_server_sdk/models/experience_context_shipping_preference.rb create mode 100644 lib/paypal_server_sdk/models/experience_status.rb create mode 100644 lib/paypal_server_sdk/models/failed_payment_details.rb create mode 100644 lib/paypal_server_sdk/models/frequency.rb create mode 100644 lib/paypal_server_sdk/models/incentive_details.rb create mode 100644 lib/paypal_server_sdk/models/incentive_information.rb create mode 100644 lib/paypal_server_sdk/models/interval_unit.rb create mode 100644 lib/paypal_server_sdk/models/item_details.rb create mode 100644 lib/paypal_server_sdk/models/item_request.rb create mode 100644 lib/paypal_server_sdk/models/last_payment_details.rb create mode 100644 lib/paypal_server_sdk/models/merchant_preferences.rb create mode 100644 lib/paypal_server_sdk/models/mobile_return_flow.rb create mode 100644 lib/paypal_server_sdk/models/mobile_web_context.rb create mode 100644 lib/paypal_server_sdk/models/modify_subscription_request.rb create mode 100644 lib/paypal_server_sdk/models/modify_subscription_response.rb create mode 100644 lib/paypal_server_sdk/models/native_app_context.rb rename lib/paypal_server_sdk/models/{network_transaction_reference.rb => network_transaction.rb} (81%) delete mode 100644 lib/paypal_server_sdk/models/order_update_callback_error_response.rb delete mode 100644 lib/paypal_server_sdk/models/order_update_callback_request.rb delete mode 100644 lib/paypal_server_sdk/models/order_update_callback_response.rb delete mode 100644 lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb delete mode 100644 lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb create mode 100644 lib/paypal_server_sdk/models/os_type.rb create mode 100644 lib/paypal_server_sdk/models/payer_information.rb create mode 100644 lib/paypal_server_sdk/models/payer_name.rb create mode 100644 lib/paypal_server_sdk/models/payment_method.rb create mode 100644 lib/paypal_server_sdk/models/payment_preferences.rb create mode 100644 lib/paypal_server_sdk/models/payment_preferences_override.rb delete mode 100644 lib/paypal_server_sdk/models/payments_payment_advice_code.rb delete mode 100644 lib/paypal_server_sdk/models/payments_processor_response.rb create mode 100644 lib/paypal_server_sdk/models/paypal_reference_id_type.rb create mode 100644 lib/paypal_server_sdk/models/phone_number_with_optional_country_code.rb create mode 100644 lib/paypal_server_sdk/models/plan_collection.rb create mode 100644 lib/paypal_server_sdk/models/plan_details.rb create mode 100644 lib/paypal_server_sdk/models/plan_override.rb create mode 100644 lib/paypal_server_sdk/models/plan_request.rb create mode 100644 lib/paypal_server_sdk/models/plan_request_status.rb create mode 100644 lib/paypal_server_sdk/models/pricing_tier.rb create mode 100644 lib/paypal_server_sdk/models/reason_code.rb create mode 100644 lib/paypal_server_sdk/models/return_flow.rb create mode 100644 lib/paypal_server_sdk/models/search_response.rb create mode 100644 lib/paypal_server_sdk/models/sepa_debit_experience_context.rb create mode 100644 lib/paypal_server_sdk/models/sepa_debit_request.rb create mode 100644 lib/paypal_server_sdk/models/setup_fee_failure_action.rb create mode 100644 lib/paypal_server_sdk/models/shipping_information.rb delete mode 100644 lib/paypal_server_sdk/models/shipping_options_purchase_unit.rb create mode 100644 lib/paypal_server_sdk/models/simple_postal_address_coarse_grained.rb create mode 100644 lib/paypal_server_sdk/models/store_information.rb create mode 100644 lib/paypal_server_sdk/models/subscriber.rb create mode 100644 lib/paypal_server_sdk/models/subscriber_request.rb create mode 100644 lib/paypal_server_sdk/models/subscription.rb create mode 100644 lib/paypal_server_sdk/models/subscription_amount_with_breakdown.rb create mode 100644 lib/paypal_server_sdk/models/subscription_application_context.rb create mode 100644 lib/paypal_server_sdk/models/subscription_billing_cycle.rb create mode 100644 lib/paypal_server_sdk/models/subscription_billing_information.rb create mode 100644 lib/paypal_server_sdk/models/subscription_card_request.rb create mode 100644 lib/paypal_server_sdk/models/subscription_collection.rb create mode 100644 lib/paypal_server_sdk/models/subscription_customer_information.rb create mode 100644 lib/paypal_server_sdk/models/subscription_patch_application_context.rb create mode 100644 lib/paypal_server_sdk/models/subscription_payer_name.rb create mode 100644 lib/paypal_server_sdk/models/subscription_payment_source.rb create mode 100644 lib/paypal_server_sdk/models/subscription_payment_source_response.rb create mode 100644 lib/paypal_server_sdk/models/subscription_plan_status.rb create mode 100644 lib/paypal_server_sdk/models/subscription_pricing_model.rb create mode 100644 lib/paypal_server_sdk/models/subscription_pricing_scheme.rb create mode 100644 lib/paypal_server_sdk/models/subscription_transaction_details.rb create mode 100644 lib/paypal_server_sdk/models/subscriptions_card_attributes.rb create mode 100644 lib/paypal_server_sdk/models/subscriptions_card_brand.rb delete mode 100644 lib/paypal_server_sdk/models/supplementary_purchase_data.rb create mode 100644 lib/paypal_server_sdk/models/suspend_subscription.rb create mode 100644 lib/paypal_server_sdk/models/tax_amount.rb create mode 100644 lib/paypal_server_sdk/models/taxes.rb create mode 100644 lib/paypal_server_sdk/models/taxes_override.rb create mode 100644 lib/paypal_server_sdk/models/transaction_details.rb create mode 100644 lib/paypal_server_sdk/models/transaction_information.rb rename lib/paypal_server_sdk/models/{order_update_callback_error_response_details.rb => transaction_search_error_details.rb} (55%) create mode 100644 lib/paypal_server_sdk/models/transactions_list.rb create mode 100644 lib/paypal_server_sdk/models/update_pricing_scheme.rb create mode 100644 lib/paypal_server_sdk/models/update_pricing_schemes_request.rb create mode 100644 lib/paypal_server_sdk/models/vault_apple_pay_request.rb rename lib/paypal_server_sdk/models/{setup_token_card_experience_context.rb => vault_card_experience_context.rb} (71%) create mode 100644 lib/paypal_server_sdk/models/vault_user_action.rb rename lib/paypal_server_sdk/models/{vault_venmo_experience_context.rb => venmo_experience_context.rb} (60%) create mode 100644 lib/paypal_server_sdk/models/venmo_vault_response.rb create mode 100644 lib/paypal_server_sdk/models/venmo_vault_response_status.rb rename lib/paypal_server_sdk/models/{shipping_preference.rb => venmo_wallet_experience_context_shipping_preference.rb} (78%) create mode 100644 lib/paypal_server_sdk/models/venmo_wallet_experience_context_user_action.rb diff --git a/.rubocop.yml b/.rubocop.yml index 08c50fe..b563c46 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -51,6 +51,9 @@ Style/MultilineTernaryOperator: Layout/MultilineMethodCallIndentation: Enabled: false +Style/OptionalBooleanParameter: + Enabled: false + Style/KeywordParametersOrder: Enabled: false diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 176ecf9..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -## 1.1.0 -- Added new models to support Apple Pay, Google Pay -- Expanded models to support additional optional fields -- Bug fixes -- Documentation updates - -## 1.0.0 -- GA Release for Orders, Payments, and Vault APIs \ No newline at end of file diff --git a/README.md b/README.md index 0f4ea5b..6745309 100644 --- a/README.md +++ b/README.md @@ -5,35 +5,37 @@ ### Important Notes -- **Available Features:** This SDK currently contains only 3 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future. +- **Available Features:** This SDK currently contains only 5 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future. ### Information The PayPal Server SDK provides integration access to the PayPal REST APIs. The API endpoints are divided into distinct controllers: - Orders Controller: [Orders API v2](https://developer.paypal.com/docs/api/orders/v2/) -- Payments Controller: [Payments API v2](https://developer.paypal.com/docs/api/payments/v2 +- Payments Controller: [Payments API v2](https://developer.paypal.com/docs/api/payments/v2) - Vault Controller: [Payment Method Tokens API v3](https://developer.paypal.com/docs/api/payment-tokens/v3/) *Available in the US only.* +- Transaction Search Controller: [Transaction Search API v1](https://developer.paypal.com/docs/api/transaction-search/v1/) +- Subscriptions Controller: [Subscriptions API v1](https://developer.paypal.com/docs/api/subscriptions/v1/) ## Install the Package Install the gem from the command line: ```bash -gem install paypal-server-sdk -v 1.1.0 +gem install paypal-server-sdk -v 2.0.0 ``` Or add the gem to your Gemfile and run `bundle`: ```ruby -gem 'paypal-server-sdk', '1.1.0' +gem 'paypal-server-sdk', '2.0.0' ``` -For additional gem details, see the [RubyGems page for the paypal-server-sdk gem](https://rubygems.org/gems/paypal-server-sdk/versions/1.1.0). +For additional gem details, see the [RubyGems page for the paypal-server-sdk gem](https://rubygems.org/gems/paypal-server-sdk/versions/2.0.0). ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/client.md) The following parameters are configurable for the API Client: @@ -49,13 +51,17 @@ The following parameters are configurable for the API Client: | retry_statuses | `Array` | A list of HTTP statuses to retry.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | | retry_methods | `Array` | A list of HTTP methods to retry.
**Default: %i[get put]** | | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. | -| logging_configuration | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/logging-configuration.md) | The SDK logging configuration for API calls | -| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant | +| proxy_settings | [`ProxySettings`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | +| logging_configuration | [`LoggingConfiguration`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/logging-configuration.md) | The SDK logging configuration for API calls | +| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant | The API client can be initialized as follows: ```ruby -client = PaypalServerSdk::Client.new( +require 'paypal_server_sdk' +include PaypalServerSdk + +client = Client.new( client_credentials_auth_credentials: ClientCredentialsAuthCredentials.new( o_auth_client_id: 'OAuthClientId', o_auth_client_secret: 'OAuthClientSecret' @@ -88,31 +94,34 @@ The SDK can be configured to use a different environment for making API calls. A This API uses the following authentication schemes. -* [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/auth/oauth-2-client-credentials-grant.md) +* [`Oauth2 (OAuth 2 Client Credentials Grant)`](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/auth/oauth-2-client-credentials-grant.md) ## List of APIs -* [Orders](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/controllers/orders.md) -* [Payments](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/controllers/payments.md) -* [Vault](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/controllers/vault.md) +* [Transactionsearch](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/controllers/transactionsearch.md) +* [Orders](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/controllers/orders.md) +* [Payments](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/controllers/payments.md) +* [Vault](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/controllers/vault.md) +* [Subscriptions](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/controllers/subscriptions.md) ## SDK Infrastructure ### Configuration -* [AbstractLogger](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/abstract-logger.md) -* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/logging-configuration.md) -* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/request-logging-configuration.md) -* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/response-logging-configuration.md) +* [ProxySettings](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/proxy-settings.md) +* [AbstractLogger](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/abstract-logger.md) +* [LoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/logging-configuration.md) +* [RequestLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/request-logging-configuration.md) +* [ResponseLoggingConfiguration](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/response-logging-configuration.md) ### HTTP -* [HttpResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/http-response.md) +* [HttpRequest](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/http-request.md) ### Utilities -* [ApiResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/api-response.md) -* [ApiHelper](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/api-helper.md) -* [DateTimeHelper](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/1.1.0/doc/date-time-helper.md) +* [ApiResponse](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/api-response.md) +* [ApiHelper](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/api-helper.md) +* [DateTimeHelper](https://www.github.com/paypal/PayPal-Ruby-Server-SDK/tree/2.0.0/doc/date-time-helper.md) diff --git a/doc/abstract-logger.md b/doc/abstract-logger.md index 0d9304e..4188e4f 100644 --- a/doc/abstract-logger.md +++ b/doc/abstract-logger.md @@ -38,7 +38,10 @@ end Following is how the custom logger implementation can be injected in the SDK client. ```ruby -client = PaypalServerSdk::Client.new( +require 'paypal_server_sdk' +include PaypalServerSdk + +client = Client.new( logging_configuration: LoggingConfiguration.new( logger: CustomLogger.new ) diff --git a/doc/auth/oauth-2-client-credentials-grant.md b/doc/auth/oauth-2-client-credentials-grant.md index 6f247f7..13e5a35 100644 --- a/doc/auth/oauth-2-client-credentials-grant.md +++ b/doc/auth/oauth-2-client-credentials-grant.md @@ -27,7 +27,10 @@ Documentation for accessing and setting credentials for Oauth2. You must initialize the client with *OAuth 2.0 Client Credentials Grant* credentials as shown in the following code snippet. This will fetch the OAuth token automatically when any of the endpoints, requiring *OAuth 2.0 Client Credentials Grant* authentication, are called. ```ruby -client = PaypalServerSdk::Client.new( +require 'paypal_server_sdk' +include PaypalServerSdk + +client = Client.new( client_credentials_auth_credentials: ClientCredentialsAuthCredentials.new( o_auth_client_id: 'OAuthClientId', o_auth_client_secret: 'OAuthClientSecret' @@ -44,7 +47,10 @@ Your application can also manually provide an OAuthToken using the setter `in` o Whenever the OAuth Token gets updated, the provided callback implementation will be executed. For instance, you may use it to store your access token whenever it gets updated. ```ruby -client = PaypalServerSdk::Client.new( +require 'paypal_server_sdk' +include PaypalServerSdk + +client = Client.new( client_credentials_auth_credentials: ClientCredentialsAuthCredentials.new( o_auth_client_id: 'OAuthClientId', o_auth_client_secret: 'OAuthClientSecret', @@ -62,6 +68,9 @@ client = PaypalServerSdk::Client.new( ```ruby +require 'paypal_server_sdk' +include PaypalServerSdk + def o_auth_token_provider(last_oauth_token, auth_manager) # Add the callback handler to provide a new OAuth token # It will be triggered whenever the last provided o_auth_token is null or expired @@ -75,7 +84,7 @@ _o_auth_token_provider = proc do | last_oauth_token, auth_manager | end -client = PaypalServerSdk::Client.new( +client = Client.new( client_credentials_auth_credentials: ClientCredentialsAuthCredentials.new( o_auth_client_id: 'OAuthClientId', o_auth_client_secret: 'OAuthClientSecret', diff --git a/doc/client.md b/doc/client.md index 7b3e171..93e1181 100644 --- a/doc/client.md +++ b/doc/client.md @@ -15,13 +15,17 @@ The following parameters are configurable for the API Client: | retry_statuses | `Array` | A list of HTTP statuses to retry.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | | retry_methods | `Array` | A list of HTTP methods to retry.
**Default: %i[get put]** | | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. | +| proxy_settings | [`ProxySettings`](../doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | | logging_configuration | [`LoggingConfiguration`](../doc/logging-configuration.md) | The SDK logging configuration for API calls | | client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant | The API client can be initialized as follows: ```ruby -client = PaypalServerSdk::Client.new( +require 'paypal_server_sdk' +include PaypalServerSdk + +client = Client.new( client_credentials_auth_credentials: ClientCredentialsAuthCredentials.new( o_auth_client_id: 'OAuthClientId', o_auth_client_secret: 'OAuthClientSecret' @@ -50,5 +54,7 @@ The gateway for the SDK. This class acts as a factory for the Controllers and al | orders | Gets OrdersController | | payments | Gets PaymentsController | | vault | Gets VaultController | +| transaction_search | Gets TransactionSearchController | +| subscriptions | Gets SubscriptionsController | | o_auth_authorization | Gets OAuthAuthorizationController | diff --git a/doc/controllers/orders.md b/doc/controllers/orders.md index 07719f6..a3a8976 100644 --- a/doc/controllers/orders.md +++ b/doc/controllers/orders.md @@ -12,50 +12,65 @@ orders_controller = client.orders ## Methods -* [Patch Order](../../doc/controllers/orders.md#patch-order) -* [Authorize Order](../../doc/controllers/orders.md#authorize-order) -* [Update Order Tracking](../../doc/controllers/orders.md#update-order-tracking) -* [Create Order Tracking](../../doc/controllers/orders.md#create-order-tracking) * [Create Order](../../doc/controllers/orders.md#create-order) -* [Capture Order](../../doc/controllers/orders.md#capture-order) * [Get Order](../../doc/controllers/orders.md#get-order) +* [Patch Order](../../doc/controllers/orders.md#patch-order) * [Confirm Order](../../doc/controllers/orders.md#confirm-order) +* [Authorize Order](../../doc/controllers/orders.md#authorize-order) +* [Capture Order](../../doc/controllers/orders.md#capture-order) +* [Create Order Tracking](../../doc/controllers/orders.md#create-order-tracking) +* [Update Order Tracking](../../doc/controllers/orders.md#update-order-tracking) -# Patch Order +# Create Order -Updates an order with a `CREATED` or `APPROVED` status. You cannot update an order with the `COMPLETED` status.

To make an update, you must provide a `reference_id`. If you omit this value with an order that contains only one purchase unit, PayPal sets the value to `default` which enables you to use the path: \"/purchase_units/@reference_id=='default'/{attribute-or-object}\". Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout.
Note: For error handling and troubleshooting, see Orders v2 errors.
Patchable attributes or objects:

AttributeOpNotes
intentreplace
payerreplace, addUsing replace op for payer will replace the whole payer object with the value sent in request.
purchase_unitsreplace, add
purchase_units[].custom_idreplace, add, remove
purchase_units[].descriptionreplace, add, remove
purchase_units[].payee.emailreplace
purchase_units[].shipping.namereplace, add
purchase_units[].shipping.email_addressreplace, add
purchase_units[].shipping.phone_numberreplace, add
purchase_units[].shipping.optionsreplace, add
purchase_units[].shipping.addressreplace, add
purchase_units[].shipping.typereplace, add
purchase_units[].soft_descriptorreplace, remove
purchase_units[].amountreplace
purchase_units[].itemsreplace, add, remove
purchase_units[].invoice_idreplace, add, remove
purchase_units[].payment_instructionreplace
purchase_units[].payment_instruction.disbursement_modereplaceBy default, disbursement_mode is INSTANT.
purchase_units[].payment_instruction.payee_receivable_fx_rate_idreplace, add, remove
purchase_units[].payment_instruction.platform_feesreplace, add, remove
purchase_units[].supplementary_data.airlinereplace, add, remove
purchase_units[].supplementary_data.cardreplace, add, remove
application_context.client_configurationreplace, add
+Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout. Note: For error handling and troubleshooting, see Orders v2 errors. ```ruby -def patch_order(options = {}) +def create_order(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order to update.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `body` | [`OrderRequest`](../../doc/models/order-request.md) | Body, Required | - | | `paypal_mock_response` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | +| `paypal_partner_attribution_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `paypal_client_metadata_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `body` | [`Array`](../../doc/models/patch.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). ## Example Usage ```ruby collect = { - 'id' => 'id0', - 'body' => [ - Patch.new( - op: PatchOp::ADD - ) - ] + 'body' => OrderRequest.new( + intent: CheckoutPaymentIntent::CAPTURE, + purchase_units: [ + PurchaseUnitRequest.new( + amount: AmountWithBreakdown.new( + currency_code: 'currency_code6', + value: 'value0' + ) + ) + ] + ), + 'prefer' => 'return=minimal' } -result = orders_controller.patch_order(collect) +result = orders_controller.create_order(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -64,75 +79,72 @@ result = orders_controller.patch_order(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | -| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Authorize Order +# Get Order -Authorizes payment for an order. To successfully authorize payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response. Note: For error handling and troubleshooting, see Orders v2 errors. +Shows details for an order, by ID. Note: For error handling and troubleshooting, see Orders v2 errors. ```ruby -def authorize_order(options = {}) +def get_order(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order for which to authorize.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `id` | `String` | Template, Required | The ID of the order for which to show details.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | | `paypal_mock_response` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | -| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | -| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | -| `paypal_client_metadata_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `body` | [`OrderAuthorizeRequest`](../../doc/models/order-authorize-request.md) | Body, Optional | - | +| `fields` | `String` | Query, Optional | A comma-separated list of fields that should be returned for the order. Valid filter field is `payment_source`.

**Constraints**: *Pattern*: `^[a-z_]*$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`OrderAuthorizeResponse`](../../doc/models/order-authorize-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). ## Example Usage ```ruby collect = { - 'id' => 'id0', - 'prefer' => 'return=minimal' + 'id' => 'id0' } -result = orders_controller.authorize_order(collect) +result = orders_controller.get_order(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | -| 403 | The authorized payment failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | -| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Update Order Tracking +# Patch Order -Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes or objects: Attribute Op Notes items replace Using replace op for items will replace the entire items object with the value sent in request. notify_payer replace, add status replace Only patching status to CANCELLED is currently supported. +Updates an order with a `CREATED` or `APPROVED` status. You cannot update an order with the `COMPLETED` status.

To make an update, you must provide a `reference_id`. If you omit this value with an order that contains only one purchase unit, PayPal sets the value to `default` which enables you to use the path: \"/purchase_units/@reference_id=='default'/{attribute-or-object}\". Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout.
Note: For error handling and troubleshooting, see Orders v2 errors.
Patchable attributes or objects:

AttributeOpNotes
intentreplace
payerreplace, addUsing replace op for payer will replace the whole payer object with the value sent in request.
purchase_unitsreplace, add
purchase_units[].custom_idreplace, add, remove
purchase_units[].descriptionreplace, add, remove
purchase_units[].payee.emailreplace
purchase_units[].shipping.namereplace, add
purchase_units[].shipping.email_addressreplace, add
purchase_units[].shipping.phone_numberreplace, add
purchase_units[].shipping.optionsreplace, add
purchase_units[].shipping.addressreplace, add
purchase_units[].shipping.typereplace, add
purchase_units[].soft_descriptorreplace, remove
purchase_units[].amountreplace
purchase_units[].itemsreplace, add, remove
purchase_units[].invoice_idreplace, add, remove
purchase_units[].payment_instructionreplace
purchase_units[].payment_instruction.disbursement_modereplaceBy default, disbursement_mode is INSTANT.
purchase_units[].payment_instruction.payee_receivable_fx_rate_idreplace, add, remove
purchase_units[].payment_instruction.platform_feesreplace, add, remove
purchase_units[].supplementary_data.airlinereplace, add, remove
purchase_units[].supplementary_data.cardreplace, add, remove
application_context.client_configurationreplace, add
```ruby -def update_order_tracking(options = {}) +def patch_order(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order that the tracking information is associated with.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `tracker_id` | `String` | Template, Required | The order tracking ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `id` | `String` | Template, Required | The ID of the order to update.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `paypal_mock_response` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `body` | [`Array`](../../doc/models/patch.md) | Body, Optional | - | +| `body` | [`Array[Patch]`](../../doc/models/patch.md) | Body, Optional | **Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | ## Response Type @@ -143,7 +155,6 @@ This method returns an [`ApiResponse`](../../doc/api-response.md) instance. ```ruby collect = { 'id' => 'id0', - 'tracker_id' => 'tracker_id2', 'body' => [ Patch.new( op: PatchOp::ADD @@ -151,7 +162,13 @@ collect = { ] } -result = orders_controller.update_order_tracking(collect) +result = orders_controller.patch_order(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -159,45 +176,49 @@ result = orders_controller.update_order_tracking(collect) | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | -| 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | -| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Order Tracking +# Confirm Order -Adds tracking information for an Order. +Payer confirms their intent to pay for the the Order with the given payment source. ```ruby -def create_order_tracking(options = {}) +def confirm_order(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order that the tracking information is associated with.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `body` | [`OrderTrackerRequest`](../../doc/models/order-tracker-request.md) | Body, Required | - | +| `id` | `String` | Template, Required | The ID of the order for which the payer confirms their intent to pay.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `paypal_client_metadata_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=]*$` | +| `body` | [`ConfirmOrderRequest`](../../doc/models/confirm-order-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`Order`](../../doc/models/order.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). ## Example Usage ```ruby collect = { 'id' => 'id0', - 'body' => OrderTrackerRequest.new( - capture_id: 'capture_id8', - notify_payer: false - ) + 'prefer' => 'return=minimal' } -result = orders_controller.create_order_tracking(collect) +result = orders_controller.confirm_order(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -206,55 +227,50 @@ result = orders_controller.create_order_tracking(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Order +# Authorize Order -Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see checkout or multiparty checkout. Note: For error handling and troubleshooting, see Orders v2 errors. +Authorizes payment for an order. To successfully authorize payment for an order, the buyer must first approve the order or a valid payment_source must be provided in the request. A buyer can approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the create order response. Note: For error handling and troubleshooting, see Orders v2 errors. ```ruby -def create_order(options = {}) +def authorize_order(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`OrderRequest`](../../doc/models/order-request.md) | Body, Required | - | +| `id` | `String` | Template, Required | The ID of the order for which to authorize.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | | `paypal_mock_response` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | | `paypal_request_id` | `String` | Header, Optional | The server stores keys for 6 hours. The API callers can request the times to up to 72 hours by speaking to their Account Manager. It is mandatory for all single-step create order calls (E.g. Create Order Request with payment source information like Card, PayPal.vault_id, PayPal.billing_agreement_id, etc).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108` | -| `paypal_partner_attribution_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `paypal_client_metadata_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=,-]*$` | +| `paypal_client_metadata_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | +| `body` | [`OrderAuthorizeRequest`](../../doc/models/order-authorize-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`Order`](../../doc/models/order.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`OrderAuthorizeResponse`](../../doc/models/order-authorize-response.md). ## Example Usage ```ruby collect = { - 'body' => OrderRequest.new( - intent: CheckoutPaymentIntent::CAPTURE, - purchase_units: [ - PurchaseUnitRequest.new( - amount: AmountWithBreakdown.new( - currency_code: 'currency_code6', - value: 'value0' - ) - ) - ] - ), + 'id' => 'id0', 'prefer' => 'return=minimal' } -result = orders_controller.create_order(collect) +result = orders_controller.authorize_order(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -263,7 +279,10 @@ result = orders_controller.create_order(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | The authorized payment failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | +| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | @@ -289,7 +308,7 @@ def capture_order(options = {}) ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`Order`](../../doc/models/order.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). ## Example Usage @@ -300,6 +319,12 @@ collect = { } result = orders_controller.capture_order(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -315,77 +340,99 @@ result = orders_controller.capture_order(collect) | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Order +# Create Order Tracking -Shows details for an order, by ID. Note: For error handling and troubleshooting, see Orders v2 errors. +Adds tracking information for an Order. ```ruby -def get_order(options = {}) +def create_order_tracking(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order for which to show details.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `paypal_mock_response` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | +| `id` | `String` | Template, Required | The ID of the order that the tracking information is associated with.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `body` | [`OrderTrackerRequest`](../../doc/models/order-tracker-request.md) | Body, Required | - | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `fields` | `String` | Query, Optional | A comma-separated list of fields that should be returned for the order. Valid filter field is `payment_source`.

**Constraints**: *Pattern*: `^[a-z_]*$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`Order`](../../doc/models/order.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`Order`](../../doc/models/order.md). ## Example Usage ```ruby collect = { - 'id' => 'id0' + 'id' => 'id0', + 'body' => OrderTrackerRequest.new( + capture_id: 'capture_id8', + notify_payer: false + ) } -result = orders_controller.get_order(collect) +result = orders_controller.create_order_tracking(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | +| 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Confirm Order +# Update Order Tracking -Payer confirms their intent to pay for the the Order with the given payment source. +Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes or objects: Attribute Op Notes items replace Using replace op for items will replace the entire items object with the value sent in request. notify_payer replace, add status replace Only patching status to CANCELLED is currently supported. ```ruby -def confirm_order(options = {}) +def update_order_tracking(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the order for which the payer confirms their intent to pay.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | -| `paypal_client_metadata_id` | `String` | Header, Optional | **Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `id` | `String` | Template, Required | The ID of the order that the tracking information is associated with.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | +| `tracker_id` | `String` | Template, Required | The order tracking ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9]+$` | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion. | -| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z=]*$` | -| `body` | [`ConfirmOrderRequest`](../../doc/models/confirm-order-request.md) | Body, Optional | - | +| `body` | [`Array[Patch]`](../../doc/models/patch.md) | Body, Optional | **Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`Order`](../../doc/models/order.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. ## Example Usage ```ruby collect = { 'id' => 'id0', - 'prefer' => 'return=minimal' + 'tracker_id' => 'tracker_id2', + 'body' => [ + Patch.new( + op: PatchOp::ADD + ) + ] } -result = orders_controller.confirm_order(collect) +result = orders_controller.update_order_tracking(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -394,6 +441,7 @@ result = orders_controller.confirm_order(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | The specified resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | diff --git a/doc/controllers/payments.md b/doc/controllers/payments.md index 4f005c5..3181836 100644 --- a/doc/controllers/payments.md +++ b/doc/controllers/payments.md @@ -12,109 +12,122 @@ payments_controller = client.payments ## Methods +* [Get Authorized Payment](../../doc/controllers/payments.md#get-authorized-payment) * [Capture Authorized Payment](../../doc/controllers/payments.md#capture-authorized-payment) -* [Get Captured Payment](../../doc/controllers/payments.md#get-captured-payment) * [Reauthorize Payment](../../doc/controllers/payments.md#reauthorize-payment) * [Void Payment](../../doc/controllers/payments.md#void-payment) +* [Get Captured Payment](../../doc/controllers/payments.md#get-captured-payment) * [Refund Captured Payment](../../doc/controllers/payments.md#refund-captured-payment) -* [Get Authorized Payment](../../doc/controllers/payments.md#get-authorized-payment) * [Get Refund](../../doc/controllers/payments.md#get-refund) -# Capture Authorized Payment +# Get Authorized Payment -Captures an authorized payment, by ID. +Shows details for an authorized payment, by ID. ```ruby -def capture_authorized_payment(options = {}) +def get_authorized_payment(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `authorization_id` | `String` | Template, Required | The PayPal-generated ID for the authorized payment to capture. | +| `authorization_id` | `String` | Template, Required | The ID of the authorized payment for which to show details. | | `paypal_mock_response` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | -| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 45 days. | -| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | -| `body` | [`CaptureRequest`](../../doc/models/capture-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`CapturedPayment`](../../doc/models/captured-payment.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`PaymentAuthorization`](../../doc/models/payment-authorization.md). ## Example Usage ```ruby collect = { - 'authorization_id' => 'authorization_id8', - 'prefer' => 'return=minimal', - 'body' => CaptureRequest.new( - final_capture: false - ) + 'authorization_id' => 'authorization_id8' } -result = payments_controller.capture_authorized_payment(collect) +result = payments_controller.get_authorized_payment(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 409 | The server has detected a conflict while processing this request. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The request failed because it is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `APIException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Captured Payment +# Capture Authorized Payment -Shows details for a captured payment, by ID. +Captures an authorized payment, by ID. ```ruby -def get_captured_payment(options = {}) +def capture_authorized_payment(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `capture_id` | `String` | Template, Required | The PayPal-generated ID for the captured payment for which to show details. | +| `authorization_id` | `String` | Template, Required | The PayPal-generated ID for the authorized payment to capture. | | `paypal_mock_response` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 45 days. | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | +| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | +| `body` | [`CaptureRequest`](../../doc/models/capture-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`CapturedPayment`](../../doc/models/captured-payment.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`CapturedPayment`](../../doc/models/captured-payment.md). ## Example Usage ```ruby collect = { - 'capture_id' => 'capture_id2' + 'authorization_id' => 'authorization_id8', + 'prefer' => 'return=minimal', + 'body' => CaptureRequest.new( + final_capture: false + ) } -result = payments_controller.get_captured_payment(collect) +result = payments_controller.capture_authorized_payment(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | +| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 409 | The server has detected a conflict while processing this request. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The request failed because it is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `APIException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | # Reauthorize Payment -Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. Within the 29-day authorization period, you can issue multiple re-authorizations after the honor period expires. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. Note: This request is currently not supported for Partner use cases. +Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. Within the 29-day authorization period, you can issue multiple re-authorizations after the honor period expires. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. ```ruby def reauthorize_payment(options = {}) @@ -132,7 +145,7 @@ def reauthorize_payment(options = {}) ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`PaymentAuthorization`](../../doc/models/payment-authorization.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`PaymentAuthorization`](../../doc/models/payment-authorization.md). ## Example Usage @@ -143,6 +156,12 @@ collect = { } result = payments_controller.reauthorize_payment(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -151,6 +170,7 @@ result = payments_controller.reauthorize_payment(collect) | --- | --- | --- | | 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | | 422 | The request failed because it either is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `APIException` | @@ -177,7 +197,7 @@ def void_payment(options = {}) ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`PaymentAuthorization`](../../doc/models/payment-authorization.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`PaymentAuthorization`](../../doc/models/payment-authorization.md). ## Example Usage @@ -188,6 +208,12 @@ collect = { } result = payments_controller.void_payment(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -203,90 +229,102 @@ result = payments_controller.void_payment(collect) | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Refund Captured Payment +# Get Captured Payment -Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON request body. For a partial refund, include an amount object in the JSON request body. +Shows details for a captured payment, by ID. ```ruby -def refund_captured_payment(options = {}) +def get_captured_payment(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `capture_id` | `String` | Template, Required | The PayPal-generated ID for the captured payment to refund. | +| `capture_id` | `String` | Template, Required | The PayPal-generated ID for the captured payment for which to show details. | | `paypal_mock_response` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | -| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 45 days. | -| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | -| `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | -| `body` | [`RefundRequest`](../../doc/models/refund-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`Refund`](../../doc/models/refund.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`CapturedPayment`](../../doc/models/captured-payment.md). ## Example Usage ```ruby collect = { - 'capture_id' => 'capture_id2', - 'prefer' => 'return=minimal' + 'capture_id' => 'capture_id2' } -result = payments_controller.refund_captured_payment(collect) +result = payments_controller.get_captured_payment(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 409 | The request failed because a previous call for the given resource is in progress. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The request failed because it either is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `APIException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Authorized Payment +# Refund Captured Payment -Shows details for an authorized payment, by ID. +Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON request body. For a partial refund, include an amount object in the JSON request body. ```ruby -def get_authorized_payment(options = {}) +def refund_captured_payment(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `authorization_id` | `String` | Template, Required | The ID of the authorized payment for which to show details. | +| `capture_id` | `String` | Template, Required | The PayPal-generated ID for the captured payment to refund. | | `paypal_mock_response` | `String` | Header, Optional | PayPal's REST API uses a request header to invoke negative testing in the sandbox. This header configures the sandbox into a negative testing state for transactions that include the merchant. | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 45 days. | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | | `paypal_auth_assertion` | `String` | Header, Optional | An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion). Note:For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject. | +| `body` | [`RefundRequest`](../../doc/models/refund-request.md) | Body, Optional | - | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`PaymentAuthorization`](../../doc/models/payment-authorization.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`Refund`](../../doc/models/refund.md). ## Example Usage ```ruby collect = { - 'authorization_id' => 'authorization_id8' + 'capture_id' => 'capture_id2', + 'prefer' => 'return=minimal' } -result = payments_controller.get_authorized_payment(collect) +result = payments_controller.refund_captured_payment(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | +| 400 | The request failed because it is not well-formed or is syntactically incorrect or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`ErrorException`](../../doc/models/error-exception.md) | +| 403 | The request failed because the caller has insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | | 404 | The request failed because the resource does not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 409 | The request failed because a previous call for the given resource is in progress. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The request failed because it either is semantically incorrect or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | The request failed because an internal server error occurred. | `APIException` | | Default | The error response. | [`ErrorException`](../../doc/models/error-exception.md) | @@ -309,7 +347,7 @@ def get_refund(options = {}) ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`Refund`](../../doc/models/refund.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`Refund`](../../doc/models/refund.md). ## Example Usage @@ -319,6 +357,12 @@ collect = { } result = payments_controller.get_refund(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md new file mode 100644 index 0000000..186fe43 --- /dev/null +++ b/doc/controllers/subscriptions.md @@ -0,0 +1,893 @@ +# Subscriptions + +Use the `/subscriptions` resource to create, update, retrieve, and cancel subscriptions and their associated plans. + +```ruby +subscriptions_controller = client.subscriptions +``` + +## Class Name + +`SubscriptionsController` + +## Methods + +* [Create Billing Plan](../../doc/controllers/subscriptions.md#create-billing-plan) +* [List Billing Plans](../../doc/controllers/subscriptions.md#list-billing-plans) +* [Get Billing Plan](../../doc/controllers/subscriptions.md#get-billing-plan) +* [Patch Billing Plan](../../doc/controllers/subscriptions.md#patch-billing-plan) +* [Activate Billing Plan](../../doc/controllers/subscriptions.md#activate-billing-plan) +* [Deactivate Billing Plan](../../doc/controllers/subscriptions.md#deactivate-billing-plan) +* [Update Billing Plan Pricing Schemes](../../doc/controllers/subscriptions.md#update-billing-plan-pricing-schemes) +* [Create Subscription](../../doc/controllers/subscriptions.md#create-subscription) +* [List Subscriptions](../../doc/controllers/subscriptions.md#list-subscriptions) +* [Get Subscription](../../doc/controllers/subscriptions.md#get-subscription) +* [Patch Subscription](../../doc/controllers/subscriptions.md#patch-subscription) +* [Revise Subscription](../../doc/controllers/subscriptions.md#revise-subscription) +* [Suspend Subscription](../../doc/controllers/subscriptions.md#suspend-subscription) +* [Cancel Subscription](../../doc/controllers/subscriptions.md#cancel-subscription) +* [Activate Subscription](../../doc/controllers/subscriptions.md#activate-subscription) +* [Capture Subscription](../../doc/controllers/subscriptions.md#capture-subscription) +* [List Subscription Transactions](../../doc/controllers/subscriptions.md#list-subscription-transactions) + + +# Create Billing Plan + +Creates a plan that defines pricing and billing cycle details for subscriptions. + +```ruby +def create_billing_plan(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 72 hours. | +| `body` | [`PlanRequest`](../../doc/models/plan-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`BillingPlan`](../../doc/models/billing-plan.md). + +## Example Usage + +```ruby +collect = { + 'prefer' => 'return=minimal', + 'body' => PlanRequest.new( + product_id: 'product_id2', + name: 'name6', + billing_cycles: [ + SubscriptionBillingCycle.new( + frequency: Frequency.new( + interval_unit: IntervalUnit::DAY, + interval_count: 1 + ), + tenure_type: TenureType::REGULAR, + sequence: 8, + total_cycles: 1 + ) + ], + payment_preferences: PaymentPreferences.new( + auto_bill_outstanding: true, + setup_fee_failure_action: SetupFeeFailureAction::CANCEL, + payment_failure_threshold: 0 + ), + status: PlanRequestStatus::ACTIVE, + quantity_supported: false + ) +} + +result = subscriptions_controller.create_billing_plan(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# List Billing Plans + +Lists billing plans. + +```ruby +def list_billing_plans(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, name, description and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | +| `product_id` | `String` | Query, Optional | Filters the response by a Product ID.

**Constraints**: *Minimum Length*: `6`, *Maximum Length*: `50` | +| `page_size` | `Integer` | Query, Optional | The number of items to return in the response.

**Default**: `10`

**Constraints**: `>= 1`, `<= 20` | +| `page` | `Integer` | Query, Optional | A non-zero integer which is the start index of the entire list of items to return in the response. The combination of `page=1` and `page_size=20` returns the first 20 items. The combination of `page=2` and `page_size=20` returns the next 20 items.

**Default**: `1`

**Constraints**: `>= 1`, `<= 100000` | +| `total_required` | `TrueClass \| FalseClass` | Query, Optional | Indicates whether to show the total count in the response.

**Default**: `false` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`PlanCollection`](../../doc/models/plan-collection.md). + +## Example Usage + +```ruby +collect = { + 'prefer' => 'return=minimal', + 'page_size' => 10, + 'page' => 1, + 'total_required' => false +} + +result = subscriptions_controller.list_billing_plans(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Get Billing Plan + +Shows details for a plan, by ID. + +```ruby +def get_billing_plan(id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the plan. | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`BillingPlan`](../../doc/models/billing-plan.md). + +## Example Usage + +```ruby +id = 'id0' + +result = subscriptions_controller.get_billing_plan(id) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Patch Billing Plan + +Updates a plan with the `CREATED` or `ACTIVE` status. For an `INACTIVE` plan, you can make only status updates. You can patch these attributes and objects: Attribute or object Operations description replace payment_preferences.auto_bill_outstanding replace taxes.percentage replace payment_preferences.payment_failure_threshold replace payment_preferences.setup_fee replace payment_preferences.setup_fee_failure_action replace name replace + +```ruby +def patch_billing_plan(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the plan. | +| `body` | [`Array[Patch]`](../../doc/models/patch.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```ruby +collect = { + 'id' => 'id0', + 'body' => [ + Patch.new( + op: PatchOp::ADD + ) + ] +} + +result = subscriptions_controller.patch_billing_plan(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Activate Billing Plan + +Activates a plan, by ID. + +```ruby +def activate_billing_plan(id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the plan. | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```ruby +id = 'id0' + +result = subscriptions_controller.activate_billing_plan(id) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Deactivate Billing Plan + +Deactivates a plan, by ID. + +```ruby +def deactivate_billing_plan(id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the plan. | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```ruby +id = 'id0' + +result = subscriptions_controller.deactivate_billing_plan(id) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Update Billing Plan Pricing Schemes + +Updates pricing for a plan. For example, you can update a regular billing cycle from $5 per month to $7 per month. + +```ruby +def update_billing_plan_pricing_schemes(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID for the plan. | +| `body` | [`UpdatePricingSchemesRequest`](../../doc/models/update-pricing-schemes-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```ruby +collect = { + 'id' => 'id0', + 'body' => UpdatePricingSchemesRequest.new( + pricing_schemes: [ + UpdatePricingScheme.new( + billing_cycle_sequence: 34, + pricing_scheme: SubscriptionPricingScheme.new + ) + ] + ) +} + +result = subscriptions_controller.update_billing_plan_pricing_schemes(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Create Subscription + +Creates a subscription. + +```ruby +def create_subscription(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefer` | `String` | Header, Optional | The preferred server response upon successful completion of the request. Value is: return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. return=representation. The server returns a complete resource representation, including the current state of the resource.

**Default**: `'return=minimal'` | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 72 hours. | +| `paypal_client_metadata_id` | `String` | Header, Optional | The PayPal Client Metadata Id(CMID) is used to provide device-specific information to PayPal's risk engine. This is crucial for transactions that require device-specific risk assessments. Merchants typically use the Paypal SDK that automatically submits the CMID or they use tools like Fraudnet JS for web or Magnes JS for mobile to generate the CMID on the frontend and then pass it to the API as part of the request headers.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `body` | [`CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`Subscription`](../../doc/models/subscription.md). + +## Example Usage + +```ruby +collect = { + 'prefer' => 'return=minimal', + 'body' => CreateSubscriptionRequest.new( + plan_id: 'plan_id8', + auto_renewal: false + ) +} + +result = subscriptions_controller.create_subscription(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# List Subscriptions + +List all subscriptions for merchant account. + +```ruby +def list_subscriptions(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `plan_ids` | `String` | Query, Optional | Filters the response by list of plan IDs. Filter supports upto 70 plan IDs. URLs should not exceed a length of 2000 characters. | +| `statuses` | `String` | Query, Optional | Filters the response by list of subscription statuses.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `70`, *Pattern*: `^[A-Z_,]+$` | +| `created_after` | `String` | Query, Optional | Filters the response by subscription creation start time for a range of subscriptions.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `created_before` | `String` | Query, Optional | Filters the response by subscription creation end time for a range of subscriptions.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `status_updated_before` | `String` | Query, Optional | Filters the response by status update start time for a range of subscriptions.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `status_updated_after` | `String` | Query, Optional | Filters the response by status update end time for a range of subscriptions.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `filter` | `String` | Query, Optional | Filter the response using complex expressions that could use comparison operators like ge, gt, le, lt and logical operators such as 'and' and 'or'.

**Constraints**: *Minimum Length*: `0`, *Maximum Length*: `100` | +| `page_size` | `Integer` | Query, Optional | The number of items to return in the response.

**Default**: `10`

**Constraints**: `>= 1`, `<= 20` | +| `page` | `Integer` | Query, Optional | A non-zero integer which is the start index of the entire list of items to return in the response. The combination of `page=1` and `page_size=20` returns the first 20 items. The combination of `page=2` and `page_size=20` returns the next 20 items.

**Default**: `1`

**Constraints**: `>= 1`, `<= 10000000` | +| `customer_ids` | `Array[String]` | Query, Optional | Filters the response by comma separated vault customer IDs (FSS subscriptions only).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10`, *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`SubscriptionCollection`](../../doc/models/subscription-collection.md). + +## Example Usage + +```ruby +collect = { + 'page_size' => 10, + 'page' => 1 +} + +result = subscriptions_controller.list_subscriptions(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Get Subscription + +Shows details for a subscription, by ID. + +```ruby +def get_subscription(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `fields` | `String` | Query, Optional | List of fields that are to be returned in the response. Possible value for fields are last_failed_payment and plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`Subscription`](../../doc/models/subscription.md). + +## Example Usage + +```ruby +collect = { + 'id' => 'id0' +} + +result = subscriptions_controller.get_subscription(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Patch Subscription + +Updates a subscription which could be in ACTIVE or SUSPENDED status. You can override plan level default attributes by providing customised values for plan path in the patch request. You cannot update attributes that have already completed (Example - trial cycles can’t be updated if completed). Once overridden, changes to plan resource will not impact subscription. Any price update will not impact billing cycles within next 10 days (Applicable only for subscriptions funded by PayPal account). Following are the fields eligible for patch. Attribute or object Operations billing_info.outstanding_balance replace custom_id add,replace plan.billing_cycles[@sequence==n]. pricing_scheme.fixed_price add,replace plan.billing_cycles[@sequence==n]. pricing_scheme.tiers replace plan.billing_cycles[@sequence==n]. total_cycles replace plan.payment_preferences. auto_bill_outstanding replace plan.payment_preferences. payment_failure_threshold replace plan.taxes.inclusive add,replace plan.taxes.percentage add,replace shipping_amount add,replace start_time replace subscriber.shipping_address add,replace subscriber.payment_source (for subscriptions funded by card payments) replace + +```ruby +def patch_subscription(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID for the subscription. | +| `body` | [`Array[Patch]`](../../doc/models/patch.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```ruby +collect = { + 'id' => 'id0', + 'body' => [ + Patch.new( + op: PatchOp::ADD + ) + ] +} + +result = subscriptions_controller.patch_subscription(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Revise Subscription + +Updates the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the `shipping_amount`, `shipping_address` values for the subscription. This type of update requires the buyer's consent. + +```ruby +def revise_subscription(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `body` | [`ModifySubscriptionRequest`](../../doc/models/modify-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`ModifySubscriptionResponse`](../../doc/models/modify-subscription-response.md). + +## Example Usage + +```ruby +collect = { + 'id' => 'id0' +} + +result = subscriptions_controller.revise_subscription(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Suspend Subscription + +Suspends the subscription. + +```ruby +def suspend_subscription(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `body` | [`SuspendSubscription`](../../doc/models/suspend-subscription.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```ruby +collect = { + 'id' => 'id0' +} + +result = subscriptions_controller.suspend_subscription(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Cancel Subscription + +Cancels the subscription. + +```ruby +def cancel_subscription(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `body` | [`CancelSubscriptionRequest`](../../doc/models/cancel-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```ruby +collect = { + 'id' => 'id0' +} + +result = subscriptions_controller.cancel_subscription(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Activate Subscription + +Activates the subscription. + +```ruby +def activate_subscription(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `body` | [`ActivateSubscriptionRequest`](../../doc/models/activate-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```ruby +collect = { + 'id' => 'id0' +} + +result = subscriptions_controller.activate_subscription(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# Capture Subscription + +Captures an authorized payment from the subscriber on the subscription. + +```ruby +def capture_subscription(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 72 hours. | +| `body` | [`CaptureSubscriptionRequest`](../../doc/models/capture-subscription-request.md) | Body, Optional | - | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`SubscriptionTransactionDetails`](../../doc/models/subscription-transaction-details.md). + +## Example Usage + +```ruby +collect = { + 'id' => 'id0' +} + +result = subscriptions_controller.capture_subscription(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + + +# List Subscription Transactions + +Lists transactions for a subscription. + +```ruby +def list_subscription_transactions(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Template, Required | The ID of the subscription. | +| `start_time` | `String` | Query, Required | The start time of the range of transactions to list.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `end_time` | `String` | Query, Required | The end time of the range of transactions to list.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`TransactionsList`](../../doc/models/transactions-list.md). + +## Example Usage + +```ruby +collect = { + 'id' => 'id0', + 'start_time' => 'start_time6', + 'end_time' => 'end_time2' +} + +result = subscriptions_controller.list_subscription_transactions(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request. Request is not well-formed, syntactically incorrect, or violates schema. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 401 | Authentication failed due to missing authorization header, or invalid authentication credentials. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 404 | The specified resource does not exist. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| 500 | An internal server error has occurred. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | +| Default | The error response. | [`SubscriptionErrorException`](../../doc/models/subscription-error-exception.md) | + diff --git a/doc/controllers/transactionsearch.md b/doc/controllers/transactionsearch.md new file mode 100644 index 0000000..56c440a --- /dev/null +++ b/doc/controllers/transactionsearch.md @@ -0,0 +1,117 @@ +# Transactionsearch + +```ruby +transactionsearch_controller = client.transactionsearch +``` + +## Class Name + +`TransactionsearchController` + +## Methods + +* [Search Transactions](../../doc/controllers/transactionsearch.md#search-transactions) +* [Search Balances](../../doc/controllers/transactionsearch.md#search-balances) + + +# Search Transactions + +Lists transactions. Specify one or more query parameters to filter the transaction that appear in the response. Notes: If you specify one or more optional query parameters, the ending_balance response field is empty. It takes a maximum of three hours for executed transactions to appear in the list transactions call. This call lists transaction for the previous three years. + +```ruby +def search_transactions(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `start_date` | `String` | Query, Required | Filters the transactions in the response by a start date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional seconds are optional.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `end_date` | `String` | Query, Required | Filters the transactions in the response by an end date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional seconds are optional. The maximum supported range is 31 days.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `transaction_id` | `String` | Query, Optional | Filters the transactions in the response by a PayPal transaction ID. A valid transaction ID is 17 characters long, except for an order ID, which is 19 characters long. Note: A transaction ID is not unique in the reporting system. The response can list two transactions with the same ID. One transaction can be balance affecting while the other is non-balance affecting.

**Constraints**: *Minimum Length*: `17`, *Maximum Length*: `19` | +| `transaction_type` | `String` | Query, Optional | Filters the transactions in the response by a PayPal transaction event code. See [Transaction event codes](/docs/integration/direct/transaction-search/transaction-event-codes/). | +| `transaction_status` | `String` | Query, Optional | Filters the transactions in the response by a PayPal transaction status code. Value is: Status code Description D PayPal or merchant rules denied the transaction. P The transaction is pending. The transaction was created but waits for another payment process to complete, such as an ACH transaction, before the status changes to S. S The transaction successfully completed without a denial and after any pending statuses. V A successful transaction was reversed and funds were refunded to the original sender. | +| `transaction_amount` | `String` | Query, Optional | Filters the transactions in the response by a gross transaction amount range. Specify the range as `TO`, where ` ` is the lower limit of the gross PayPal transaction amount and ` ` is the upper limit of the gross transaction amount. Specify the amounts in lower denominations. For example, to search for transactions from $5.00 to $10.05, specify `[500 TO 1005]`. Note:The values must be URL encoded. | +| `transaction_currency` | `String` | Query, Optional | Filters the transactions in the response by a [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) for the PayPal transaction currency. | +| `payment_instrument_type` | `String` | Query, Optional | Filters the transactions in the response by a payment instrument type. Value is either: CREDITCARD. Returns a direct credit card transaction with a corresponding value. DEBITCARD. Returns a debit card transaction with a corresponding value. If you omit this parameter, the API does not apply this filter. | +| `store_id` | `String` | Query, Optional | Filters the transactions in the response by a store ID. | +| `terminal_id` | `String` | Query, Optional | Filters the transactions in the response by a terminal ID. | +| `fields` | `String` | Query, Optional | Indicates which fields appear in the response. Value is a single field or a comma-separated list of fields. The transaction_info value returns only the transaction details in the response. To include all fields in the response, specify fields=all. Valid fields are: transaction_info. The transaction information. Includes the ID of the PayPal account of the payee, the PayPal-generated transaction ID, the PayPal-generated base ID, the PayPal reference ID type, the transaction event code, the date and time when the transaction was initiated and was last updated, the transaction amounts including the PayPal fee, any discounts, insurance, the transaction status, and other information about the transaction. payer_info. The payer information. Includes the PayPal customer account ID and the payer's email address, primary phone number, name, country code, address, and whether the payer is verified or unverified. shipping_info. The shipping information. Includes the recipient's name, the shipping method for this order, the shipping address for this order, and the secondary address associated with this order. auction_info. The auction information. Includes the name of the auction site, the auction site URL, the ID of the customer who makes the purchase in the auction, and the date and time when the auction closes. cart_info. The cart information. Includes an array of item details, whether the item amount or the shipping amount already includes tax, and the ID of the invoice for PayPal-generated invoices. incentive_info. An array of incentive detail objects. Each object includes the incentive, such as a special offer or coupon, the incentive amount, and the incentive program code that identifies a merchant loyalty or incentive program. store_info. The store information. Includes the ID of the merchant store and the terminal ID for the checkout stand in the merchant store.

**Default**: `'transaction_info'` | +| `balance_affecting_records_only` | `String` | Query, Optional | Indicates whether the response includes only balance-impacting transactions or all transactions. Value is either: Y. The default. The response includes only balance transactions. N. The response includes all transactions.

**Default**: `'Y'` | +| `page_size` | `Integer` | Query, Optional | The number of items to return in the response. So, the combination of `page=1` and `page_size=20` returns the first 20 items. The combination of `page=2` and `page_size=20` returns the next 20 items.

**Default**: `100`

**Constraints**: `>= 1`, `<= 500` | +| `page` | `Integer` | Query, Optional | The zero-relative start index of the entire list of items that are returned in the response. So, the combination of `page=1` and `page_size=20` returns the first 20 items.

**Default**: `1`

**Constraints**: `>= 1`, `<= 2147483647` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`SearchResponse`](../../doc/models/search-response.md). + +## Example Usage + +```ruby +collect = { + 'start_date' => 'start_date6', + 'end_date' => 'end_date0', + 'fields' => 'transaction_info', + 'balance_affecting_records_only' => 'Y', + 'page_size' => 100, + 'page' => 1 +} + +result = transaction_search_controller.search_transactions(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| Default | The error response. | [`SearchErrorException`](../../doc/models/search-error-exception.md) | + + +# Search Balances + +List all balances. Specify date time to list balances for that time that appear in the response. Notes: It takes a maximum of three hours for balances to appear in the list balances call. This call lists balances upto the previous three years. + +```ruby +def search_balances(options = {}) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `as_of_time` | `String` | Query, Optional | List balances in the response at the date time provided, will return the last refreshed balance in the system when not provided.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `currency_code` | `String` | Query, Optional | Filters the transactions in the response by a [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) for the PayPal transaction currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | + +## Response Type + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`BalancesResponse`](../../doc/models/balances-response.md). + +## Example Usage + +```ruby +collect = {} + +result = transaction_search_controller.search_balances(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | The request is not well-formed, is syntactically incorrect, or violates schema. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | +| 403 | Authorization failed due to insufficient permissions. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | +| 500 | An internal server error occurred. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | +| Default | The error response. | [`DefaultErrorException`](../../doc/models/default-error-exception.md) | + diff --git a/doc/controllers/vault.md b/doc/controllers/vault.md index c959656..5a211c1 100644 --- a/doc/controllers/vault.md +++ b/doc/controllers/vault.md @@ -12,38 +12,49 @@ vault_controller = client.vault ## Methods -* [Delete Payment Token](../../doc/controllers/vault.md#delete-payment-token) -* [Create Setup Token](../../doc/controllers/vault.md#create-setup-token) -* [Get Setup Token](../../doc/controllers/vault.md#get-setup-token) * [Create Payment Token](../../doc/controllers/vault.md#create-payment-token) * [List Customer Payment Tokens](../../doc/controllers/vault.md#list-customer-payment-tokens) * [Get Payment Token](../../doc/controllers/vault.md#get-payment-token) +* [Delete Payment Token](../../doc/controllers/vault.md#delete-payment-token) +* [Create Setup Token](../../doc/controllers/vault.md#create-setup-token) +* [Get Setup Token](../../doc/controllers/vault.md#get-setup-token) -# Delete Payment Token +# Create Payment Token -Delete the payment token associated with the payment token id. +Creates a Payment Token from the given payment source and adds it to the Vault of the associated customer. ```ruby -def delete_payment_token(id) +def create_payment_token(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | ID of the payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `body` | [`PaymentTokenRequest`](../../doc/models/payment-token-request.md) | Body, Required | Payment Token creation with a financial instrument and an optional customer_id. | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 3 hours.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108`, *Pattern*: `^.*$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). ## Example Usage ```ruby -id = 'id0' +collect = { + 'body' => PaymentTokenRequest.new( + payment_source: PaymentTokenRequestPaymentSource.new + ) +} -result = vault_controller.delete_payment_token(id) +result = vault_controller.create_payment_token(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -52,38 +63,49 @@ result = vault_controller.delete_payment_token(id) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 404 | Request contains reference to resources that do not exist. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Setup Token +# List Customer Payment Tokens -Creates a Setup Token from the given payment source and adds it to the Vault of the associated customer. +Returns all payment tokens for a customer. ```ruby -def create_setup_token(options = {}) +def list_customer_payment_tokens(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`SetupTokenRequest`](../../doc/models/setup-token-request.md) | Body, Required | Setup Token creation with a instrument type optional financial instrument details and customer_id. | -| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 3 hours.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000`, *Pattern*: `^.*$` | +| `customer_id` | `String` | Query, Required | A unique identifier representing a specific customer in merchant's/partner's system or records.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `page_size` | `Integer` | Query, Optional | A non-negative, non-zero integer indicating the maximum number of results to return at one time.

**Default**: `5`

**Constraints**: `>= 1`, `<= 5` | +| `page` | `Integer` | Query, Optional | A non-negative, non-zero integer representing the page of the results.

**Default**: `1`

**Constraints**: `>= 1`, `<= 10` | +| `total_required` | `TrueClass \| FalseClass` | Query, Optional | A boolean indicating total number of items (total_items) and pages (total_pages) are expected to be returned in the response.

**Default**: `false` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`CustomerVaultPaymentTokensResponse`](../../doc/models/customer-vault-payment-tokens-response.md). ## Example Usage ```ruby collect = { - 'body' => SetupTokenRequest.new( - payment_source: SetupTokenRequestPaymentSource.new - ) + 'customer_id' => 'customer_id8', + 'page_size' => 5, + 'page' => 1, + 'total_required' => false } -result = vault_controller.create_setup_token(collect) +result = vault_controller.list_customer_payment_tokens(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -92,34 +114,39 @@ result = vault_controller.create_setup_token(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Setup Token +# Get Payment Token -Returns a readable representation of temporarily vaulted payment source associated with the setup token id. +Returns a readable representation of vaulted payment source associated with the payment token id. ```ruby -def get_setup_token(id) +def get_payment_token(id) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | ID of the setup token.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `id` | `String` | Template, Required | ID of the payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). ## Example Usage ```ruby id = 'id0' -result = vault_controller.get_setup_token(id) +result = vault_controller.get_payment_token(id) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -132,35 +159,36 @@ result = vault_controller.get_setup_token(id) | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Create Payment Token +# Delete Payment Token -Creates a Payment Token from the given payment source and adds it to the Vault of the associated customer. +Delete the payment token associated with the payment token id. ```ruby -def create_payment_token(options = {}) +def delete_payment_token(id) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`PaymentTokenRequest`](../../doc/models/payment-token-request.md) | Body, Required | Payment Token creation with a financial instrument and an optional customer_id. | -| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 3 hours.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000`, *Pattern*: `^.*$` | +| `id` | `String` | Template, Required | ID of the payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. ## Example Usage ```ruby -collect = { - 'body' => PaymentTokenRequest.new( - payment_source: PaymentTokenRequestPaymentSource.new - ) -} +id = 'id0' -result = vault_controller.create_payment_token(collect) +result = vault_controller.delete_payment_token(id) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -169,43 +197,44 @@ result = vault_controller.create_payment_token(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | -| 404 | Request contains reference to resources that do not exist. | [`ErrorException`](../../doc/models/error-exception.md) | -| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# List Customer Payment Tokens +# Create Setup Token -Returns all payment tokens for a customer. +Creates a Setup Token from the given payment source and adds it to the Vault of the associated customer. ```ruby -def list_customer_payment_tokens(options = {}) +def create_setup_token(options = {}) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customer_id` | `String` | Query, Required | A unique identifier representing a specific customer in merchant's/partner's system or records.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | -| `page_size` | `Integer` | Query, Optional | A non-negative, non-zero integer indicating the maximum number of results to return at one time.

**Default**: `5`

**Constraints**: `>= 1`, `<= 5` | -| `page` | `Integer` | Query, Optional | A non-negative, non-zero integer representing the page of the results.

**Default**: `1`

**Constraints**: `>= 1`, `<= 10` | -| `total_required` | `TrueClass \| FalseClass` | Query, Optional | A boolean indicating total number of items (total_items) and pages (total_pages) are expected to be returned in the response.

**Default**: `false` | +| `body` | [`SetupTokenRequest`](../../doc/models/setup-token-request.md) | Body, Required | Setup Token creation with a instrument type optional financial instrument details and customer_id. | +| `paypal_request_id` | `String` | Header, Optional | The server stores keys for 3 hours.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `108`, *Pattern*: `^.*$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`CustomerVaultPaymentTokensResponse`](../../doc/models/customer-vault-payment-tokens-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). ## Example Usage ```ruby collect = { - 'customer_id' => 'customer_id8', - 'page_size' => 5, - 'page' => 1, - 'total_required' => false + 'body' => SetupTokenRequest.new( + payment_source: SetupTokenRequestPaymentSource.new + ) } -result = vault_controller.list_customer_payment_tokens(collect) +result = vault_controller.create_setup_token(collect) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors @@ -214,33 +243,40 @@ result = vault_controller.list_customer_payment_tokens(collect) | --- | --- | --- | | 400 | Request is not well-formed, syntactically incorrect, or violates schema. | [`ErrorException`](../../doc/models/error-exception.md) | | 403 | Authorization failed due to insufficient permissions. | [`ErrorException`](../../doc/models/error-exception.md) | +| 422 | The requested action could not be performed, semantically incorrect, or failed business validation. | [`ErrorException`](../../doc/models/error-exception.md) | | 500 | An internal server error has occurred. | [`ErrorException`](../../doc/models/error-exception.md) | -# Get Payment Token +# Get Setup Token -Returns a readable representation of vaulted payment source associated with the payment token id. +Returns a readable representation of temporarily vaulted payment source associated with the setup token id. ```ruby -def get_payment_token(id) +def get_setup_token(id) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Template, Required | ID of the payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `id` | `String` | Template, Required | ID of the setup token.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | ## Response Type -This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property in this instance returns the response data which is of type [`PaymentTokenResponse`](../../doc/models/payment-token-response.md). +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `data` property of this instance returns the response data which is of type [`SetupTokenResponse`](../../doc/models/setup-token-response.md). ## Example Usage ```ruby id = 'id0' -result = vault_controller.get_payment_token(id) +result = vault_controller.get_setup_token(id) + +if result.success? + puts result.data +elsif result.error? + warn result.errors +end ``` ## Errors diff --git a/doc/models/activate-subscription-request.md b/doc/models/activate-subscription-request.md new file mode 100644 index 0000000..07277fa --- /dev/null +++ b/doc/models/activate-subscription-request.md @@ -0,0 +1,23 @@ + +# Activate Subscription Request + +The activate subscription request details. + +## Structure + +`ActivateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `reason` | `String` | Optional | The reason for activation of a subscription. Required to reactivate the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | + +## Example (as JSON) + +```json +{ + "reason": "reason4" +} +``` + diff --git a/doc/models/amount-breakdown.md b/doc/models/amount-breakdown.md index 00d190f..ceae3b3 100644 --- a/doc/models/amount-breakdown.md +++ b/doc/models/amount-breakdown.md @@ -17,7 +17,7 @@ The breakdown of the amount. Breakdown provides details such as total item amoun | `tax_total` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `insurance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `shipping_discount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | -| `discount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `discount` | [`Money`](../../doc/models/money.md) | Optional | The discount amount and currency code. For list of supported currencies and decimal precision, see the PayPal REST APIs Currency Codes. | ## Example (as JSON) diff --git a/doc/models/app-switch-context.md b/doc/models/app-switch-context.md new file mode 100644 index 0000000..6d273d6 --- /dev/null +++ b/doc/models/app-switch-context.md @@ -0,0 +1,31 @@ + +# App Switch Context + +Merchant provided details of the native app or mobile web browser to facilitate buyer's app switch to the PayPal consumer app. + +## Structure + +`AppSwitchContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `native_app` | [`NativeAppContext`](../../doc/models/native-app-context.md) | Optional | Merchant provided, buyer's native app preferences to app switch to the PayPal consumer app. | +| `mobile_web` | [`MobileWebContext`](../../doc/models/mobile-web-context.md) | Optional | Buyer's mobile web browser context to app switch to the PayPal consumer app. | + +## Example (as JSON) + +```json +{ + "native_app": { + "os_type": "IOS", + "os_version": "os_version0" + }, + "mobile_web": { + "return_flow": "AUTO", + "buyer_user_agent": "buyer_user_agent8" + } +} +``` + diff --git a/doc/models/apple-pay-card-response.md b/doc/models/apple-pay-card-response.md index 9fb0cf4..3f2cde5 100644 --- a/doc/models/apple-pay-card-response.md +++ b/doc/models/apple-pay-card-response.md @@ -14,7 +14,7 @@ The Card from Apple Pay Wallet used to fund the payment. | `name` | `String` | Optional | The card holder's name as it appears on the card.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `300` | | `last_digits` | `String` | Optional | The last digits of the payment card.

**Constraints**: *Pattern*: `[0-9]{2,}` | | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | -| `available_networks` | [`Array`](../../doc/models/card-brand.md) | Optional | Array of brands or networks associated with the card.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `256`, *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `available_networks` | [`Array[CardBrand]`](../../doc/models/card-brand.md) | Optional | Array of brands or networks associated with the card.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `256`, *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `type` | [`CardType`](../../doc/models/card-type.md) | Optional | Type of card. i.e Credit, Debit and so on.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `authentication_result` | [`AuthenticationResponse`](../../doc/models/authentication-response.md) | Optional | Results of Authentication such as 3D Secure. | | `attributes` | [`CardAttributesResponse`](../../doc/models/card-attributes-response.md) | Optional | Additional attributes associated with the use of this card. | @@ -31,9 +31,9 @@ The Card from Apple Pay Wallet used to fund the payment. { "name": "name4", "last_digits": "last_digits8", - "brand": "HIPER", + "brand": "ACCEL", "available_networks": [ - "RUPAY" + "STAR_ACCESS" ], "type": "DEBIT" } diff --git a/doc/models/apple-pay-card.md b/doc/models/apple-pay-card.md index 92899ff..20279f4 100644 --- a/doc/models/apple-pay-card.md +++ b/doc/models/apple-pay-card.md @@ -24,7 +24,7 @@ The payment card to be used to fund a payment. Can be a credit or debit card. "name": "name4", "last_digits": "last_digits8", "type": "UNKNOWN", - "brand": "AMEX", + "brand": "SWITCH", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/apple-pay-decrypted-token-data.md b/doc/models/apple-pay-decrypted-token-data.md index d9aee26..154601c 100644 --- a/doc/models/apple-pay-decrypted-token-data.md +++ b/doc/models/apple-pay-decrypted-token-data.md @@ -29,7 +29,7 @@ Information about the Payment data obtained by decrypting Apple Pay token. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id2", diff --git a/doc/models/apple-pay-payment-token.md b/doc/models/apple-pay-payment-token.md index 29dde70..6acc8bc 100644 --- a/doc/models/apple-pay-payment-token.md +++ b/doc/models/apple-pay-payment-token.md @@ -21,7 +21,7 @@ A resource representing a response for Apple Pay. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/apple-pay-request-card.md b/doc/models/apple-pay-request-card.md new file mode 100644 index 0000000..3c5b0fa --- /dev/null +++ b/doc/models/apple-pay-request-card.md @@ -0,0 +1,34 @@ + +# Apple Pay Request Card + +The payment card to be used to fund a payment. Can be a credit or debit card. + +## Structure + +`ApplePayRequestCard` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | [`CardType`](../../doc/models/card-type.md) | Optional | Type of card. i.e Credit, Debit and so on.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | + +## Example (as JSON) + +```json +{ + "type": "PREPAID", + "brand": "PULSE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } +} +``` + diff --git a/doc/models/apple-pay-request.md b/doc/models/apple-pay-request.md index 046124c..ea54d1a 100644 --- a/doc/models/apple-pay-request.md +++ b/doc/models/apple-pay-request.md @@ -40,7 +40,7 @@ Information needed to pay using ApplePay. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", diff --git a/doc/models/apple-pay-tokenized-card.md b/doc/models/apple-pay-tokenized-card.md index 651237d..3d1168a 100644 --- a/doc/models/apple-pay-tokenized-card.md +++ b/doc/models/apple-pay-tokenized-card.md @@ -14,7 +14,7 @@ The payment card to use to fund a payment. Can be a credit or debit card. | `name` | `String` | Optional | The card holder's name as it appears on the card.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300`, *Pattern*: `^.{1,300}$` | | `number` | `String` | Optional | The primary account number (PAN) for the payment card.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `19`, *Pattern*: `^[0-9]{13,19}$` | | `expiry` | `String` | Optional | The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `7`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])$` | -| `card_type` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `card_type` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card brand or network. Typically used in the response.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `type` | [`CardType`](../../doc/models/card-type.md) | Optional | Type of card. i.e Credit, Debit and so on.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | diff --git a/doc/models/application-context-user-action.md b/doc/models/application-context-user-action.md new file mode 100644 index 0000000..f6595f7 --- /dev/null +++ b/doc/models/application-context-user-action.md @@ -0,0 +1,16 @@ + +# Application Context User Action + +Configures the label name to `Continue` or `Subscribe Now` for subscription consent experience. + +## Enumeration + +`ApplicationContextUserAction` + +## Fields + +| Name | Description | +| --- | --- | +| `CONTINUE` | After you redirect the customer to the PayPal subscription consent page, a Continue button appears. Use this option when you want to control the activation of the subscription and do not want PayPal to activate the subscription. | +| `SUBSCRIBE_NOW` | After you redirect the customer to the PayPal subscription consent page, a Subscribe Now button appears. Use this option when you want PayPal to activate the subscription. | + diff --git a/doc/models/auction-information.md b/doc/models/auction-information.md new file mode 100644 index 0000000..3b9c239 --- /dev/null +++ b/doc/models/auction-information.md @@ -0,0 +1,29 @@ + +# Auction Information + +The auction information. + +## Structure + +`AuctionInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `auction_site` | `String` | Optional | The name of the auction site.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `auction_item_site` | `String` | Optional | The auction site URL.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `auction_buyer_id` | `String` | Optional | The ID of the buyer who makes the purchase in the auction. This ID might be different from the payer ID provided for the payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `auction_closing_date` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | + +## Example (as JSON) + +```json +{ + "auction_site": "auction_site6", + "auction_item_site": "auction_item_site8", + "auction_buyer_id": "auction_buyer_id0", + "auction_closing_date": "auction_closing_date0" +} +``` + diff --git a/doc/models/authorization-with-additional-data.md b/doc/models/authorization-with-additional-data.md index 593b800..e26ed35 100644 --- a/doc/models/authorization-with-additional-data.md +++ b/doc/models/authorization-with-additional-data.md @@ -17,10 +17,10 @@ The authorization with additional payment details, such as risk assessment and p | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `String` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `expiration_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | | `create_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `update_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `processor_response` | [`ProcessorResponse`](../../doc/models/processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | diff --git a/doc/models/authorization.md b/doc/models/authorization.md index 9b68550..56b401a 100644 --- a/doc/models/authorization.md +++ b/doc/models/authorization.md @@ -17,10 +17,10 @@ The authorized payment transaction. | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `String` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `expiration_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | | `create_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `update_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | diff --git a/doc/models/balance-information.md b/doc/models/balance-information.md new file mode 100644 index 0000000..26a1ffb --- /dev/null +++ b/doc/models/balance-information.md @@ -0,0 +1,40 @@ + +# Balance Information + +The Balance information. + +## Structure + +`BalanceInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `currency` | `String` | Required | The [three-character ISO-4217 currency code](/docs/integration/direct/rest/currency-codes/) that identifies the currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | +| `primary` | `TrueClass \| FalseClass` | Optional | Optional field representing if the currency is primary currency or not. | +| `total_balance` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | +| `available_balance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `withheld_balance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | + +## Example (as JSON) + +```json +{ + "currency": "currency4", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } +} +``` + diff --git a/doc/models/balances-response.md b/doc/models/balances-response.md new file mode 100644 index 0000000..c03b085 --- /dev/null +++ b/doc/models/balances-response.md @@ -0,0 +1,78 @@ + +# Balances Response + +The balances response information. + +## Structure + +`BalancesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `balances` | [`Array[BalanceInformation]`](../../doc/models/balance-information.md) | Optional | An array of balance detail objects.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `200` | +| `account_id` | `String` | Optional | The PayPal payer ID, which is a masked version of the PayPal account number intended for use with third parties. The account number is reversibly encrypted and a proprietary variant of Base32 is used to encode the result.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | +| `as_of_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `last_refresh_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | + +## Example (as JSON) + +```json +{ + "balances": [ + { + "currency": "currency0", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } + }, + { + "currency": "currency0", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } + }, + { + "currency": "currency0", + "primary": false, + "total_balance": { + "currency_code": "currency_code6", + "value": "value2" + }, + "available_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "withheld_balance": { + "currency_code": "currency_code2", + "value": "value8" + } + } + ], + "account_id": "account_id0", + "as_of_time": "as_of_time2", + "last_refresh_time": "last_refresh_time0" +} +``` + diff --git a/doc/models/bank-request.md b/doc/models/bank-request.md new file mode 100644 index 0000000..2b4e789 --- /dev/null +++ b/doc/models/bank-request.md @@ -0,0 +1,34 @@ + +# Bank Request + +A Resource representing a request to vault a Bank used for ACH Debit. + +## Structure + +`BankRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ach_debit` | `Object` | Optional | A Resource representing a request to vault a ACH Debit. | +| `sepa_debit` | [`SepaDebitRequest`](../../doc/models/sepa-debit-request.md) | Optional | An API resource denoting a request to securely store a SEPA Debit. | + +## Example (as JSON) + +```json +{ + "ach_debit": { + "key1": "val1", + "key2": "val2" + }, + "sepa_debit": { + "experience_context": { + "locale": "locale6", + "return_url": "return_url4", + "cancel_url": "cancel_url6" + } + } +} +``` + diff --git a/doc/models/billing-cycle-override.md b/doc/models/billing-cycle-override.md new file mode 100644 index 0000000..e863aa4 --- /dev/null +++ b/doc/models/billing-cycle-override.md @@ -0,0 +1,61 @@ + +# Billing Cycle Override + +The billing cycle details to override at subscription level. The subscription billing cycle definition has to adhere to the plan billing cycle definition. + +## Structure + +`BillingCycleOverride` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `pricing_scheme` | [`SubscriptionPricingScheme`](../../doc/models/subscription-pricing-scheme.md) | Optional | The pricing scheme details. | +| `sequence` | `Integer` | Required | The order in which this cycle is to run among other billing cycles. For example, a trial billing cycle has a `sequence` of `1` while a regular billing cycle has a `sequence` of `2`, so that trial cycle runs before the regular cycle.

**Constraints**: `>= 1`, `<= 99` | +| `total_cycles` | `Integer` | Optional | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Constraints**: `>= 0`, `<= 999` | + +## Example (as JSON) + +```json +{ + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 58, + "total_cycles": 248 +} +``` + diff --git a/doc/models/billing-cycle.md b/doc/models/billing-cycle.md index a1a3953..a6348fb 100644 --- a/doc/models/billing-cycle.md +++ b/doc/models/billing-cycle.md @@ -13,7 +13,6 @@ The billing cycle providing details of the billing frequency, amount, duration a | --- | --- | --- | --- | | `tenure_type` | [`TenureType`](../../doc/models/tenure-type.md) | Required | The tenure type of the billing cycle identifies if the billing cycle is a trial(free or discounted) or regular billing cycle.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The pricing scheme details. | -| `frequency` | `Object` | Optional | The frequency details for this billing cycle. | | `total_cycles` | `Integer` | Optional | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Default**: `1`

**Constraints**: `>= 0`, `<= 999` | | `sequence` | `Integer` | Optional | The order in which this cycle is to run among other billing cycles. For example, a trial billing cycle has a `sequence` of `1` while a regular billing cycle has a `sequence` of `2`, so that trial cycle runs before the regular cycle.

**Default**: `1`

**Constraints**: `>= 1`, `<= 3` | | `start_date` | `String` | Optional | The stand-alone date, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). To represent special legal values, such as a date of birth, you should use dates with no associated time or time-zone data. Whenever possible, use the standard `date_time` type. This regular expression does not validate all dates. For example, February 31 is valid and nothing is known about leap years.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `10`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])$` | @@ -36,10 +35,6 @@ The billing cycle providing details of the billing frequency, amount, duration a "value": "value6" } }, - "frequency": { - "key1": "val1", - "key2": "val2" - }, "start_date": "start_date0" } ``` diff --git a/doc/models/billing-plan.md b/doc/models/billing-plan.md new file mode 100644 index 0000000..9722a4f --- /dev/null +++ b/doc/models/billing-plan.md @@ -0,0 +1,40 @@ + +# Billing Plan + +The plan details. + +## Structure + +`BillingPlan` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Optional | The unique PayPal-generated ID for the plan.

**Constraints**: *Minimum Length*: `26`, *Maximum Length*: `26`, *Pattern*: `^P-[A-Z0-9]*$` | +| `product_id` | `String` | Optional | The ID for the product.

**Constraints**: *Minimum Length*: `22`, *Maximum Length*: `22`, *Pattern*: `^PROD-[A-Z0-9]*$` | +| `name` | `String` | Optional | The plan name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `status` | [`SubscriptionPlanStatus`](../../doc/models/subscription-plan-status.md) | Optional | The plan status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `description` | `String` | Optional | The detailed description of the plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `billing_cycles` | [`Array[SubscriptionBillingCycle]`](../../doc/models/subscription-billing-cycle.md) | Optional | An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `12` | +| `payment_preferences` | [`PaymentPreferences`](../../doc/models/payment-preferences.md) | Optional | The payment preferences for a subscription. | +| `merchant_preferences` | [`MerchantPreferences`](../../doc/models/merchant-preferences.md) | Optional | The merchant preferences for a subscription. | +| `taxes` | [`Taxes`](../../doc/models/taxes.md) | Optional | The tax details. | +| `quantity_supported` | `TrueClass \| FalseClass` | Optional | Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

**Default**: `false` | +| `create_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `update_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | + +## Example (as JSON) + +```json +{ + "quantity_supported": false, + "id": "id0", + "product_id": "product_id4", + "name": "name0", + "status": "CREATED", + "description": "description0" +} +``` + diff --git a/doc/models/bin-details.md b/doc/models/bin-details.md index 6e8c51d..d9aed22 100644 --- a/doc/models/bin-details.md +++ b/doc/models/bin-details.md @@ -14,7 +14,7 @@ Bank Identification Number (BIN) details used to fund a payment. | `bin` | `String` | Optional | The Bank Identification Number (BIN) signifies the number that is being used to identify the granular level details (except the PII information) of the card.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[0-9]+$` | | `issuing_bank` | `String` | Optional | The issuer of the card instrument.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | | `bin_country_code` | `String` | Optional | The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | -| `products` | `Array` | Optional | The type of card product assigned to the BIN by the issuer. These values are defined by the issuer and may change over time. Some examples include: PREPAID_GIFT, CONSUMER, CORPORATE.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `256`, *Minimum Length*: `1`, *Maximum Length*: `255` | +| `products` | `Array[String]` | Optional | The type of card product assigned to the BIN by the issuer. These values are defined by the issuer and may change over time. Some examples include: PREPAID_GIFT, CONSUMER, CORPORATE.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `256`, *Minimum Length*: `1`, *Maximum Length*: `255` | ## Example (as JSON) diff --git a/doc/models/blik-experience-context.md b/doc/models/blik-experience-context.md index 209f7fd..203e873 100644 --- a/doc/models/blik-experience-context.md +++ b/doc/models/blik-experience-context.md @@ -13,7 +13,7 @@ Customizes the payer experience during the approval process for the BLIK payment | --- | --- | --- | --- | | `brand_name` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | | `locale` | `String` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | -| `shipping_preference` | [`ShippingPreference`](../../doc/models/shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `ShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `ExperienceContextShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `return_url` | `String` | Optional | Describes the URL. | | `cancel_url` | `String` | Optional | Describes the URL. | | `consumer_ip` | `String` | Optional | An Internet Protocol address (IP address). This address assigns a numerical label to each device that is connected to a computer network through the Internet Protocol. Supports IPv4 and IPv6 addresses.

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `39`, *Pattern*: `^(([0-9]\|[1-9][0-9]\|1[0-9]{2}\|2[0-4][0-9]\|25[0-5])\.){3}([0-9]\|[1-9][0-9]\|1[0-9]{2}\|2[0-4][0-9]\|25[0-5])$\|^(([a-zA-Z]\|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]\|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$\|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}\|:))\|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}\|((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3})\|:))\|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})\|:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3})\|:))\|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})\|((:[0-9A-Fa-f]{1,4})?:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})\|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})\|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})\|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:))\|(:(((:[0-9A-Fa-f]{1,4}){1,7})\|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)(\.(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]?\d)){3}))\|:)))(%.+)?\s*$` | diff --git a/doc/models/callback-configuration.md b/doc/models/callback-configuration.md index e1fe96f..47e9256 100644 --- a/doc/models/callback-configuration.md +++ b/doc/models/callback-configuration.md @@ -11,7 +11,7 @@ CallBack Configuration that the merchant can provide to PayPal/Venmo. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `callback_events` | [`Array`](../../doc/models/callback-events.md) | Required | An array of callback events merchant can subscribe to for the corresponding callback url.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `5`, *Unique Items Required*, *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^[0-9A-Z_]+$` | +| `callback_events` | [`Array[CallbackEvents]`](../../doc/models/callback-events.md) | Required | An array of callback events merchant can subscribe to for the corresponding callback url.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `5`, *Unique Items Required*, *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^[0-9A-Z_]+$` | | `callback_url` | `String` | Required | Merchant provided CallBack url.PayPal/Venmo will use this url to call the merchant back when the events occur .PayPal/Venmo expects a secured url usually in the https format.merchant can append the cart id or other params part of the url as query or path params.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `2040`, *Pattern*: `^.*$` | ## Example (as JSON) diff --git a/doc/models/cancel-subscription-request.md b/doc/models/cancel-subscription-request.md new file mode 100644 index 0000000..2f740b2 --- /dev/null +++ b/doc/models/cancel-subscription-request.md @@ -0,0 +1,23 @@ + +# Cancel Subscription Request + +The cancel subscription request details. + +## Structure + +`CancelSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `reason` | `String` | Required | The reason for the cancellation of a subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | + +## Example (as JSON) + +```json +{ + "reason": "reason8" +} +``` + diff --git a/doc/models/capture-payment-instruction.md b/doc/models/capture-payment-instruction.md index 7344a7f..ba6afd4 100644 --- a/doc/models/capture-payment-instruction.md +++ b/doc/models/capture-payment-instruction.md @@ -11,7 +11,7 @@ Any additional payment instructions to be consider during payment processing. Th | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `platform_fees` | [`Array`](../../doc/models/platform-fee.md) | Optional | An array of platform or partner fees, commissions, or brokerage fees that associated with the captured payment.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | +| `platform_fees` | [`Array[PlatformFee]`](../../doc/models/platform-fee.md) | Optional | An array of platform or partner fees, commissions, or brokerage fees that associated with the captured payment.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | | `disbursement_mode` | [`DisbursementMode`](../../doc/models/disbursement-mode.md) | Optional | The funds that are held on behalf of the merchant.

**Default**: `DisbursementMode::INSTANT`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16`, *Pattern*: `^[A-Z_]+$` | | `payee_receivable_fx_rate_id` | `String` | Optional | FX identifier generated returned by PayPal to be used for payment processing in order to honor FX rate (for eligible integrations) to be used when amount is settled/received into the payee account.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^.*$` | diff --git a/doc/models/capture-request.md b/doc/models/capture-request.md index e253c77..d88ef6c 100644 --- a/doc/models/capture-request.md +++ b/doc/models/capture-request.md @@ -1,6 +1,8 @@ # Capture Request +Captures either a portion or the full authorized amount of an authorized payment. + ## Structure `CaptureRequest` @@ -9,11 +11,11 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `invoice_id` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.{1,127}$` | -| `note_to_payer` | `String` | Optional | An informational note about this settlement. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^.{1,255}$` | | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `invoice_id` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Maximum Length*: `127` | | `final_capture` | `TrueClass \| FalseClass` | Optional | Indicates whether you can make additional captures against the authorized payment. Set to `true` if you do not intend to capture additional payments against the authorization. Set to `false` if you intend to capture additional payments against the authorization.

**Default**: `false` | | `payment_instruction` | [`CapturePaymentInstruction`](../../doc/models/capture-payment-instruction.md) | Optional | Any additional payment instructions to be consider during payment processing. This processing instruction is applicable for Capturing an order or Authorizing an Order. | +| `note_to_payer` | `String` | Optional | An informational note about this settlement. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Maximum Length*: `255` | | `soft_descriptor` | `String` | Optional | The payment descriptor on the payer's account statement.

**Constraints**: *Maximum Length*: `22` | ## Example (as JSON) @@ -21,12 +23,11 @@ ```json { "final_capture": false, - "invoice_id": "invoice_id4", - "note_to_payer": "note_to_payer6", "amount": { "currency_code": "currency_code6", "value": "value0" }, + "invoice_id": "invoice_id4", "payment_instruction": { "platform_fees": [ { @@ -62,7 +63,8 @@ ], "disbursement_mode": "INSTANT", "payee_receivable_fx_rate_id": "payee_receivable_fx_rate_id0" - } + }, + "note_to_payer": "note_to_payer6" } ``` diff --git a/doc/models/capture-subscription-request.md b/doc/models/capture-subscription-request.md new file mode 100644 index 0000000..460ede7 --- /dev/null +++ b/doc/models/capture-subscription-request.md @@ -0,0 +1,30 @@ + +# Capture Subscription Request + +The charge amount from the subscriber. + +## Structure + +`CaptureSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `note` | `String` | Required | The reason or note for the subscription charge.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | +| `capture_type` | [`CaptureType`](../../doc/models/capture-type.md) | Required | The type of capture.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | + +## Example (as JSON) + +```json +{ + "note": "note4", + "capture_type": "OUTSTANDING_BALANCE", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } +} +``` + diff --git a/doc/models/capture-type.md b/doc/models/capture-type.md new file mode 100644 index 0000000..4739ebd --- /dev/null +++ b/doc/models/capture-type.md @@ -0,0 +1,15 @@ + +# Capture Type + +The type of capture. + +## Enumeration + +`CaptureType` + +## Fields + +| Name | Description | +| --- | --- | +| `OUTSTANDING_BALANCE` | The outstanding balance that the subscriber must clear. | + diff --git a/doc/models/captured-payment.md b/doc/models/captured-payment.md index 93ffd86..21dd580 100644 --- a/doc/models/captured-payment.md +++ b/doc/models/captured-payment.md @@ -17,13 +17,13 @@ A captured payment. | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `String` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `final_capture` | `TrueClass \| FalseClass` | Optional | Indicates whether you can make additional captures against the authorized payment. Set to `true` if you do not intend to capture additional payments against the authorization. Set to `false` if you intend to capture additional payments against the authorization.

**Default**: `false` | | `seller_receivable_breakdown` | [`SellerReceivableBreakdown`](../../doc/models/seller-receivable-breakdown.md) | Optional | The detailed breakdown of the capture activity. This is not available for transactions that are in pending state. | | `disbursement_mode` | [`DisbursementMode`](../../doc/models/disbursement-mode.md) | Optional | The funds that are held on behalf of the merchant.

**Default**: `DisbursementMode::INSTANT`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16`, *Pattern*: `^[A-Z_]+$` | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | -| `processor_response` | [`PaymentsProcessorResponse`](../../doc/models/payments-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | +| `processor_response` | [`ProcessorResponse`](../../doc/models/processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | | `create_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `update_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `supplementary_data` | [`PaymentSupplementaryData`](../../doc/models/payment-supplementary-data.md) | Optional | The supplementary data. | diff --git a/doc/models/card-brand.md b/doc/models/card-brand.md index 9c5600c..d02e168 100644 --- a/doc/models/card-brand.md +++ b/doc/models/card-brand.md @@ -35,5 +35,10 @@ The card network or brand. Applies to credit, debit, gift, and payment cards. | `GE` | The GE Credit Union 3Point card payment network. | | `SYNCHRONY` | The Synchrony Financial (SYF) payment network. | | `EFTPOS` | The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment network. | +| `CARTE_BANCAIRE` | The Carte Bancaire payment network. | +| `STAR_ACCESS` | The Star Access payment network. | +| `PULSE` | The Pulse payment network. | +| `NYCE` | The NYCE payment network. | +| `ACCEL` | The Accel payment network. | | `UNKNOWN` | UNKNOWN payment network. | diff --git a/doc/models/card-customer.md b/doc/models/card-customer.md new file mode 100644 index 0000000..fbebde2 --- /dev/null +++ b/doc/models/card-customer.md @@ -0,0 +1,34 @@ + +# Card Customer + +The details about a customer in PayPal's system of record. + +## Structure + +`CardCustomer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `email_address` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | +| `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | +| `merchant_customer_id` | `String` | Optional | Merchants and partners may already have a data-store where their customer information is persisted. Use merchant_customer_id to associate the PayPal-generated customer.id to your representation of a customer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[0-9a-zA-Z-_.^*$@#]+$` | + +## Example (as JSON) + +```json +{ + "id": "id2", + "email_address": "email_address0", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "merchant_customer_id": "merchant_customer_id4" +} +``` + diff --git a/doc/models/card-response-with-billing-address.md b/doc/models/card-response-with-billing-address.md new file mode 100644 index 0000000..fee9435 --- /dev/null +++ b/doc/models/card-response-with-billing-address.md @@ -0,0 +1,36 @@ + +# Card Response With Billing Address + +The payment card used to fund the payment. Card can be a credit or debit card. + +## Structure + +`CardResponseWithBillingAddress` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `String` | Optional | The card holder's name as it appears on the card.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `300` | +| `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | +| `expiry` | `String` | Optional | The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `7`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])$` | +| `currency_code` | `String` | Optional | The [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) that identifies the currency.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3` | + +## Example (as JSON) + +```json +{ + "name": "name0", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + }, + "expiry": "expiry8", + "currency_code": "currency_code4" +} +``` + diff --git a/doc/models/card-response.md b/doc/models/card-response.md index 0b7b561..10c74de 100644 --- a/doc/models/card-response.md +++ b/doc/models/card-response.md @@ -14,7 +14,7 @@ The payment card to use to fund a payment. Card can be a credit or debit card. | `name` | `String` | Optional | The card holder's name as it appears on the card.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `300` | | `last_digits` | `String` | Optional | The last digits of the payment card.

**Constraints**: *Pattern*: `[0-9]{2,}` | | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | -| `available_networks` | [`Array`](../../doc/models/card-brand.md) | Optional | Array of brands or networks associated with the card.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `256`, *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `available_networks` | [`Array[CardBrand]`](../../doc/models/card-brand.md) | Optional | Array of brands or networks associated with the card.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `256`, *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `type` | [`CardType`](../../doc/models/card-type.md) | Optional | Type of card. i.e Credit, Debit and so on.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `authentication_result` | [`AuthenticationResponse`](../../doc/models/authentication-response.md) | Optional | Results of Authentication such as 3D Secure. | | `attributes` | [`CardAttributesResponse`](../../doc/models/card-attributes-response.md) | Optional | Additional attributes associated with the use of this card. | @@ -29,11 +29,11 @@ The payment card to use to fund a payment. Card can be a credit or debit card. { "name": "name0", "last_digits": "last_digits4", - "brand": "UNKNOWN", + "brand": "CARTE_BANCAIRE", "available_networks": [ - "CONFIDIS", - "CONFIGOGA", - "CB_NATIONALE" + "ELO", + "DINERS", + "CHINA_UNION_PAY" ], "type": "CREDIT" } diff --git a/doc/models/card-stored-credential.md b/doc/models/card-stored-credential.md index af64b64..2613cff 100644 --- a/doc/models/card-stored-credential.md +++ b/doc/models/card-stored-credential.md @@ -14,7 +14,7 @@ Provides additional details to process a payment using a `card` that has been st | `payment_initiator` | [`PaymentInitiator`](../../doc/models/payment-initiator.md) | Required | The person or party who initiated or triggered the payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `payment_type` | [`StoredPaymentSourcePaymentType`](../../doc/models/stored-payment-source-payment-type.md) | Required | Indicates the type of the stored payment_source payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `usage` | [`StoredPaymentSourceUsageType`](../../doc/models/stored-payment-source-usage-type.md) | Optional | Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file).

**Default**: `StoredPaymentSourceUsageType::DERIVED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `previous_network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `previous_network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | ## Example (as JSON) @@ -26,7 +26,7 @@ Provides additional details to process a payment using a `card` that has been st "previous_network_transaction_reference": { "id": "id6", "date": "date2", - "network": "DELTA", + "network": "CONFIDIS", "acquirer_reference_number": "acquirer_reference_number8" } } diff --git a/doc/models/card-vault-response.md b/doc/models/card-vault-response.md index ad34b7a..d5bcfa4 100644 --- a/doc/models/card-vault-response.md +++ b/doc/models/card-vault-response.md @@ -13,7 +13,7 @@ The details about a saved Card payment source. | --- | --- | --- | --- | | `id` | `String` | Optional | The PayPal-generated ID for the saved payment source.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | | `status` | [`VaultStatus`](../../doc/models/vault-status.md) | Optional | The vault status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `customer` | [`CardCustomerInformation`](../../doc/models/card-customer-information.md) | Optional | The details about a customer in PayPal's system of record. | ## Example (as JSON) diff --git a/doc/models/card-verification-details.md b/doc/models/card-verification-details.md index 3c01150..d72ad24 100644 --- a/doc/models/card-verification-details.md +++ b/doc/models/card-verification-details.md @@ -13,8 +13,8 @@ Card Verification details including the authorization details and 3D SECURE deta | --- | --- | --- | --- | | `network_transaction_id` | `String` | Optional | DEPRECATED. This field is DEPRECATED. Please find the network transaction id data in the 'id' field under the 'network_transaction_reference' object instead of the 'verification' object.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1024`, *Pattern*: `^[a-zA-Z0-9-_@.:&+=*^'~#!$%()]+$` | | `date` | `String` | Optional | DEPRECATED. This field is DEPRECATED. Please find the date data in the 'date' field under the 'network_transaction_reference' object instead of the 'verification' object.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4`, *Pattern*: `^[0-9]+$` | -| `network` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | -| `time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `network` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | DEPRECATED. This field is DEPRECATED. Please find the network data in the 'network' field under the 'network_transaction_reference' object instead of the 'verification' object.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `time` | `String` | Optional | DEPRECATED. This field is DEPRECATED. Please find the time data in the 'time' field under the 'network_transaction_reference' object instead of the 'verification' object.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `processor_response` | [`CardVerificationProcessorResponse`](../../doc/models/card-verification-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | | `three_d_secure` | `Object` | Optional | DEPRECATED. This field is DEPRECATED. Please find the 3D secure authentication data in the 'three_d_secure' object under the 'authentication_result' object instead of the 'verification' object. | @@ -25,7 +25,7 @@ Card Verification details including the authorization details and 3D SECURE deta { "network_transaction_id": "network_transaction_id4", "date": "date8", - "network": "EFTPOS", + "network": "ACCEL", "time": "time2", "amount": { "currency_code": "currency_code6", diff --git a/doc/models/cart-information.md b/doc/models/cart-information.md new file mode 100644 index 0000000..eacb824 --- /dev/null +++ b/doc/models/cart-information.md @@ -0,0 +1,35 @@ + +# Cart Information + +The cart information. + +## Structure + +`CartInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `item_details` | [`Array[ItemDetails]`](../../doc/models/item-details.md) | Optional | An array of item details.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | +| `tax_inclusive` | `TrueClass \| FalseClass` | Optional | Indicates whether the item amount or the shipping amount already includes tax.

**Default**: `false` | +| `paypal_invoice_id` | `String` | Optional | The ID of the invoice. Appears for only PayPal-generated invoices.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | + +## Example (as JSON) + +```json +{ + "tax_inclusive": false, + "item_details": [ + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + } + ], + "paypal_invoice_id": "paypal_invoice_id2" +} +``` + diff --git a/doc/models/checkout-option.md b/doc/models/checkout-option.md new file mode 100644 index 0000000..ba15cf8 --- /dev/null +++ b/doc/models/checkout-option.md @@ -0,0 +1,25 @@ + +# Checkout Option + +A checkout option as a name-and-value pair. + +## Structure + +`CheckoutOption` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `checkout_option_name` | `String` | Optional | The checkout option name, such as `color` or `texture`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `checkout_option_value` | `String` | Optional | The checkout option value. For example, the checkout option `color` might be `blue` or `red` while the checkout option `texture` might be `smooth` or `rippled`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | + +## Example (as JSON) + +```json +{ + "checkout_option_name": "checkout_option_name6", + "checkout_option_value": "checkout_option_value0" +} +``` + diff --git a/doc/models/cobranded-card.md b/doc/models/cobranded-card.md index 0f59313..406c555 100644 --- a/doc/models/cobranded-card.md +++ b/doc/models/cobranded-card.md @@ -11,7 +11,7 @@ Details about the merchant cobranded card used for order purchase. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `labels` | `Array` | Optional | Array of labels for the cobranded card.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `25`, *Minimum Length*: `1`, *Maximum Length*: `256` | +| `labels` | `Array[String]` | Optional | Array of labels for the cobranded card.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `25`, *Minimum Length*: `1`, *Maximum Length*: `256` | | `payee` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | diff --git a/doc/models/confirm-order-request.md b/doc/models/confirm-order-request.md index 85f6f68..b728797 100644 --- a/doc/models/confirm-order-request.md +++ b/doc/models/confirm-order-request.md @@ -97,7 +97,7 @@ Payer confirms the intent to pay for the Order using the provided payment source "previous_network_transaction_reference": { "id": "id6", "date": "date2", - "network": "DELTA", + "network": "CONFIDIS", "acquirer_reference_number": "acquirer_reference_number8" } } diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md new file mode 100644 index 0000000..8e14005 --- /dev/null +++ b/doc/models/create-subscription-request.md @@ -0,0 +1,82 @@ + +# Create Subscription Request + +The create subscription request details. + +## Structure + +`CreateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `plan_id` | `String` | Required | The ID of the plan.

**Constraints**: *Minimum Length*: `26`, *Maximum Length*: `26`, *Pattern*: `^P-[A-Z0-9]*$` | +| `start_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `quantity` | `String` | Optional | The quantity of the product in the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `subscriber` | [`SubscriberRequest`](../../doc/models/subscriber-request.md) | Optional | The subscriber request information . | +| `auto_renewal` | `TrueClass \| FalseClass` | Optional | DEPRECATED. Indicates whether the subscription auto-renews after the billing cycles complete.

**Default**: `false` | +| `application_context` | [`SubscriptionApplicationContext`](../../doc/models/subscription-application-context.md) | Optional | DEPRECATED. The application context, which customizes the payer experience during the subscription approval process with PayPal. | +| `custom_id` | `String` | Optional | The custom id for the subscription. Can be invoice id.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[\x20-\x7E]+` | +| `plan` | [`PlanOverride`](../../doc/models/plan-override.md) | Optional | An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. | + +## Example (as JSON) + +```json +{ + "plan_id": "plan_id8", + "auto_renewal": false, + "start_time": "start_time0", + "quantity": "quantity2", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "subscriber": { + "name": { + "given_name": "given_name2", + "surname": "surname8" + }, + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "payment_source": { + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "security_code": "security_code8", + "type": "UNKNOWN" + } + } + } +} +``` + diff --git a/doc/models/customer-vault-payment-tokens-response.md b/doc/models/customer-vault-payment-tokens-response.md index be7d69b..d86e052 100644 --- a/doc/models/customer-vault-payment-tokens-response.md +++ b/doc/models/customer-vault-payment-tokens-response.md @@ -14,8 +14,8 @@ Collection of payment tokens saved for a given customer. | `total_items` | `Integer` | Optional | Total number of items.

**Constraints**: `>= 1`, `<= 50` | | `total_pages` | `Integer` | Optional | Total number of pages.

**Constraints**: `>= 1`, `<= 10` | | `customer` | [`VaultResponseCustomer`](../../doc/models/vault-response-customer.md) | Optional | This object defines a customer in your system. Use it to manage customer profiles, save payment methods and contact details. | -| `payment_tokens` | [`Array`](../../doc/models/payment-token-response.md) | Optional | **Constraints**: *Minimum Items*: `0`, *Maximum Items*: `64` | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | +| `payment_tokens` | [`Array[PaymentTokenResponse]`](../../doc/models/payment-token-response.md) | Optional | **Constraints**: *Minimum Items*: `0`, *Maximum Items*: `64` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | ## Example (as JSON) @@ -48,7 +48,7 @@ Collection of payment tokens saved for a given customer. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -66,6 +66,7 @@ Collection of payment tokens saved for a given customer. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -90,6 +91,7 @@ Collection of payment tokens saved for a given customer. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -112,7 +114,7 @@ Collection of payment tokens saved for a given customer. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", @@ -147,7 +149,7 @@ Collection of payment tokens saved for a given customer. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -165,6 +167,7 @@ Collection of payment tokens saved for a given customer. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -189,6 +192,7 @@ Collection of payment tokens saved for a given customer. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -211,7 +215,7 @@ Collection of payment tokens saved for a given customer. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/cycle-execution.md b/doc/models/cycle-execution.md new file mode 100644 index 0000000..e303a74 --- /dev/null +++ b/doc/models/cycle-execution.md @@ -0,0 +1,33 @@ + +# Cycle Execution + +The regular and trial execution details for a billing cycle. + +## Structure + +`CycleExecution` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `tenure_type` | [`TenureType`](../../doc/models/tenure-type.md) | Required | The type of the billing cycle.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `sequence` | `Integer` | Required | The order in which to run this cycle among other billing cycles.

**Constraints**: `>= 0`, `<= 99` | +| `cycles_completed` | `Integer` | Required | The number of billing cycles that have completed.

**Constraints**: `>= 0`, `<= 9999` | +| `cycles_remaining` | `Integer` | Optional | For a finite billing cycle, cycles_remaining is the number of remaining cycles. For an infinite billing cycle, cycles_remaining is set as 0.

**Constraints**: `>= 0`, `<= 9999` | +| `current_pricing_scheme_version` | `Integer` | Optional | The active pricing scheme version for the billing cycle.

**Constraints**: `>= 1`, `<= 99` | +| `total_cycles` | `Integer` | Optional | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Constraints**: `>= 0`, `<= 999` | + +## Example (as JSON) + +```json +{ + "tenure_type": "REGULAR", + "sequence": 99, + "cycles_completed": 172, + "cycles_remaining": 208, + "current_pricing_scheme_version": 99, + "total_cycles": 60 +} +``` + diff --git a/doc/models/default-error-exception.md b/doc/models/default-error-exception.md new file mode 100644 index 0000000..8af0dc8 --- /dev/null +++ b/doc/models/default-error-exception.md @@ -0,0 +1,47 @@ + +# Default Error Exception + +The error details. + +## Structure + +`DefaultErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `String` | Required | The human-readable, unique name of the error. | +| `message` | `String` | Required | The message that describes the error. | +| `debug_id` | `String` | Required | The PayPal internal ID. Used for correlation purposes. | +| `information_link` | `String` | Optional | The information link, or URI, that shows detailed information about this error for the developer. | +| `details` | [`Array[TransactionSearchErrorDetails]`](../../doc/models/transaction-search-error-details.md) | Optional | An array of additional details about the error. | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | + +## Example (as JSON) + +```json +{ + "name": "name2", + "message": "message2", + "debug_id": "debug_id8", + "information_link": "information_link4", + "details": [ + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "description": "description0" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/error-details.md b/doc/models/error-details.md index 249f002..e574388 100644 --- a/doc/models/error-details.md +++ b/doc/models/error-details.md @@ -15,7 +15,7 @@ The error details. Required for client-side `4XX` errors. | `value` | `String` | Optional | The value of the field that caused the error. | | `location` | `String` | Optional | The location of the field that caused the error. Value is `body`, `path`, or `query`.

**Default**: `'body'` | | `issue` | `String` | Required | The unique, fine-grained application-level error code. | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links) that are either relevant to the issue by providing additional information or offering potential resolutions.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `4` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links) that are either relevant to the issue by providing additional information or offering potential resolutions.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `4` | | `description` | `String` | Optional | The human-readable description for an issue. The description can change over the lifetime of an API, so clients must not depend on this value. | ## Example (as JSON) diff --git a/doc/models/error-exception.md b/doc/models/error-exception.md index fa8252a..db0805c 100644 --- a/doc/models/error-exception.md +++ b/doc/models/error-exception.md @@ -14,8 +14,8 @@ The error details. | `name` | `String` | Required | The human-readable, unique name of the error. | | `message` | `String` | Required | The message that describes the error. | | `debug_id` | `String` | Required | The PayPal internal ID. Used for correlation purposes. | -| `details` | [`Array`](../../doc/models/error-details.md) | Optional | An array of additional details about the error. | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links). | +| `details` | [`Array[ErrorDetails]`](../../doc/models/error-details.md) | Optional | An array of additional details about the error. | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links). | ## Example (as JSON) diff --git a/doc/models/experience-context-shipping-preference.md b/doc/models/experience-context-shipping-preference.md new file mode 100644 index 0000000..7faad7c --- /dev/null +++ b/doc/models/experience-context-shipping-preference.md @@ -0,0 +1,17 @@ + +# Experience Context Shipping Preference + +The location from which the shipping address is derived., The shipping preference. This only applies to PayPal payment source., The shipping preference. This only applies to PayPal payment source., The location from which the shipping address is derived. + +## Enumeration + +`ExperienceContextShippingPreference` + +## Fields + +| Name | Description | +| --- | --- | +| `GET_FROM_FILE` | Get the customer-provided shipping address on the PayPal site. | +| `NO_SHIPPING` | Redacts the shipping address from the PayPal site. Recommended for digital goods. | +| `SET_PROVIDED_ADDRESS` | Merchant sends the shipping address using purchase_units.shipping.address. The customer cannot change this address on the PayPal site. | + diff --git a/doc/models/experience-context.md b/doc/models/experience-context.md index 4f4ef91..3b8c240 100644 --- a/doc/models/experience-context.md +++ b/doc/models/experience-context.md @@ -13,7 +13,7 @@ Customizes the payer experience during the approval process for the payment. | --- | --- | --- | --- | | `brand_name` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | | `locale` | `String` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | -| `shipping_preference` | [`ShippingPreference`](../../doc/models/shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `ShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `ExperienceContextShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `return_url` | `String` | Optional | Describes the URL. | | `cancel_url` | `String` | Optional | Describes the URL. | diff --git a/doc/models/experience-status.md b/doc/models/experience-status.md new file mode 100644 index 0000000..65f589a --- /dev/null +++ b/doc/models/experience-status.md @@ -0,0 +1,18 @@ + +# Experience Status + +This field indicates the status of PayPal's Checkout experience throughout the order lifecycle. The values reflect the current stage of the checkout process. + +## Enumeration + +`ExperienceStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `NOT_STARTED` | PayPal checkout process has not yet begun. | +| `IN_PROGRESS` | PayPal checkout initiated. User is on the checkout page for order review before approval. | +| `CANCELED` | PayPal checkout is canceled (by closing the checkout window or clicking cancel) before the order approval. | +| `APPROVED` | Order is approved. User has completed the checkout process. | + diff --git a/doc/models/failed-payment-details.md b/doc/models/failed-payment-details.md new file mode 100644 index 0000000..1e85469 --- /dev/null +++ b/doc/models/failed-payment-details.md @@ -0,0 +1,32 @@ + +# Failed Payment Details + +The details for the failed payment of the subscription. + +## Structure + +`FailedPaymentDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | +| `time` | `String` | Required | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `reason_code` | [`ReasonCode`](../../doc/models/reason-code.md) | Optional | The reason code for the payment failure.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `120`, *Pattern*: `^[A-Z_]+$` | +| `next_payment_retry_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | + +## Example (as JSON) + +```json +{ + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "time": "time6", + "reason_code": "TRANSACTION_RECEIVING_LIMIT_EXCEEDED", + "next_payment_retry_time": "next_payment_retry_time6" +} +``` + diff --git a/doc/models/frequency.md b/doc/models/frequency.md new file mode 100644 index 0000000..d46be79 --- /dev/null +++ b/doc/models/frequency.md @@ -0,0 +1,25 @@ + +# Frequency + +The frequency of the billing cycle. + +## Structure + +`Frequency` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | The interval at which the subscription is charged or billed.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `interval_count` | `Integer` | Optional | The number of intervals after which a subscriber is billed. For example, if the `interval_unit` is `DAY` with an `interval_count` of `2`, the subscription is billed once every two days. The following table lists the maximum allowed values for the `interval_count` for each `interval_unit`: Interval unit Maximum interval count DAY 365 WEEK 52 MONTH 12 YEAR 1

**Default**: `1`

**Constraints**: `>= 1`, `<= 365` | + +## Example (as JSON) + +```json +{ + "interval_unit": "DAY", + "interval_count": 1 +} +``` + diff --git a/doc/models/google-pay-card-response.md b/doc/models/google-pay-card-response.md index 9055f9d..5ae74f7 100644 --- a/doc/models/google-pay-card-response.md +++ b/doc/models/google-pay-card-response.md @@ -25,7 +25,7 @@ The payment card to use to fund a Google Pay payment response. Can be a credit o "name": "name4", "last_digits": "last_digits8", "type": "DEBIT", - "brand": "ELECTRON", + "brand": "ACCEL", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/google-pay-request-card.md b/doc/models/google-pay-request-card.md index e86a0e0..2023561 100644 --- a/doc/models/google-pay-request-card.md +++ b/doc/models/google-pay-request-card.md @@ -22,7 +22,7 @@ The payment card used to fund a Google Pay payment. Can be a credit or debit car { "name": "name8", "type": "STORE", - "brand": "DISCOVER", + "brand": "CONFIDIS", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/google-pay-request.md b/doc/models/google-pay-request.md index 886ed39..f6748b2 100644 --- a/doc/models/google-pay-request.md +++ b/doc/models/google-pay-request.md @@ -32,7 +32,7 @@ Information needed to pay using Google Pay. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/google-pay-wallet-response.md b/doc/models/google-pay-wallet-response.md index e395fb1..87d57a1 100644 --- a/doc/models/google-pay-wallet-response.md +++ b/doc/models/google-pay-wallet-response.md @@ -30,7 +30,7 @@ Google Pay Wallet payment data. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/incentive-details.md b/doc/models/incentive-details.md new file mode 100644 index 0000000..963c6b8 --- /dev/null +++ b/doc/models/incentive-details.md @@ -0,0 +1,32 @@ + +# Incentive Details + +The incentive details. + +## Structure + +`IncentiveDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `incentive_type` | `String` | Optional | The type of incentive, such as a special offer or coupon.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `incentive_code` | `String` | Optional | The code that identifies an incentive, such as a coupon.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `incentive_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `incentive_program_code` | `String` | Optional | The incentive program code that identifies a merchant loyalty or incentive program.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | + +## Example (as JSON) + +```json +{ + "incentive_type": "incentive_type4", + "incentive_code": "incentive_code0", + "incentive_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "incentive_program_code": "incentive_program_code4" +} +``` + diff --git a/doc/models/incentive-information.md b/doc/models/incentive-information.md new file mode 100644 index 0000000..75eb98e --- /dev/null +++ b/doc/models/incentive-information.md @@ -0,0 +1,51 @@ + +# Incentive Information + +The incentive details. + +## Structure + +`IncentiveInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `incentive_details` | [`Array[IncentiveDetails]`](../../doc/models/incentive-details.md) | Optional | An array of incentive details.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | + +## Example (as JSON) + +```json +{ + "incentive_details": [ + { + "incentive_type": "incentive_type4", + "incentive_code": "incentive_code0", + "incentive_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "incentive_program_code": "incentive_program_code4" + }, + { + "incentive_type": "incentive_type4", + "incentive_code": "incentive_code0", + "incentive_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "incentive_program_code": "incentive_program_code4" + }, + { + "incentive_type": "incentive_type4", + "incentive_code": "incentive_code0", + "incentive_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "incentive_program_code": "incentive_program_code4" + } + ] +} +``` + diff --git a/doc/models/interval-unit.md b/doc/models/interval-unit.md new file mode 100644 index 0000000..df7ce04 --- /dev/null +++ b/doc/models/interval-unit.md @@ -0,0 +1,18 @@ + +# Interval Unit + +The interval at which the subscription is charged or billed. + +## Enumeration + +`IntervalUnit` + +## Fields + +| Name | Description | +| --- | --- | +| `DAY` | A daily billing cycle. | +| `WEEK` | A weekly billing cycle. | +| `MONTH` | A monthly billing cycle. | +| `YEAR` | A yearly billing cycle. | + diff --git a/doc/models/item-details.md b/doc/models/item-details.md new file mode 100644 index 0000000..4a76f96 --- /dev/null +++ b/doc/models/item-details.md @@ -0,0 +1,45 @@ + +# Item Details + +The item details. + +## Structure + +`ItemDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `item_code` | `String` | Optional | An item code that identifies a merchant's goods or service.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `item_name` | `String` | Optional | The item name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `item_description` | `String` | Optional | The item description.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `item_options` | `String` | Optional | The item options. Describes option choices on the purchase of the item in some detail.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `item_quantity` | `String` | Optional | The number of purchased units of goods or a service.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `item_unit_price` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `item_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `discount_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `adjustment_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `gift_wrap_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `tax_percentage` | `String` | Optional | The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.

**Constraints**: *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | +| `tax_amounts` | [`Array[TaxAmount]`](../../doc/models/tax-amount.md) | Optional | An array of tax amounts levied by a government on the purchase of goods or services.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | +| `basic_shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `extra_shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `handling_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `insurance_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `total_item_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `invoice_number` | `String` | Optional | The invoice number. An alphanumeric string that identifies a billing for a merchant.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `200`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `checkout_options` | [`Array[CheckoutOption]`](../../doc/models/checkout-option.md) | Optional | An array of checkout options. Each option has a name and value.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | + +## Example (as JSON) + +```json +{ + "item_code": "item_code4", + "item_name": "item_name2", + "item_description": "item_description0", + "item_options": "item_options4", + "item_quantity": "item_quantity4" +} +``` + diff --git a/doc/models/item-request.md b/doc/models/item-request.md new file mode 100644 index 0000000..b2c6c13 --- /dev/null +++ b/doc/models/item-request.md @@ -0,0 +1,46 @@ + +# Item Request + +The details for the items to be purchased. + +## Structure + +`ItemRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `String` | Required | The item name or title.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | +| `unit_amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | +| `tax` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `quantity` | `String` | Required | The item quantity. Must be a whole number.

**Constraints**: *Maximum Length*: `10`, *Pattern*: `^[1-9][0-9]{0,9}$` | +| `description` | `String` | Optional | This field supports up to 4000 characters, but any content beyond 2048 characters (including spaces) will be truncated. The 2048 character limit is reflected in the response representation of this field.

**Constraints**: *Maximum Length*: `4000` | +| `sku` | `String` | Optional | The stock keeping unit (SKU) for the item.

**Constraints**: *Maximum Length*: `127` | +| `url` | `String` | Optional | The URL to the item being purchased. Visible to buyer and used in buyer experiences.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048` | +| `category` | [`ItemCategory`](../../doc/models/item-category.md) | Optional | The item category type.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20` | +| `image_url` | `String` | Optional | The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^(https:)([/\|.\|\w\|\s\|-])*\.(?:jpg\|gif\|png\|jpeg\|JPG\|GIF\|PNG\|JPEG)` | +| `upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | +| `billing_plan` | [`OrderBillingPlan`](../../doc/models/order-billing-plan.md) | Optional | Metadata for merchant-managed recurring billing plans. Valid only during the saved payment method token or billing agreement creation. | + +## Example (as JSON) + +```json +{ + "name": "name0", + "unit_amount": { + "currency_code": "currency_code2", + "value": "value8" + }, + "tax": { + "currency_code": "currency_code0", + "value": "value6" + }, + "quantity": "quantity6", + "description": "description0", + "sku": "sku6", + "url": "url4", + "category": "DIGITAL_GOODS" +} +``` + diff --git a/doc/models/item.md b/doc/models/item.md index c9b41e7..6af8a75 100644 --- a/doc/models/item.md +++ b/doc/models/item.md @@ -19,7 +19,7 @@ The details for the items to be purchased. | `sku` | `String` | Optional | The stock keeping unit (SKU) for the item.

**Constraints**: *Maximum Length*: `127` | | `url` | `String` | Optional | The URL to the item being purchased. Visible to buyer and used in buyer experiences.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048` | | `category` | [`ItemCategory`](../../doc/models/item-category.md) | Optional | The item category type.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20` | -| `image_url` | `String` | Optional | The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^(https:)([/\|.\|\w\|\s\|-])*\.(?:jpg\|gif\|png\|jpeg\|JPG\|GIF\|PNG\|JPEG)` | +| `image_url` | `String` | Optional | The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^(https:)([/\|.\|\w\|\s\|-])*\.(?:jpg\|gif\|png\|jpeg\|JPG\|GIF\|PNG\|JPEG)(\?.*)?$` | | `upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | | `billing_plan` | [`OrderBillingPlan`](../../doc/models/order-billing-plan.md) | Optional | Metadata for merchant-managed recurring billing plans. Valid only during the saved payment method token or billing agreement creation. | diff --git a/doc/models/last-payment-details.md b/doc/models/last-payment-details.md new file mode 100644 index 0000000..1ca974c --- /dev/null +++ b/doc/models/last-payment-details.md @@ -0,0 +1,26 @@ + +# Last Payment Details + +## Structure + +`LastPaymentDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | + +## Example (as JSON) + +```json +{ + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "time": "time0" +} +``` + diff --git a/doc/models/level-3-card-processing-data.md b/doc/models/level-3-card-processing-data.md index bba025a..92e0005 100644 --- a/doc/models/level-3-card-processing-data.md +++ b/doc/models/level-3-card-processing-data.md @@ -16,7 +16,7 @@ The level 3 card processing data collections, If your merchant account has been | `discount_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `shipping_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | | `ships_from_postal_code` | `String` | Optional | Use this field to specify the postal code of the shipping location.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60`, *Pattern*: `^[a-zA-Z0-9_'.-]*$` | -| `line_items` | [`Array`](../../doc/models/line-item.md) | Optional | A list of the items that were purchased with this payment. If your merchant account has been configured for Level 3 processing this field will be passed to the processor on your behalf.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `100` | +| `line_items` | [`Array[LineItem]`](../../doc/models/line-item.md) | Optional | A list of the items that were purchased with this payment. If your merchant account has been configured for Level 3 processing this field will be passed to the processor on your behalf.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `100` | ## Example (as JSON) diff --git a/doc/models/line-item.md b/doc/models/line-item.md index ce2e434..392fd62 100644 --- a/doc/models/line-item.md +++ b/doc/models/line-item.md @@ -16,7 +16,7 @@ The line items for this purchase. If your merchant account has been configured f | `description` | `String` | Optional | The detailed item description.

**Constraints**: *Maximum Length*: `2048` | | `sku` | `String` | Optional | The stock keeping unit (SKU) for the item.

**Constraints**: *Maximum Length*: `127` | | `url` | `String` | Optional | The URL to the item being purchased. Visible to buyer and used in buyer experiences.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048` | -| `image_url` | `String` | Optional | The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^(https:)([/\|.\|\w\|\s\|-])*\.(?:jpg\|gif\|png\|jpeg\|JPG\|GIF\|PNG\|JPEG)` | +| `image_url` | `String` | Optional | The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^(https:)([/\|.\|\w\|\s\|-])*\.(?:jpg\|gif\|png\|jpeg\|JPG\|GIF\|PNG\|JPEG)(\?.*)?$` | | `upc` | [`UniversalProductCode`](../../doc/models/universal-product-code.md) | Optional | The Universal Product Code of the item. | | `billing_plan` | [`OrderBillingPlan`](../../doc/models/order-billing-plan.md) | Optional | Metadata for merchant-managed recurring billing plans. Valid only during the saved payment method token or billing agreement creation. | | `unit_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | diff --git a/doc/models/link-http-method.md b/doc/models/link-http-method.md index 0d9087f..4e22f23 100644 --- a/doc/models/link-http-method.md +++ b/doc/models/link-http-method.md @@ -9,14 +9,14 @@ The HTTP method required to make the related call. ## Fields -| Name | -| --- | -| `GET` | -| `POST` | -| `PUT` | -| `DELETE` | -| `HEAD` | -| `CONNECT` | -| `OPTIONS` | -| `PATCH` | +| Name | Description | +| --- | --- | +| `GET` | The HTTP GET method. | +| `POST` | The HTTP POST method. | +| `PUT` | The HTTP PUT method. | +| `DELETE` | The HTTP DELETE method. | +| `HEAD` | The HTTP HEAD method. | +| `CONNECT` | The HTTP CONNECT method. | +| `OPTIONS` | The HTTP OPTIONS method. | +| `PATCH` | The HTTP PATCH method. | diff --git a/doc/models/merchant-preferences.md b/doc/models/merchant-preferences.md new file mode 100644 index 0000000..fd11119 --- /dev/null +++ b/doc/models/merchant-preferences.md @@ -0,0 +1,25 @@ + +# Merchant Preferences + +The merchant preferences for a subscription. + +## Structure + +`MerchantPreferences` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `return_url` | `String` | Optional | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | +| `cancel_url` | `String` | Optional | The URL where the customer is redirected after the customer cancels the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | + +## Example (as JSON) + +```json +{ + "return_url": "return_url8", + "cancel_url": "cancel_url0" +} +``` + diff --git a/doc/models/mobile-return-flow.md b/doc/models/mobile-return-flow.md new file mode 100644 index 0000000..4236a9b --- /dev/null +++ b/doc/models/mobile-return-flow.md @@ -0,0 +1,16 @@ + +# Mobile Return Flow + +Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the PayPal App. + +## Enumeration + +`MobileReturnFlow` + +## Fields + +| Name | Description | +| --- | --- | +| `AUTO` | After payment approval in the PayPal App, buyer will automatically be redirected to the merchant website. | +| `MANUAL` | After payment approval in the PayPal App, buyer will be asked to manually navigate back to the merchant website where they started the transaction from. The buyer is shown a message like 'Return to Merchant' to return to the source where the transaction actually started. | + diff --git a/doc/models/mobile-web-context.md b/doc/models/mobile-web-context.md new file mode 100644 index 0000000..ebe04d8 --- /dev/null +++ b/doc/models/mobile-web-context.md @@ -0,0 +1,25 @@ + +# Mobile Web Context + +Buyer's mobile web browser context to app switch to the PayPal consumer app. + +## Structure + +`MobileWebContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `return_flow` | [`MobileReturnFlow`](../../doc/models/mobile-return-flow.md) | Optional | Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the PayPal App.

**Default**: `MobileReturnFlow::AUTO`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `6`, *Pattern*: `^[A-Z_]+$` | +| `buyer_user_agent` | `String` | Optional | User agent from the request originating from the buyer's device. This will be used to identify the buyer's operating system and browser versions. NOTE: Merchants must not alter or modify the buyer's device user agent.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `512`, *Pattern*: `^.*$` | + +## Example (as JSON) + +```json +{ + "return_flow": "AUTO", + "buyer_user_agent": "buyer_user_agent8" +} +``` + diff --git a/doc/models/modify-subscription-request.md b/doc/models/modify-subscription-request.md new file mode 100644 index 0000000..b6dfa65 --- /dev/null +++ b/doc/models/modify-subscription-request.md @@ -0,0 +1,66 @@ + +# Modify Subscription Request + +The request to update the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the `shipping_amount` and `shipping_address` values for the subscription. This type of update requires the buyer's consent. + +## Structure + +`ModifySubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `plan_id` | `String` | Optional | The unique PayPal-generated ID for the plan.

**Constraints**: *Minimum Length*: `26`, *Maximum Length*: `26`, *Pattern*: `^P-[A-Z0-9]*$` | +| `quantity` | `String` | Optional | The quantity of the product or service in the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_address` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | +| `application_context` | [`SubscriptionPatchApplicationContext`](../../doc/models/subscription-patch-application-context.md) | Optional | The application context, which customizes the payer experience during the subscription approval process with PayPal. | +| `plan` | [`PlanOverride`](../../doc/models/plan-override.md) | Optional | An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. | + +## Example (as JSON) + +```json +{ + "plan_id": "plan_id6", + "quantity": "quantity0", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "application_context": { + "brand_name": "brand_name8", + "locale": "locale2", + "shipping_preference": "SET_PROVIDED_ADDRESS", + "payment_method": { + "payee_preferred": "UNRESTRICTED" + }, + "return_url": "return_url0", + "cancel_url": "cancel_url2" + } +} +``` + diff --git a/doc/models/modify-subscription-response.md b/doc/models/modify-subscription-response.md new file mode 100644 index 0000000..c21f966 --- /dev/null +++ b/doc/models/modify-subscription-response.md @@ -0,0 +1,152 @@ + +# Modify Subscription Response + +The response to a request to update the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the `shipping_amount` and `shipping_address` values for the subscription. This type of update requires the buyer's consent. + +## Structure + +`ModifySubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `plan_id` | `String` | Optional | The unique PayPal-generated ID for the plan.

**Constraints**: *Minimum Length*: `26`, *Maximum Length*: `26`, *Pattern*: `^P-[A-Z0-9]*$` | +| `quantity` | `String` | Optional | The quantity of the product or service in the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_address` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | +| `plan` | [`PlanOverride`](../../doc/models/plan-override.md) | Optional | An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. | +| `plan_overridden` | `TrueClass \| FalseClass` | Optional | Indicates whether the subscription has overridden any plan attributes. | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | + +## Example (as JSON) + +```json +{ + "plan_id": "plan_id6", + "quantity": "quantity0", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "plan": { + "billing_cycles": [ + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + }, + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + } + ], + "payment_preferences": { + "auto_bill_outstanding": false, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + }, + "setup_fee_failure_action": "CONTINUE", + "payment_failure_threshold": 104 + }, + "taxes": { + "percentage": "percentage8", + "inclusive": false + } + } +} +``` + diff --git a/doc/models/native-app-context.md b/doc/models/native-app-context.md new file mode 100644 index 0000000..85fd1cb --- /dev/null +++ b/doc/models/native-app-context.md @@ -0,0 +1,25 @@ + +# Native App Context + +Merchant provided, buyer's native app preferences to app switch to the PayPal consumer app. + +## Structure + +`NativeAppContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `os_type` | [`OsType`](../../doc/models/os-type.md) | Optional | Operating System type of the device that the buyer is using.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `7`, *Pattern*: `^[A-Z_]+$` | +| `os_version` | `String` | Optional | Operating System version of the device that the buyer is using.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^.*$` | + +## Example (as JSON) + +```json +{ + "os_type": "ANDROID", + "os_version": "os_version0" +} +``` + diff --git a/doc/models/network-transaction-reference-entity.md b/doc/models/network-transaction-reference-entity.md index 0cc8328..98c27cd 100644 --- a/doc/models/network-transaction-reference-entity.md +++ b/doc/models/network-transaction-reference-entity.md @@ -22,7 +22,7 @@ Previous network transaction reference including id and network. { "id": "id6", "date": "date2", - "network": "SYNCHRONY", + "network": "CONFIDIS", "time": "time6" } ``` diff --git a/doc/models/network-transaction-reference.md b/doc/models/network-transaction.md similarity index 74% rename from doc/models/network-transaction-reference.md rename to doc/models/network-transaction.md index a156fc7..7370a74 100644 --- a/doc/models/network-transaction-reference.md +++ b/doc/models/network-transaction.md @@ -1,18 +1,18 @@ -# Network Transaction Reference +# Network Transaction Reference values used by the card network to identify a transaction. ## Structure -`NetworkTransactionReference` +`NetworkTransaction` ## Fields | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Required | Transaction reference id returned by the scheme. For Visa and Amex, this is the "Tran id" field in response. For MasterCard, this is the "BankNet reference id" field in response. For Discover, this is the "NRID" field in response. The pattern we expect for this field from Visa/Amex/CB/Discover is numeric, Mastercard/BNPP is alphanumeric and Paysecure is alphanumeric with special character -.

**Constraints**: *Minimum Length*: `9`, *Maximum Length*: `36`, *Pattern*: `^[a-zA-Z0-9-_@.:&+=*^'~#!$%()]+$` | -| `date` | `String` | Optional | The date that the transaction was authorized by the scheme. This field may not be returned for all networks. MasterCard refers to this field as "BankNet reference date.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4`, *Pattern*: `^[0-9]+$` | +| `id` | `String` | Optional | Transaction reference id returned by the scheme. For Visa and Amex, this is the "Tran id" field in response. For MasterCard, this is the "BankNet reference id" field in response. For Discover, this is the "NRID" field in response. The pattern we expect for this field from Visa/Amex/CB/Discover is numeric, Mastercard/BNPP is alphanumeric and Paysecure is alphanumeric with special character -.

**Constraints**: *Minimum Length*: `9`, *Maximum Length*: `36`, *Pattern*: `^[a-zA-Z0-9-_@.:&+=*^'~#!$%()]+$` | +| `date` | `String` | Optional | The date that the transaction was authorized by the scheme. This field may not be returned for all networks. MasterCard refers to this field as "BankNet reference date". For some specific networks, such as MasterCard and Discover, this date field is mandatory when the `previous_network_transaction_reference_id` is passed.

**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4`, *Pattern*: `^[0-9]+$` | | `network` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `acquirer_reference_number` | `String` | Optional | Reference ID issued for the card transaction. This ID can be used to track the transaction across processors, card brands and issuing banks.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[a-zA-Z0-9]+$` | @@ -20,10 +20,10 @@ Reference values used by the card network to identify a transaction. ```json { - "id": "id6", - "date": "date8", - "network": "ELECTRON", - "acquirer_reference_number": "acquirer_reference_number2" + "id": "id0", + "date": "date4", + "network": "CETELEM", + "acquirer_reference_number": "acquirer_reference_number8" } ``` diff --git a/doc/models/order-application-context-shipping-preference.md b/doc/models/order-application-context-shipping-preference.md index 62f08d8..407668d 100644 --- a/doc/models/order-application-context-shipping-preference.md +++ b/doc/models/order-application-context-shipping-preference.md @@ -1,7 +1,7 @@ # Order Application Context Shipping Preference -DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping address to the customer. Enables the customer to choose an address on the PayPal site. Restricts the customer from changing the address during the payment-approval process. . The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.shipping_preference`). Please specify this field in the `experience_context` object instead of the `application_context` object., The shipping preference. This only applies to PayPal payment source., The shipping preference. This only applies to PayPal payment source. +DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping address to the customer. Enables the customer to choose an address on the PayPal site. Restricts the customer from changing the address during the payment-approval process. . The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.shipping_preference`). Please specify this field in the `experience_context` object instead of the `application_context` object. ## Enumeration diff --git a/doc/models/order-application-context.md b/doc/models/order-application-context.md index 0489f34..0d3b2cd 100644 --- a/doc/models/order-application-context.md +++ b/doc/models/order-application-context.md @@ -12,14 +12,14 @@ Customizes the payer experience during the approval process for the payment with | Name | Type | Tags | Description | | --- | --- | --- | --- | | `brand_name` | `String` | Optional | DEPRECATED. The label that overrides the business name in the PayPal account on the PayPal site. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.brand_name`). Please specify this field in the `experience_context` object instead of the `application_context` object.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | -| `locale` | `String` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | +| `locale` | `String` | Optional | DEPRECATED. The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.locale`). Please specify this field in the `experience_context` object instead of the `application_context` object.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | | `landing_page` | [`OrderApplicationContextLandingPage`](../../doc/models/order-application-context-landing-page.md) | Optional | DEPRECATED. DEPRECATED. The type of landing page to show on the PayPal site for customer checkout. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.landing_page`). Please specify this field in the `experience_context` object instead of the `application_context` object.

**Default**: `OrderApplicationContextLandingPage::NO_PREFERENCE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `13`, *Pattern*: `^[0-9A-Z_]+$` | | `shipping_preference` | [`OrderApplicationContextShippingPreference`](../../doc/models/order-application-context-shipping-preference.md) | Optional | DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping address to the customer. Enables the customer to choose an address on the PayPal site. Restricts the customer from changing the address during the payment-approval process. . The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.shipping_preference`). Please specify this field in the `experience_context` object instead of the `application_context` object.

**Default**: `OrderApplicationContextShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20`, *Pattern*: `^[0-9A-Z_]+$` | | `user_action` | [`OrderApplicationContextUserAction`](../../doc/models/order-application-context-user-action.md) | Optional | DEPRECATED. Configures a Continue or Pay Now checkout flow. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.user_action`). Please specify this field in the `experience_context` object instead of the `application_context` object.

**Default**: `OrderApplicationContextUserAction::CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `8`, *Pattern*: `^[0-9A-Z_]+$` | -| `payment_method` | [`PaymentMethodPreference`](../../doc/models/payment-method-preference.md) | Optional | The customer and merchant payment preferences. | +| `payment_method` | [`PaymentMethodPreference`](../../doc/models/payment-method-preference.md) | Optional | DEPRECATED. The customer and merchant payment preferences. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.payment_method_selected`). Please specify this field in the `experience_context` object instead of the `application_context` object.. | | `return_url` | `String` | Optional | DEPRECATED. The URL where the customer is redirected after the customer approves the payment. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.return_url`). Please specify this field in the `experience_context` object instead of the `application_context` object. | | `cancel_url` | `String` | Optional | DEPRECATED. The URL where the customer is redirected after the customer cancels the payment. The fields in `application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.cancel_url`). Please specify this field in the `experience_context` object instead of the `application_context` object. | -| `stored_payment_source` | [`StoredPaymentSource`](../../doc/models/stored-payment-source.md) | Optional | Provides additional details to process a payment using a `payment_source` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. `previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request. | +| `stored_payment_source` | [`StoredPaymentSource`](../../doc/models/stored-payment-source.md) | Optional | DEPRECATED. Provides additional details to process a payment using a `payment_source` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. `previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request. . The fields in `stored_payment_source` are now available in the `stored_credential` object under the `payment_source` which supports them (eg. `payment_source.card.stored_credential.payment_initiator`). Please specify this field in the `payment_source` object instead of the `application_context` object. | ## Example (as JSON) diff --git a/doc/models/order-authorize-request-payment-source.md b/doc/models/order-authorize-request-payment-source.md index be11470..3834c7b 100644 --- a/doc/models/order-authorize-request-payment-source.md +++ b/doc/models/order-authorize-request-payment-source.md @@ -71,7 +71,7 @@ The payment source definition. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", @@ -94,7 +94,7 @@ The payment source definition. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-authorize-request.md b/doc/models/order-authorize-request.md index b3f39c8..331a5ca 100644 --- a/doc/models/order-authorize-request.md +++ b/doc/models/order-authorize-request.md @@ -67,7 +67,7 @@ The authorization of an order request. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", @@ -90,7 +90,7 @@ The authorization of an order request. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-authorize-response-payment-source.md b/doc/models/order-authorize-response-payment-source.md index 05812b1..94a9e35 100644 --- a/doc/models/order-authorize-response-payment-source.md +++ b/doc/models/order-authorize-response-payment-source.md @@ -24,9 +24,9 @@ The payment source used to fund the payment. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "available_networks": [ - "SYNCHRONY" + "DELTA" ], "type": "UNKNOWN" }, @@ -60,7 +60,7 @@ The payment source used to fund the payment. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-authorize-response.md b/doc/models/order-authorize-response.md index 18a3f6d..1109ca4 100644 --- a/doc/models/order-authorize-response.md +++ b/doc/models/order-authorize-response.md @@ -1,6 +1,8 @@ # Order Authorize Response +The order authorize response. + ## Structure `OrderAuthorizeResponse` @@ -14,10 +16,10 @@ | `id` | `String` | Optional | The ID of the order. | | `payment_source` | [`OrderAuthorizeResponsePaymentSource`](../../doc/models/order-authorize-response-payment-source.md) | Optional | The payment source used to fund the payment. | | `intent` | [`CheckoutPaymentIntent`](../../doc/models/checkout-payment-intent.md) | Optional | The intent to either capture payment immediately or authorize a payment for an order after order creation. | -| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | - | -| `purchase_units` | [`Array`](../../doc/models/purchase-unit.md) | Optional | An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | +| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | The customer who approves and pays for the order. The customer is also known as the payer. | +| `purchase_units` | [`Array[PurchaseUnit]`](../../doc/models/purchase-unit.md) | Optional | An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `status` | [`OrderStatus`](../../doc/models/order-status.md) | Optional | The order status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links) that are either relevant to the issue by providing additional information or offering potential resolutions.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `4` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to redirect the payer. The API caller has 6 hours (default setting, this which can be changed by your account manager to 24/48/72 hours to accommodate your use case) from the time the order is created, to redirect your payer. Once redirected, the API caller has 6 hours for the payer to approve the order and either authorize or capture the order. If you are not using the PayPal JavaScript SDK to initiate PayPal Checkout (in context) ensure that you include `application_context.return_url` is specified or you will get "We're sorry, Things don't appear to be working at the moment" after the payer approves the payment. | ## Example (as JSON) @@ -30,9 +32,9 @@ "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "available_networks": [ - "SYNCHRONY" + "DELTA" ], "type": "UNKNOWN" }, @@ -66,7 +68,7 @@ "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-billing-plan.md b/doc/models/order-billing-plan.md index bdb2b07..34ac242 100644 --- a/doc/models/order-billing-plan.md +++ b/doc/models/order-billing-plan.md @@ -11,7 +11,7 @@ Metadata for merchant-managed recurring billing plans. Valid only during the sav | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `billing_cycles` | [`Array`](../../doc/models/billing-cycle.md) | Required | An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `3` | +| `billing_cycles` | [`Array[BillingCycle]`](../../doc/models/billing-cycle.md) | Required | An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `3` | | `setup_fee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `name` | `String` | Optional | Name of the recurring plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[A-Za-z0-9() +',.:-]+$` | @@ -35,10 +35,6 @@ Metadata for merchant-managed recurring billing plans. Valid only during the sav "value": "value6" } }, - "frequency": { - "key1": "val1", - "key2": "val2" - }, "start_date": "start_date6" } ], diff --git a/doc/models/order-capture-request-payment-source.md b/doc/models/order-capture-request-payment-source.md index d07fbf8..4fde855 100644 --- a/doc/models/order-capture-request-payment-source.md +++ b/doc/models/order-capture-request-payment-source.md @@ -71,7 +71,7 @@ The payment source definition. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", @@ -94,7 +94,7 @@ The payment source definition. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-capture-request.md b/doc/models/order-capture-request.md index 9fedad1..0c73415 100644 --- a/doc/models/order-capture-request.md +++ b/doc/models/order-capture-request.md @@ -67,7 +67,7 @@ Completes an capture payment for an order. "name": "name4", "number": "number2", "expiry": "expiry2", - "card_type": "CB_NATIONALE", + "card_type": "VISA", "type": "UNKNOWN" }, "device_manufacturer_id": "device_manufacturer_id6", @@ -90,7 +90,7 @@ Completes an capture payment for an order. "card": { "name": "name6", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/order-confirm-application-context.md b/doc/models/order-confirm-application-context.md index 62f8022..e7d28e7 100644 --- a/doc/models/order-confirm-application-context.md +++ b/doc/models/order-confirm-application-context.md @@ -32,7 +32,7 @@ Customizes the payer confirmation experience. "previous_network_transaction_reference": { "id": "id6", "date": "date2", - "network": "DELTA", + "network": "CONFIDIS", "acquirer_reference_number": "acquirer_reference_number8" } } diff --git a/doc/models/order-request.md b/doc/models/order-request.md index e7a0b68..38d81d0 100644 --- a/doc/models/order-request.md +++ b/doc/models/order-request.md @@ -12,8 +12,8 @@ The order request details. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `intent` | [`CheckoutPaymentIntent`](../../doc/models/checkout-payment-intent.md) | Required | The intent to either capture payment immediately or authorize a payment for an order after order creation. | -| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | - | -| `purchase_units` | [`Array`](../../doc/models/purchase-unit-request.md) | Required | An array of purchase units. Each purchase unit establishes a contract between a payer and the payee. Each purchase unit represents either a full or partial order that the payer intends to purchase from the payee.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | +| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | DEPRECATED. The customer is also known as the payer. The Payer object was intended to only be used with the `payment_source.paypal` object. In order to make this design more clear, the details in the `payer` object are now available under `payment_source.paypal`. Please use `payment_source.paypal`. | +| `purchase_units` | [`Array[PurchaseUnitRequest]`](../../doc/models/purchase-unit-request.md) | Required | An array of purchase units. Each purchase unit establishes a contract between a payer and the payee. Each purchase unit represents either a full or partial order that the payer intends to purchase from the payee.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `payment_source` | [`PaymentSource`](../../doc/models/payment-source.md) | Optional | The payment source definition. | | `application_context` | [`OrderApplicationContext`](../../doc/models/order-application-context.md) | Optional | Customizes the payer experience during the approval process for the payment with PayPal. Note: Partners and Marketplaces might configure brand_name and shipping_preference during partner account setup, which overrides the request values. | diff --git a/doc/models/order-tracker-request.md b/doc/models/order-tracker-request.md index 5167b0c..99fbb36 100644 --- a/doc/models/order-tracker-request.md +++ b/doc/models/order-tracker-request.md @@ -16,7 +16,7 @@ The tracking details of an order. | `carrier_name_other` | `String` | Optional | The name of the carrier for the shipment. Provide this value only if the carrier parameter is OTHER. This property supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | | `capture_id` | `String` | Required | The PayPal capture ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50`, *Pattern*: `^[a-zA-Z0-9]*$` | | `notify_payer` | `TrueClass \| FalseClass` | Optional | If true, PayPal will send an email notification to the payer of the PayPal transaction. The email contains the tracking details provided through the Orders tracking API request. Independent of any value passed for `notify_payer`, the payer may receive tracking notifications within the PayPal app, based on the user's notification preferences.

**Default**: `false` | -| `items` | [`Array`](../../doc/models/order-tracker-item.md) | Optional | An array of details of items in the shipment. | +| `items` | [`Array[OrderTrackerItem]`](../../doc/models/order-tracker-item.md) | Optional | An array of details of items in the shipment. | ## Example (as JSON) @@ -25,7 +25,7 @@ The tracking details of an order. "capture_id": "capture_id0", "notify_payer": false, "tracking_number": "tracking_number6", - "carrier": "LEADER", + "carrier": "ZELERIS", "carrier_name_other": "carrier_name_other0", "items": [ { diff --git a/doc/models/order-tracker-response.md b/doc/models/order-tracker-response.md index faf3695..9c53676 100644 --- a/doc/models/order-tracker-response.md +++ b/doc/models/order-tracker-response.md @@ -13,8 +13,8 @@ The tracking response on creation of tracker. | --- | --- | --- | --- | | `id` | `String` | Optional | The tracker id. | | `status` | [`OrderTrackerStatus`](../../doc/models/order-tracker-status.md) | Optional | The status of the item shipment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[0-9A-Z_]+$` | -| `items` | [`Array`](../../doc/models/order-tracker-item.md) | Optional | An array of details of items in the shipment. | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links. | +| `items` | [`Array[OrderTrackerItem]`](../../doc/models/order-tracker-item.md) | Optional | An array of details of items in the shipment. | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links. | | `create_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `update_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | diff --git a/doc/models/order-update-callback-error-response-details.md b/doc/models/order-update-callback-error-response-details.md deleted file mode 100644 index dc396f7..0000000 --- a/doc/models/order-update-callback-error-response-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Update Callback Error Response Details - -The error details. Required for client-side `4XX` errors. - -## Structure - -`OrderUpdateCallbackErrorResponseDetails` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `field` | `String` | Optional | The field that caused the error. If this field is in the body, set this value to the field's JSON pointer value. Required for client-side errors.

**Constraints**: *Minimum Length*: `0`, *Maximum Length*: `256`, *Pattern*: `^.*$` | -| `value` | `String` | Optional | The value of the field that caused the error.

**Constraints**: *Minimum Length*: `0`, *Maximum Length*: `1024`, *Pattern*: `^.*$` | -| `issue` | `String` | Required | The unique, fine-grained application-level error code.

**Constraints**: *Minimum Length*: `0`, *Maximum Length*: `256`, *Pattern*: `^.*$` | - -## Example (as JSON) - -```json -{ - "field": "field8", - "value": "value6", - "issue": "issue0" -} -``` - diff --git a/doc/models/order-update-callback-error-response.md b/doc/models/order-update-callback-error-response.md deleted file mode 100644 index 0cab063..0000000 --- a/doc/models/order-update-callback-error-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Order Update Callback Error Response - -The error details. - -## Structure - -`OrderUpdateCallbackErrorResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | Required | The human-readable, unique name of the error.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^.*$` | -| `message` | `String` | Optional | The message that describes the error.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2048`, *Pattern*: `^.*$` | -| `details` | [`Array`](../../doc/models/order-update-callback-error-response-details.md) | Optional | An array of additional details about the error.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `100` | - -## Example (as JSON) - -```json -{ - "name": "name2", - "message": "message8", - "details": [ - { - "field": "field4", - "value": "value2", - "issue": "issue6" - }, - { - "field": "field4", - "value": "value2", - "issue": "issue6" - } - ] -} -``` - diff --git a/doc/models/order-update-callback-request.md b/doc/models/order-update-callback-request.md deleted file mode 100644 index 2c4fd6f..0000000 --- a/doc/models/order-update-callback-request.md +++ /dev/null @@ -1,115 +0,0 @@ - -# Order Update Callback Request - -Shipping Options Callback request. This will be implemented by the merchants. - -## Structure - -`OrderUpdateCallbackRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The ID of the order.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9-]+$` | -| `shipping_address` | [`OrderUpdateCallbackShippingAddress`](../../doc/models/order-update-callback-shipping-address.md) | Required | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -| `shipping_option` | [`OrderUpdateCallbackShippingOption`](../../doc/models/order-update-callback-shipping-option.md) | Optional | The options that the payee or merchant offers to the payer to ship or pick up their items. | -| `purchase_units` | [`Array`](../../doc/models/purchase-unit-request.md) | Required | An array of purchase units. At present only 1 purchase_unit is supported. Each purchase unit establishes a contract between a payer and the payee. Each purchase unit represents either a full or partial order that the payer intends to purchase from the payee.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `1` | - -## Example (as JSON) - -```json -{ - "shipping_address": { - "admin_area_2": "admin_area_24", - "admin_area_1": "admin_area_16", - "postal_code": "postal_code2", - "country_code": "country_code0" - }, - "purchase_units": [ - { - "reference_id": "reference_id4", - "amount": { - "currency_code": "currency_code6", - "value": "value0", - "breakdown": { - "item_total": { - "currency_code": "currency_code0", - "value": "value6" - }, - "shipping": { - "currency_code": "currency_code0", - "value": "value6" - }, - "handling": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - }, - "insurance": { - "currency_code": "currency_code2", - "value": "value8" - } - } - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - }, - "payment_instruction": { - "platform_fees": [ - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - }, - { - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "payee": { - "email_address": "email_address4", - "merchant_id": "merchant_id6" - } - } - ], - "disbursement_mode": "INSTANT", - "payee_pricing_tier_id": "payee_pricing_tier_id2", - "payee_receivable_fx_rate_id": "payee_receivable_fx_rate_id0" - }, - "description": "description6", - "custom_id": "custom_id4" - } - ], - "id": "id2", - "shipping_option": { - "id": "id4", - "label": "label4", - "type": "PICKUP_IN_STORE", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } - } -} -``` - diff --git a/doc/models/order-update-callback-response.md b/doc/models/order-update-callback-response.md deleted file mode 100644 index 2035467..0000000 --- a/doc/models/order-update-callback-response.md +++ /dev/null @@ -1,83 +0,0 @@ - -# Order Update Callback Response - -Returns the updated shipping options for an order. - -## Structure - -`OrderUpdateCallbackResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The ID of the order.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[A-Z0-9-]+$` | -| `purchase_units` | [`ShippingOptionsPurchaseUnit`](../../doc/models/shipping-options-purchase-unit.md) | Optional | This would contain shipping option and amount data at purchase unit level. | - -## Example (as JSON) - -```json -{ - "id": "id2", - "purchase_units": { - "reference_id": "reference_id4", - "amount": { - "currency_code": "currency_code6", - "value": "value0", - "breakdown": { - "item_total": { - "currency_code": "currency_code0", - "value": "value6" - }, - "shipping": { - "currency_code": "currency_code0", - "value": "value6" - }, - "handling": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - }, - "insurance": { - "currency_code": "currency_code2", - "value": "value8" - } - } - }, - "items": [ - { - "name": "name8", - "unit_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax": { - "currency_code": "currency_code0", - "value": "value6" - }, - "quantity": "quantity4", - "description": "description2", - "sku": "sku6", - "url": "url2", - "category": "DONATION" - } - ], - "shipping_options": [ - { - "id": "id8", - "label": "label8", - "type": "PICKUP_IN_STORE", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } - ] - } -} -``` - diff --git a/doc/models/order-update-callback-shipping-address.md b/doc/models/order-update-callback-shipping-address.md deleted file mode 100644 index e9cd4c6..0000000 --- a/doc/models/order-update-callback-shipping-address.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Order Update Callback Shipping Address - -The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). - -## Structure - -`OrderUpdateCallbackShippingAddress` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `admin_area_2` | `String` | Optional | A city, town, or village. Smaller than `admin_area_level_1`.

**Constraints**: *Maximum Length*: `120` | -| `admin_area_1` | `String` | Optional | The highest-level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision. This data is formatted for postal delivery, for example, `CA` and not `California`. Value, by country, is: UK. A county. US. A state. Canada. A province. Japan. A prefecture. Switzerland. A *kanton*.

**Constraints**: *Maximum Length*: `300` | -| `postal_code` | `String` | Optional | The postal code, which is the ZIP code or equivalent. Typically required for countries with a postal code or an equivalent. See [postal code](https://en.wikipedia.org/wiki/Postal_code).

**Constraints**: *Maximum Length*: `60` | -| `country_code` | `String` | Required | The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | - -## Example (as JSON) - -```json -{ - "admin_area_2": "admin_area_26", - "admin_area_1": "admin_area_16", - "postal_code": "postal_code2", - "country_code": "country_code0" -} -``` - diff --git a/doc/models/order-update-callback-shipping-option.md b/doc/models/order-update-callback-shipping-option.md deleted file mode 100644 index dfa4570..0000000 --- a/doc/models/order-update-callback-shipping-option.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Order Update Callback Shipping Option - -The options that the payee or merchant offers to the payer to ship or pick up their items. - -## Structure - -`OrderUpdateCallbackShippingOption` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Required | A unique ID that identifies a payer-selected shipping option.

**Constraints**: *Maximum Length*: `127` | -| `label` | `String` | Required | A description that the payer sees, which helps them choose an appropriate shipping option. For example, `Free Shipping`, `USPS Priority Shipping`, `Expédition prioritaire USPS`, or `USPS yōuxiān fā huò`. Localize this description to the payer's locale.

**Constraints**: *Maximum Length*: `127` | -| `type` | [`ShippingType`](../../doc/models/shipping-type.md) | Optional | A classification for the method of purchase fulfillment. | -| `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | - -## Example (as JSON) - -```json -{ - "id": "id8", - "label": "label8", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - } -} -``` - diff --git a/doc/models/order.md b/doc/models/order.md index e4caa83..3574097 100644 --- a/doc/models/order.md +++ b/doc/models/order.md @@ -16,10 +16,10 @@ The order details. | `id` | `String` | Optional | The ID of the order. | | `payment_source` | [`PaymentSourceResponse`](../../doc/models/payment-source-response.md) | Optional | The payment source used to fund the payment. | | `intent` | [`CheckoutPaymentIntent`](../../doc/models/checkout-payment-intent.md) | Optional | The intent to either capture payment immediately or authorize a payment for an order after order creation. | -| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | - | -| `purchase_units` | [`Array`](../../doc/models/purchase-unit.md) | Optional | An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | +| `payer` | [`Payer`](../../doc/models/payer.md) | Optional | DEPRECATED. The customer is also known as the payer. The Payer object was intended to only be used with the `payment_source.paypal` object. In order to make this design more clear, the details in the `payer` object are now available under `payment_source.paypal`. Please use `payment_source.paypal`. | +| `purchase_units` | [`Array[PurchaseUnit]`](../../doc/models/purchase-unit.md) | Optional | An array of purchase units. Each purchase unit establishes a contract between a customer and merchant. Each purchase unit represents either a full or partial order that the customer intends to purchase from the merchant.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `status` | [`OrderStatus`](../../doc/models/order-status.md) | Optional | The order status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to redirect the payer. The API caller has 6 hours (default setting, this which can be changed by your account manager to 24/48/72 hours to accommodate your use case) from the time the order is created, to redirect your payer. Once redirected, the API caller has 6 hours for the payer to approve the order and either authorize or capture the order. If you are not using the PayPal JavaScript SDK to initiate PayPal Checkout (in context) ensure that you include `application_context.return_url` is specified or you will get "We're sorry, Things don't appear to be working at the moment" after the payer approves the payment. | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links. To complete payer approval, use the `approve` link to redirect the payer. The API caller has 6 hours (default setting, this which can be changed by your account manager to 24/48/72 hours to accommodate your use case) from the time the order is created, to redirect your payer. Once redirected, the API caller has 6 hours for the payer to approve the order and either authorize or capture the order. If you are not using the PayPal JavaScript SDK to initiate PayPal Checkout (in context) ensure that you include `application_context.return_url` is specified or you will get "We're sorry, Things don't appear to be working at the moment" after the payer approves the payment. | ## Example (as JSON) @@ -32,9 +32,9 @@ The order details. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "available_networks": [ - "SYNCHRONY" + "DELTA" ], "type": "UNKNOWN" }, diff --git a/doc/models/orders-capture.md b/doc/models/orders-capture.md index 4ebbf23..7fc2fe7 100644 --- a/doc/models/orders-capture.md +++ b/doc/models/orders-capture.md @@ -17,12 +17,12 @@ A captured payment. | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `String` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `final_capture` | `TrueClass \| FalseClass` | Optional | Indicates whether you can make additional captures against the authorized payment. Set to `true` if you do not intend to capture additional payments against the authorization. Set to `false` if you intend to capture additional payments against the authorization.

**Default**: `false` | | `seller_receivable_breakdown` | [`SellerReceivableBreakdown`](../../doc/models/seller-receivable-breakdown.md) | Optional | The detailed breakdown of the capture activity. This is not available for transactions that are in pending state. | | `disbursement_mode` | [`DisbursementMode`](../../doc/models/disbursement-mode.md) | Optional | The funds that are held on behalf of the merchant.

**Default**: `DisbursementMode::INSTANT`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16`, *Pattern*: `^[A-Z_]+$` | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | | `processor_response` | [`ProcessorResponse`](../../doc/models/processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | | `create_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `update_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | diff --git a/doc/models/os-type.md b/doc/models/os-type.md new file mode 100644 index 0000000..75d9fb7 --- /dev/null +++ b/doc/models/os-type.md @@ -0,0 +1,17 @@ + +# Os Type + +Operating System type of the device that the buyer is using. + +## Enumeration + +`OsType` + +## Fields + +| Name | Description | +| --- | --- | +| `ANDROID` | Google Android OS. | +| `IOS` | Apple OS typically found in Apple mobile devices. | +| `OTHER` | Any other OS type. | + diff --git a/doc/models/payer-information.md b/doc/models/payer-information.md new file mode 100644 index 0000000..9d8ffbf --- /dev/null +++ b/doc/models/payer-information.md @@ -0,0 +1,38 @@ + +# Payer Information + +The payer information. + +## Structure + +`PayerInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `account_id` | `String` | Optional | The PayPal` customer account ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `13`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `email_address` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: `^.+@[^"\-].+$` | +| `phone_number` | [`Phone`](../../doc/models/phone.md) | Optional | The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | +| `address_status` | `String` | Optional | The address status of the payer. Value is either: Y. Verified. N. Not verified.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1`, *Pattern*: `^[N\|Y]$` | +| `payer_status` | `String` | Optional | The status of the payer. Value is `Y` or `N`.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1`, *Pattern*: `^[N\|Y]$` | +| `payer_name` | [`PayerName`](../../doc/models/payer-name.md) | Optional | The name of the party. | +| `country_code` | `String` | Optional | The [two-character ISO 3166-1 code](/docs/integration/direct/rest/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | +| `address` | [`SimplePostalAddressCoarseGrained`](../../doc/models/simple-postal-address-coarse-grained.md) | Optional | A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. | + +## Example (as JSON) + +```json +{ + "account_id": "account_id6", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status8" +} +``` + diff --git a/doc/models/payer-name.md b/doc/models/payer-name.md new file mode 100644 index 0000000..202fce3 --- /dev/null +++ b/doc/models/payer-name.md @@ -0,0 +1,33 @@ + +# Payer Name + +The name of the party. + +## Structure + +`PayerName` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefix` | `String` | Optional | The prefix, or title, to the party's name.

**Constraints**: *Maximum Length*: `140` | +| `given_name` | `String` | Optional | When the party is a person, the party's given, or first, name.

**Constraints**: *Maximum Length*: `140` | +| `surname` | `String` | Optional | When the party is a person, the party's surname or family name. Also known as the last name. Required when the party is a person. Use also to store multiple surnames including the matronymic, or mother's, surname.

**Constraints**: *Maximum Length*: `140` | +| `middle_name` | `String` | Optional | When the party is a person, the party's middle name. Use also to store multiple middle names including the patronymic, or father's, middle name.

**Constraints**: *Maximum Length*: `140` | +| `suffix` | `String` | Optional | The suffix for the party's name.

**Constraints**: *Maximum Length*: `140` | +| `alternate_full_name` | `String` | Optional | DEPRECATED. The party's alternate name. Can be a business name, nickname, or any other name that cannot be split into first, last name. Required when the party is a business.

**Constraints**: *Maximum Length*: `300` | +| `full_name` | `String` | Optional | When the party is a person, the party's full name.

**Constraints**: *Maximum Length*: `300` | + +## Example (as JSON) + +```json +{ + "prefix": "prefix4", + "given_name": "given_name8", + "surname": "surname8", + "middle_name": "middle_name6", + "suffix": "suffix6" +} +``` + diff --git a/doc/models/payer.md b/doc/models/payer.md index 097fbc6..6119ec7 100644 --- a/doc/models/payer.md +++ b/doc/models/payer.md @@ -1,6 +1,8 @@ # Payer +The customer who approves and pays for the order. The customer is also known as the payer. + ## Structure `Payer` diff --git a/doc/models/payment-authorization.md b/doc/models/payment-authorization.md index bc86870..0c3051f 100644 --- a/doc/models/payment-authorization.md +++ b/doc/models/payment-authorization.md @@ -17,10 +17,10 @@ The authorized payment transaction. | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `String` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `expiration_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | | `create_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `update_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `supplementary_data` | [`PaymentSupplementaryData`](../../doc/models/payment-supplementary-data.md) | Optional | The supplementary data. | diff --git a/doc/models/payment-collection.md b/doc/models/payment-collection.md index 534416e..f2ef89b 100644 --- a/doc/models/payment-collection.md +++ b/doc/models/payment-collection.md @@ -11,9 +11,9 @@ The collection of payments, or transactions, for a purchase unit in an order. Fo | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `authorizations` | [`Array`](../../doc/models/authorization-with-additional-data.md) | Optional | An array of authorized payments for a purchase unit. A purchase unit can have zero or more authorized payments. | -| `captures` | [`Array`](../../doc/models/orders-capture.md) | Optional | An array of captured payments for a purchase unit. A purchase unit can have zero or more captured payments. | -| `refunds` | [`Array`](../../doc/models/refund.md) | Optional | An array of refunds for a purchase unit. A purchase unit can have zero or more refunds. | +| `authorizations` | [`Array[AuthorizationWithAdditionalData]`](../../doc/models/authorization-with-additional-data.md) | Optional | An array of authorized payments for a purchase unit. A purchase unit can have zero or more authorized payments. | +| `captures` | [`Array[OrdersCapture]`](../../doc/models/orders-capture.md) | Optional | An array of captured payments for a purchase unit. A purchase unit can have zero or more captured payments. | +| `refunds` | [`Array[Refund]`](../../doc/models/refund.md) | Optional | An array of refunds for a purchase unit. A purchase unit can have zero or more refunds. | ## Example (as JSON) diff --git a/doc/models/payment-instruction.md b/doc/models/payment-instruction.md index ab77459..cc1f53e 100644 --- a/doc/models/payment-instruction.md +++ b/doc/models/payment-instruction.md @@ -11,7 +11,7 @@ Any additional payment instructions to be consider during payment processing. Th | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `platform_fees` | [`Array`](../../doc/models/platform-fee.md) | Optional | An array of various fees, commissions, tips, or donations. This field is only applicable to merchants that been enabled for PayPal Complete Payments Platform for Marketplaces and Platforms capability.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | +| `platform_fees` | [`Array[PlatformFee]`](../../doc/models/platform-fee.md) | Optional | An array of various fees, commissions, tips, or donations. This field is only applicable to merchants that been enabled for PayPal Complete Payments Platform for Marketplaces and Platforms capability.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | | `disbursement_mode` | [`DisbursementMode`](../../doc/models/disbursement-mode.md) | Optional | The funds that are held on behalf of the merchant.

**Default**: `DisbursementMode::INSTANT`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16`, *Pattern*: `^[A-Z_]+$` | | `payee_pricing_tier_id` | `String` | Optional | This field is only enabled for selected merchants/partners to use and provides the ability to trigger a specific pricing rate/plan for a payment transaction. The list of eligible 'payee_pricing_tier_id' would be provided to you by your Account Manager. Specifying values other than the one provided to you by your account manager would result in an error.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20`, *Pattern*: `^.*$` | | `payee_receivable_fx_rate_id` | `String` | Optional | FX identifier generated returned by PayPal to be used for payment processing in order to honor FX rate (for eligible integrations) to be used when amount is settled/received into the payee account.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^.*$` | diff --git a/doc/models/payment-method.md b/doc/models/payment-method.md new file mode 100644 index 0000000..e732384 --- /dev/null +++ b/doc/models/payment-method.md @@ -0,0 +1,23 @@ + +# Payment Method + +The customer and merchant payment preferences. + +## Structure + +`PaymentMethod` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `payee_preferred` | [`PayeePaymentMethodPreference`](../../doc/models/payee-payment-method-preference.md) | Optional | The merchant-preferred payment methods.

**Default**: `PayeePaymentMethodPreference::UNRESTRICTED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | + +## Example (as JSON) + +```json +{ + "payee_preferred": "UNRESTRICTED" +} +``` + diff --git a/doc/models/payment-preferences-override.md b/doc/models/payment-preferences-override.md new file mode 100644 index 0000000..1541a42 --- /dev/null +++ b/doc/models/payment-preferences-override.md @@ -0,0 +1,32 @@ + +# Payment Preferences Override + +The payment preferences to override at subscription level. + +## Structure + +`PaymentPreferencesOverride` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `auto_bill_outstanding` | `TrueClass \| FalseClass` | Optional | Indicates whether to automatically bill the outstanding amount in the next billing cycle. | +| `setup_fee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `setup_fee_failure_action` | [`SetupFeeFailureAction`](../../doc/models/setup-fee-failure-action.md) | Optional | The action to take on the subscription if the initial payment for the setup fails.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `payment_failure_threshold` | `Integer` | Optional | The maximum number of payment failures before a subscription is suspended. For example, if `payment_failure_threshold` is `2`, the subscription automatically updates to the `SUSPEND` state if two consecutive payments fail.

**Constraints**: `>= 0`, `<= 999` | + +## Example (as JSON) + +```json +{ + "auto_bill_outstanding": false, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + }, + "setup_fee_failure_action": "CONTINUE", + "payment_failure_threshold": 80 +} +``` + diff --git a/doc/models/payment-preferences.md b/doc/models/payment-preferences.md new file mode 100644 index 0000000..1d4532c --- /dev/null +++ b/doc/models/payment-preferences.md @@ -0,0 +1,32 @@ + +# Payment Preferences + +The payment preferences for a subscription. + +## Structure + +`PaymentPreferences` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `auto_bill_outstanding` | `TrueClass \| FalseClass` | Optional | Indicates whether to automatically bill the outstanding amount in the next billing cycle.

**Default**: `true` | +| `setup_fee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `setup_fee_failure_action` | [`SetupFeeFailureAction`](../../doc/models/setup-fee-failure-action.md) | Optional | The action to take on the subscription if the initial payment for the setup fails.

**Default**: `SetupFeeFailureAction::CANCEL`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `payment_failure_threshold` | `Integer` | Optional | The maximum number of payment failures before a subscription is suspended. For example, if `payment_failure_threshold` is `2`, the subscription automatically updates to the `SUSPEND` state if two consecutive payments fail.

**Default**: `0`

**Constraints**: `>= 0`, `<= 999` | + +## Example (as JSON) + +```json +{ + "auto_bill_outstanding": true, + "setup_fee_failure_action": "CANCEL", + "payment_failure_threshold": 0, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + } +} +``` + diff --git a/doc/models/payment-source-response.md b/doc/models/payment-source-response.md index 0dfa97c..e413435 100644 --- a/doc/models/payment-source-response.md +++ b/doc/models/payment-source-response.md @@ -33,9 +33,9 @@ The payment source used to fund the payment. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "available_networks": [ - "SYNCHRONY" + "DELTA" ], "type": "UNKNOWN" }, diff --git a/doc/models/payment-token-request-card.md b/doc/models/payment-token-request-card.md index d76c688..a069904 100644 --- a/doc/models/payment-token-request-card.md +++ b/doc/models/payment-token-request-card.md @@ -26,7 +26,7 @@ A Resource representing a request to vault a Card. "number": "number8", "expiry": "expiry2", "security_code": "security_code6", - "brand": "EFTPOS" + "brand": "HIPER" } ``` diff --git a/doc/models/payment-token-request-payment-source.md b/doc/models/payment-token-request-payment-source.md index 1e007b5..b7d8b30 100644 --- a/doc/models/payment-token-request-payment-source.md +++ b/doc/models/payment-token-request-payment-source.md @@ -23,7 +23,7 @@ The payment method to vault with the instrument details. "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "token": { "id": "id6", diff --git a/doc/models/payment-token-request.md b/doc/models/payment-token-request.md index 4b90441..6354de7 100644 --- a/doc/models/payment-token-request.md +++ b/doc/models/payment-token-request.md @@ -28,7 +28,7 @@ Payment Token Request where the `source` defines the type of instrument to be st "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "token": { "id": "id6", diff --git a/doc/models/payment-token-response-payment-source.md b/doc/models/payment-token-response-payment-source.md index 0842cc8..c6d9d42 100644 --- a/doc/models/payment-token-response-payment-source.md +++ b/doc/models/payment-token-response-payment-source.md @@ -12,8 +12,8 @@ The vaulted payment method details. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `card` | [`CardPaymentTokenEntity`](../../doc/models/card-payment-token-entity.md) | Optional | Full representation of a Card Payment Token including network token. | -| `paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | - | -| `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | - | +| `paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | Full representation of a PayPal Payment Token. | +| `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | Full representation of a Venmo Payment Token. | | `apple_pay` | [`ApplePayPaymentToken`](../../doc/models/apple-pay-payment-token.md) | Optional | A resource representing a response for Apple Pay. | ## Example (as JSON) @@ -23,7 +23,7 @@ The vaulted payment method details. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -41,6 +41,7 @@ The vaulted payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -65,6 +66,7 @@ The vaulted payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -87,7 +89,7 @@ The vaulted payment method details. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/payment-token-response.md b/doc/models/payment-token-response.md index 5fab227..daebd40 100644 --- a/doc/models/payment-token-response.md +++ b/doc/models/payment-token-response.md @@ -11,10 +11,10 @@ Full representation of a saved payment token. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Optional | The PayPal-generated ID for the vault token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `id` | `String` | Optional | The PayPal-generated ID for the vaulted payment source. This ID should be stored on the merchant's server so the saved payment source can be used for future transactions.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `customer` | [`CustomerResponse`](../../doc/models/customer-response.md) | Optional | Customer in merchant's or partner's system of records. | | `payment_source` | [`PaymentTokenResponsePaymentSource`](../../doc/models/payment-token-response-payment-source.md) | Optional | The vaulted payment method details. | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | ## Example (as JSON) @@ -29,7 +29,7 @@ Full representation of a saved payment token. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -47,6 +47,7 @@ Full representation of a saved payment token. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -71,6 +72,7 @@ Full representation of a saved payment token. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -93,7 +95,7 @@ Full representation of a saved payment token. "name": "name6", "last_digits": "last_digits0", "type": "UNKNOWN", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "billing_address": { "address_line_1": "address_line_12", "address_line_2": "address_line_28", diff --git a/doc/models/payment-token-status.md b/doc/models/payment-token-status.md index d9faa19..6b70b87 100644 --- a/doc/models/payment-token-status.md +++ b/doc/models/payment-token-status.md @@ -12,7 +12,7 @@ The status of the payment token. | Name | Description | | --- | --- | | `CREATED` | A setup token is initialized with minimal information, more data must be added to the setup-token to be vaulted | -| `PAYER_ACTION_REQUIRED` | A contingecy on payer approval is required before the payment method can be saved. | +| `PAYER_ACTION_REQUIRED` | A contingency on payer approval is required before the payment method can be saved. | | `APPROVED` | Setup token is ready to be vaulted. If a buyer approval contigency was returned, it is has been approved. | | `VAULTED` | The payment token has been vaulted. | | `TOKENIZED` | A vaulted payment method token has been tokenized for short term (one time) use. | diff --git a/doc/models/payments-capture.md b/doc/models/payments-capture.md index bc3fac1..24902c0 100644 --- a/doc/models/payments-capture.md +++ b/doc/models/payments-capture.md @@ -17,13 +17,13 @@ A captured payment. | `amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `invoice_id` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. | | `custom_id` | `String` | Optional | The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

**Constraints**: *Maximum Length*: `255` | -| `network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | | `seller_protection` | [`SellerProtection`](../../doc/models/seller-protection.md) | Optional | The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | | `final_capture` | `TrueClass \| FalseClass` | Optional | Indicates whether you can make additional captures against the authorized payment. Set to `true` if you do not intend to capture additional payments against the authorization. Set to `false` if you intend to capture additional payments against the authorization.

**Default**: `false` | | `seller_receivable_breakdown` | [`SellerReceivableBreakdown`](../../doc/models/seller-receivable-breakdown.md) | Optional | The detailed breakdown of the capture activity. This is not available for transactions that are in pending state. | | `disbursement_mode` | [`DisbursementMode`](../../doc/models/disbursement-mode.md) | Optional | The funds that are held on behalf of the merchant.

**Default**: `DisbursementMode::INSTANT`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16`, *Pattern*: `^[A-Z_]+$` | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | -| `processor_response` | [`PaymentsProcessorResponse`](../../doc/models/payments-processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | +| `processor_response` | [`ProcessorResponse`](../../doc/models/processor-response.md) | Optional | The processor response information for payment requests, such as direct credit card transactions. | | `create_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `update_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | diff --git a/doc/models/payments-payment-advice-code.md b/doc/models/payments-payment-advice-code.md deleted file mode 100644 index 6e6cc50..0000000 --- a/doc/models/payments-payment-advice-code.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Payments Payment Advice Code - -The declined payment transactions might have payment advice codes. The card networks, like Visa and Mastercard, return payment advice codes. - -## Enumeration - -`PaymentsPaymentAdviceCode` - -## Fields - -| Name | Description | -| --- | --- | -| `PAYMENTADVICE_01` | For Mastercard, expired card account upgrade or portfolio sale conversion. Obtain new account information before next billing cycle. | -| `PAYMENTADVICE_02` | For Mastercard, over credit limit or insufficient funds. Retry the transaction 72 hours later. For Visa, the card holder wants to stop only one specific payment in the recurring payment relationship. The merchant must NOT resubmit the same transaction. The merchant can continue the billing process in the subsequent billing period. | -| `PAYMENTADVICE_03` | For Mastercard, account closed as fraudulent. Obtain another type of payment from customer due to account being closed or fraud. Possible reason: Account closed as fraudulent. For Visa, the card holder wants to stop all recurring payment transactions for a specific merchant. Stop recurring payment requests. | -| `PAYMENTADVICE_21` | For Mastercard, the card holder has been unsuccessful at canceling recurring payment through merchant. Stop recurring payment requests. For Visa, all recurring payments were canceled for the card number requested. Stop recurring payment requests. | - diff --git a/doc/models/payments-processor-response.md b/doc/models/payments-processor-response.md deleted file mode 100644 index dc83297..0000000 --- a/doc/models/payments-processor-response.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Payments Processor Response - -The processor response information for payment requests, such as direct credit card transactions. - -## Structure - -`PaymentsProcessorResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `avs_code` | [`AvsCode`](../../doc/models/avs-code.md) | Optional | The address verification code for Visa, Discover, Mastercard, or American Express transactions. | -| `cvv_code` | [`CvvCode`](../../doc/models/cvv-code.md) | Optional | The card verification value code for for Visa, Discover, Mastercard, or American Express. | -| `response_code` | [`ProcessorResponseCode`](../../doc/models/processor-response-code.md) | Optional | Processor response code for the non-PayPal payment processor errors. | -| `payment_advice_code` | [`PaymentsPaymentAdviceCode`](../../doc/models/payments-payment-advice-code.md) | Optional | The declined payment transactions might have payment advice codes. The card networks, like Visa and Mastercard, return payment advice codes. | - -## Example (as JSON) - -```json -{ - "avs_code": "A", - "cvv_code": "E", - "response_code": "5150", - "payment_advice_code": "01" -} -``` - diff --git a/doc/models/paypal-experience-landing-page.md b/doc/models/paypal-experience-landing-page.md index b0e40f7..1936c28 100644 --- a/doc/models/paypal-experience-landing-page.md +++ b/doc/models/paypal-experience-landing-page.md @@ -14,4 +14,5 @@ The type of landing page to show on the PayPal site for customer checkout. | `LOGIN` | When the customer clicks PayPal Checkout, the customer is redirected to a page to log in to PayPal and approve the payment. | | `GUEST_CHECKOUT` | When the customer clicks PayPal Checkout, the customer is redirected to a page to enter credit or debit card and other relevant billing information required to complete the purchase. This option has previously been also called as 'BILLING' | | `NO_PREFERENCE` | When the customer clicks PayPal Checkout, the customer is redirected to either a page to log in to PayPal and approve the payment or to a page to enter credit or debit card and other relevant billing information required to complete the purchase, depending on their previous interaction with PayPal. | +| `BILLING` | DEPRECATED - please use GUEST_CHECKOUT. All implementations of 'BILLING' will be routed to 'GUEST_CHECKOUT'. When the customer clicks PayPal Checkout, the customer is redirected to a page to enter credit or debit card and other relevant billing information required to complete the purchase. | diff --git a/doc/models/paypal-payment-token.md b/doc/models/paypal-payment-token.md index 0436fca..9fe0ab8 100644 --- a/doc/models/paypal-payment-token.md +++ b/doc/models/paypal-payment-token.md @@ -1,6 +1,8 @@ # Paypal Payment Token +Full representation of a PayPal Payment Token. + ## Structure `PaypalPaymentToken` @@ -15,7 +17,7 @@ | `permit_multiple_payment_tokens` | `TrueClass \| FalseClass` | Optional | Create multiple payment tokens for the same payer, merchant/platform combination. Use this when the customer has not logged in at merchant/platform. The payment token thus generated, can then also be used to create the customer account at merchant/platform. Use this also when multiple payment tokens are required for the same payer, different customer at merchant/platform. This helps to identify customers distinctly even though they may share the same PayPal account. This only applies to PayPal payment source.

**Default**: `false` | | `usage_type` | [`PaypalPaymentTokenUsageType`](../../doc/models/paypal-payment-token-usage-type.md) | Optional | The usage type associated with a digital wallet payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `email_address` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | +| `email_address` | `String` | Optional | The internationalized email address.
Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.


**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | | `payer_id` | `String` | Optional | The account identifier for a PayPal account.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | @@ -34,6 +36,7 @@ "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/paypal-reference-id-type.md b/doc/models/paypal-reference-id-type.md new file mode 100644 index 0000000..dacdea4 --- /dev/null +++ b/doc/models/paypal-reference-id-type.md @@ -0,0 +1,18 @@ + +# Paypal Reference Id Type + +The PayPal reference ID type. + +## Enumeration + +`PaypalReferenceIdType` + +## Fields + +| Name | Description | +| --- | --- | +| `ODR` | An order ID. | +| `TXN` | A transaction ID. | +| `SUB` | A subscription ID. | +| `PAP` | A pre-approved payment ID. | + diff --git a/doc/models/paypal-wallet-attributes-response.md b/doc/models/paypal-wallet-attributes-response.md index 00ab55e..a1199c1 100644 --- a/doc/models/paypal-wallet-attributes-response.md +++ b/doc/models/paypal-wallet-attributes-response.md @@ -12,7 +12,7 @@ Additional attributes associated with the use of a PayPal Wallet. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `vault` | [`PaypalWalletVaultResponse`](../../doc/models/paypal-wallet-vault-response.md) | Optional | The details about a saved PayPal Wallet payment source. | -| `cobranded_cards` | [`Array`](../../doc/models/cobranded-card.md) | Optional | An array of merchant cobranded cards used by buyer to complete an order. This array will be present if a merchant has onboarded their cobranded card with PayPal and provided corresponding label(s).

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `25` | +| `cobranded_cards` | [`Array[CobrandedCard]`](../../doc/models/cobranded-card.md) | Optional | An array of merchant cobranded cards used by buyer to complete an order. This array will be present if a merchant has onboarded their cobranded card with PayPal and provided corresponding label(s).

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `25` | ## Example (as JSON) diff --git a/doc/models/paypal-wallet-attributes.md b/doc/models/paypal-wallet-attributes.md index b9270f5..9542d29 100644 --- a/doc/models/paypal-wallet-attributes.md +++ b/doc/models/paypal-wallet-attributes.md @@ -12,7 +12,7 @@ Additional attributes associated with the use of this PayPal Wallet. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `customer` | [`PaypalWalletCustomerRequest`](../../doc/models/paypal-wallet-customer-request.md) | Optional | - | -| `vault` | [`PaypalWalletVaultInstruction`](../../doc/models/paypal-wallet-vault-instruction.md) | Optional | - | +| `vault` | [`PaypalWalletVaultInstruction`](../../doc/models/paypal-wallet-vault-instruction.md) | Optional | Resource consolidating common request and response attributes for vaulting PayPal Wallet. | ## Example (as JSON) @@ -34,7 +34,6 @@ Additional attributes associated with the use of this PayPal Wallet. "merchant_customer_id": "merchant_customer_id2" }, "vault": { - "store_in_vault": "ON_SUCCESS", "description": "description6", "usage_pattern": "THRESHOLD_PREPAID", "usage_type": "MERCHANT", diff --git a/doc/models/paypal-wallet-experience-context.md b/doc/models/paypal-wallet-experience-context.md index ac52d58..6db65ae 100644 --- a/doc/models/paypal-wallet-experience-context.md +++ b/doc/models/paypal-wallet-experience-context.md @@ -17,6 +17,7 @@ Customizes the payer experience during the approval process for payment with Pay | `contact_preference` | [`PaypalWalletContactPreference`](../../doc/models/paypal-wallet-contact-preference.md) | Optional | The preference to display the contact information (buyer’s shipping email & phone number) on PayPal's checkout for easy merchant-buyer communication.

**Default**: `PaypalWalletContactPreference::NO_CONTACT_INFO`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `return_url` | `String` | Optional | Describes the URL. | | `cancel_url` | `String` | Optional | Describes the URL. | +| `app_switch_context` | [`AppSwitchContext`](../../doc/models/app-switch-context.md) | Optional | Merchant provided details of the native app or mobile web browser to facilitate buyer's app switch to the PayPal consumer app. | | `landing_page` | [`PaypalExperienceLandingPage`](../../doc/models/paypal-experience-landing-page.md) | Optional | The type of landing page to show on the PayPal site for customer checkout.

**Default**: `PaypalExperienceLandingPage::NO_PREFERENCE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `13`, *Pattern*: `^[0-9A-Z_]+$` | | `user_action` | [`PaypalExperienceUserAction`](../../doc/models/paypal-experience-user-action.md) | Optional | Configures a Continue or Pay Now checkout flow.

**Default**: `PaypalExperienceUserAction::CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `8`, *Pattern*: `^[0-9A-Z_]+$` | | `payment_method_preference` | [`PayeePaymentMethodPreference`](../../doc/models/payee-payment-method-preference.md) | Optional | The merchant-preferred payment methods.

**Default**: `PayeePaymentMethodPreference::UNRESTRICTED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | diff --git a/doc/models/paypal-wallet-response.md b/doc/models/paypal-wallet-response.md index 40d570d..fadbe5b 100644 --- a/doc/models/paypal-wallet-response.md +++ b/doc/models/paypal-wallet-response.md @@ -23,6 +23,7 @@ The PayPal Wallet response. | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | | `attributes` | [`PaypalWalletAttributesResponse`](../../doc/models/paypal-wallet-attributes-response.md) | Optional | Additional attributes associated with the use of a PayPal Wallet. | | `stored_credential` | [`PaypalWalletStoredCredential`](../../doc/models/paypal-wallet-stored-credential.md) | Optional | Provides additional details to process a payment using the PayPal wallet billing agreement or a vaulted payment method that has been stored or is intended to be stored. | +| `experience_status` | [`ExperienceStatus`](../../doc/models/experience-status.md) | Optional | This field indicates the status of PayPal's Checkout experience throughout the order lifecycle. The values reflect the current stage of the checkout process.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | ## Example (as JSON) diff --git a/doc/models/paypal-wallet-stored-credential.md b/doc/models/paypal-wallet-stored-credential.md index eae7be0..feab88a 100644 --- a/doc/models/paypal-wallet-stored-credential.md +++ b/doc/models/paypal-wallet-stored-credential.md @@ -12,7 +12,7 @@ Provides additional details to process a payment using the PayPal wallet billing | Name | Type | Tags | Description | | --- | --- | --- | --- | | `payment_initiator` | [`PaymentInitiator`](../../doc/models/payment-initiator.md) | Required | The person or party who initiated or triggered the payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `charge_pattern` | [`UsagePattern`](../../doc/models/usage-pattern.md) | Optional | Expected business/pricing model for the billing agreement.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30`, *Pattern*: `^[A-Z0-9_]+$` | +| `charge_pattern` | [`UsagePattern`](../../doc/models/usage-pattern.md) | Optional | DEPRECATED. Expected business/pricing model for the billing agreement, Please use usage_pattern instead.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30`, *Pattern*: `^[A-Z0-9_]+$` | | `usage_pattern` | [`UsagePattern`](../../doc/models/usage-pattern.md) | Optional | Expected business/pricing model for the billing agreement.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30`, *Pattern*: `^[A-Z0-9_]+$` | | `usage` | [`StoredPaymentSourceUsageType`](../../doc/models/stored-payment-source-usage-type.md) | Optional | Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file).

**Default**: `StoredPaymentSourceUsageType::DERIVED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | diff --git a/doc/models/paypal-wallet-vault-instruction.md b/doc/models/paypal-wallet-vault-instruction.md index dbb0390..b7368b0 100644 --- a/doc/models/paypal-wallet-vault-instruction.md +++ b/doc/models/paypal-wallet-vault-instruction.md @@ -1,6 +1,8 @@ # Paypal Wallet Vault Instruction +Resource consolidating common request and response attributes for vaulting PayPal Wallet. + ## Structure `PaypalWalletVaultInstruction` @@ -9,7 +11,6 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `store_in_vault` | [`StoreInVaultInstruction`](../../doc/models/store-in-vault-instruction.md) | Optional | Defines how and when the payment source gets vaulted.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `description` | `String` | Optional | The description displayed to PayPal consumer on the approval flow for PayPal, as well as on the PayPal payment token management experience on PayPal.com.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | | `usage_pattern` | [`UsagePattern`](../../doc/models/usage-pattern.md) | Optional | Expected business/pricing model for the billing agreement.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30` | | `usage_type` | [`PaypalPaymentTokenUsageType`](../../doc/models/paypal-payment-token-usage-type.md) | Required | The usage type associated with the PayPal payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | @@ -23,7 +24,6 @@ "usage_type": "MERCHANT", "customer_type": "CONSUMER", "permit_multiple_payment_tokens": false, - "store_in_vault": "ON_SUCCESS", "description": "description4", "usage_pattern": "UNSCHEDULED_PREPAID" } diff --git a/doc/models/paypal-wallet-vault-response.md b/doc/models/paypal-wallet-vault-response.md index 4713670..14706de 100644 --- a/doc/models/paypal-wallet-vault-response.md +++ b/doc/models/paypal-wallet-vault-response.md @@ -13,7 +13,7 @@ The details about a saved PayPal Wallet payment source. | --- | --- | --- | --- | | `id` | `String` | Optional | The PayPal-generated ID for the saved payment source.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | | `status` | [`PaypalWalletVaultStatus`](../../doc/models/paypal-wallet-vault-status.md) | Optional | The vault status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `customer` | [`PaypalWalletCustomer`](../../doc/models/paypal-wallet-customer.md) | Optional | The details about a customer in PayPal's system of record. | ## Example (as JSON) diff --git a/doc/models/phone-number-with-country-code.md b/doc/models/phone-number-with-country-code.md index 2dfdc08..34e7c3d 100644 --- a/doc/models/phone-number-with-country-code.md +++ b/doc/models/phone-number-with-country-code.md @@ -1,7 +1,7 @@ # Phone Number With Country Code -The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). +The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). ## Structure diff --git a/doc/models/phone-number-with-optional-country-code.md b/doc/models/phone-number-with-optional-country-code.md new file mode 100644 index 0000000..cfa5c07 --- /dev/null +++ b/doc/models/phone-number-with-optional-country-code.md @@ -0,0 +1,25 @@ + +# Phone Number With Optional Country Code + +The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). + +## Structure + +`PhoneNumberWithOptionalCountryCode` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `country_code` | `String` | Optional | The country calling code (CC), in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the CC and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `3`, *Pattern*: `^[0-9]{1,3}?$` | +| `national_number` | `String` | Required | The national number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the country calling code (CC) and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `14`, *Pattern*: `^[0-9]{1,14}?$` | + +## Example (as JSON) + +```json +{ + "country_code": "country_code6", + "national_number": "national_number0" +} +``` + diff --git a/doc/models/phone-number.md b/doc/models/phone-number.md index 1b99ac8..5857391 100644 --- a/doc/models/phone-number.md +++ b/doc/models/phone-number.md @@ -1,7 +1,7 @@ # Phone Number -The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). +The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). ## Structure diff --git a/doc/models/phone-type.md b/doc/models/phone-type.md index 99bb423..a289eb6 100644 --- a/doc/models/phone-type.md +++ b/doc/models/phone-type.md @@ -9,11 +9,11 @@ The phone type. ## Fields -| Name | -| --- | -| `FAX` | -| `HOME` | -| `MOBILE` | -| `OTHER` | -| `PAGER` | +| Name | Description | +| --- | --- | +| `FAX` | Fax number. | +| `HOME` | Home phone number. | +| `MOBILE` | Mobile phone number. | +| `OTHER` | Other phone number. | +| `PAGER` | Pager number. | diff --git a/doc/models/plan-collection.md b/doc/models/plan-collection.md new file mode 100644 index 0000000..6e105ae --- /dev/null +++ b/doc/models/plan-collection.md @@ -0,0 +1,53 @@ + +# Plan Collection + +The list of plans with details. + +## Structure + +`PlanCollection` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `plans` | [`Array[BillingPlan]`](../../doc/models/billing-plan.md) | Optional | An array of plans.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | +| `total_items` | `Integer` | Optional | The total number of items.

**Constraints**: `>= 0`, `<= 500000000` | +| `total_pages` | `Integer` | Optional | The total number of pages.

**Constraints**: `>= 0`, `<= 100000000` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | + +## Example (as JSON) + +```json +{ + "plans": [ + { + "id": "id4", + "product_id": "product_id0", + "name": "name4", + "status": "INACTIVE", + "description": "description4" + } + ], + "total_items": 158, + "total_pages": 194, + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/plan-details.md b/doc/models/plan-details.md new file mode 100644 index 0000000..1e46256 --- /dev/null +++ b/doc/models/plan-details.md @@ -0,0 +1,176 @@ + +# Plan Details + +The plan details. + +## Structure + +`PlanDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `product_id` | `String` | Optional | The ID for the product.

**Constraints**: *Minimum Length*: `22`, *Maximum Length*: `22`, *Pattern*: `^PROD-[A-Z0-9]*$` | +| `name` | `String` | Optional | The plan name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `description` | `String` | Optional | The detailed description of the plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `billing_cycles` | [`Array[SubscriptionBillingCycle]`](../../doc/models/subscription-billing-cycle.md) | Optional | An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `12` | +| `payment_preferences` | [`PaymentPreferences`](../../doc/models/payment-preferences.md) | Optional | The payment preferences for a subscription. | +| `merchant_preferences` | [`MerchantPreferences`](../../doc/models/merchant-preferences.md) | Optional | The merchant preferences for a subscription. | +| `taxes` | [`Taxes`](../../doc/models/taxes.md) | Optional | The tax details. | +| `quantity_supported` | `TrueClass \| FalseClass` | Optional | Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

**Default**: `false` | + +## Example (as JSON) + +```json +{ + "quantity_supported": false, + "product_id": "product_id6", + "name": "name8", + "description": "description2", + "billing_cycles": [ + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "frequency": { + "interval_unit": "DAY", + "interval_count": 94 + }, + "tenure_type": "REGULAR", + "sequence": 8, + "total_cycles": 198 + }, + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "frequency": { + "interval_unit": "DAY", + "interval_count": 94 + }, + "tenure_type": "REGULAR", + "sequence": 8, + "total_cycles": 198 + }, + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "frequency": { + "interval_unit": "DAY", + "interval_count": 94 + }, + "tenure_type": "REGULAR", + "sequence": 8, + "total_cycles": 198 + } + ], + "payment_preferences": { + "auto_bill_outstanding": false, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + }, + "setup_fee_failure_action": "CONTINUE", + "payment_failure_threshold": 104 + } +} +``` + diff --git a/doc/models/plan-override.md b/doc/models/plan-override.md new file mode 100644 index 0000000..6a80616 --- /dev/null +++ b/doc/models/plan-override.md @@ -0,0 +1,156 @@ + +# Plan Override + +An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. + +## Structure + +`PlanOverride` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `billing_cycles` | [`Array[BillingCycleOverride]`](../../doc/models/billing-cycle-override.md) | Optional | An array of billing cycles for trial billing and regular billing. The subscription billing cycle definition has to adhere to the plan billing cycle definition.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `12` | +| `payment_preferences` | [`PaymentPreferencesOverride`](../../doc/models/payment-preferences-override.md) | Optional | The payment preferences to override at subscription level. | +| `taxes` | [`TaxesOverride`](../../doc/models/taxes-override.md) | Optional | The tax details. | + +## Example (as JSON) + +```json +{ + "billing_cycles": [ + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + }, + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + }, + { + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + }, + "sequence": 8, + "total_cycles": 198 + } + ], + "payment_preferences": { + "auto_bill_outstanding": false, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + }, + "setup_fee_failure_action": "CONTINUE", + "payment_failure_threshold": 104 + }, + "taxes": { + "percentage": "percentage8", + "inclusive": false + } +} +``` + diff --git a/doc/models/plan-request-status.md b/doc/models/plan-request-status.md new file mode 100644 index 0000000..ec9a2a0 --- /dev/null +++ b/doc/models/plan-request-status.md @@ -0,0 +1,17 @@ + +# Plan Request Status + +The initial state of the plan. Allowed input values are CREATED and ACTIVE. + +## Enumeration + +`PlanRequestStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `CREATED` | The plan was created. You cannot create subscriptions for a plan in this state. | +| `INACTIVE` | The plan is inactive. | +| `ACTIVE` | The plan is active. You can only create subscriptions for a plan in this state. | + diff --git a/doc/models/plan-request.md b/doc/models/plan-request.md new file mode 100644 index 0000000..fa3fece --- /dev/null +++ b/doc/models/plan-request.md @@ -0,0 +1,98 @@ + +# Plan Request + +The create plan request details. + +## Structure + +`PlanRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `product_id` | `String` | Required | The ID of the product created through Catalog Products API.

**Constraints**: *Minimum Length*: `22`, *Maximum Length*: `22`, *Pattern*: `^PROD-[A-Z0-9]*$` | +| `name` | `String` | Required | The plan name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `status` | [`PlanRequestStatus`](../../doc/models/plan-request-status.md) | Optional | The initial state of the plan. Allowed input values are CREATED and ACTIVE.

**Default**: `PlanRequestStatus::ACTIVE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `description` | `String` | Optional | The detailed description of the plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `billing_cycles` | [`Array[SubscriptionBillingCycle]`](../../doc/models/subscription-billing-cycle.md) | Required | An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `12` | +| `payment_preferences` | [`PaymentPreferences`](../../doc/models/payment-preferences.md) | Required | The payment preferences for a subscription. | +| `merchant_preferences` | [`MerchantPreferences`](../../doc/models/merchant-preferences.md) | Optional | The merchant preferences for a subscription. | +| `taxes` | [`Taxes`](../../doc/models/taxes.md) | Optional | The tax details. | +| `quantity_supported` | `TrueClass \| FalseClass` | Optional | Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

**Default**: `false` | + +## Example (as JSON) + +```json +{ + "product_id": "product_id2", + "name": "name2", + "status": "ACTIVE", + "billing_cycles": [ + { + "frequency": { + "interval_unit": "DAY", + "interval_count": 1 + }, + "tenure_type": "REGULAR", + "sequence": 8, + "total_cycles": 1, + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + } + } + ], + "payment_preferences": { + "auto_bill_outstanding": true, + "setup_fee_failure_action": "CANCEL", + "payment_failure_threshold": 0, + "setup_fee": { + "currency_code": "currency_code8", + "value": "value4" + } + }, + "quantity_supported": false, + "description": "description8", + "merchant_preferences": { + "return_url": "return_url4", + "cancel_url": "cancel_url6" + }, + "taxes": { + "percentage": "percentage8", + "inclusive": false + } +} +``` + diff --git a/doc/models/plan.md b/doc/models/plan.md index a97eb31..51577a8 100644 --- a/doc/models/plan.md +++ b/doc/models/plan.md @@ -11,8 +11,7 @@ The merchant level Recurring Billing plan metadata for the Billing Agreement. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `billing_cycles` | [`Array`](../../doc/models/billing-cycle.md) | Required | An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `3` | -| `product` | `Object` | Optional | Product details associated with any one-time product purchase. | +| `billing_cycles` | [`Array[BillingCycle]`](../../doc/models/billing-cycle.md) | Required | An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `3` | | `one_time_charges` | [`OneTimeCharge`](../../doc/models/one-time-charge.md) | Required | The one-time charge info at the time of checkout. | | `name` | `String` | Optional | Name of the recurring plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[A-Za-z0-9() +',.:-]+$` | @@ -36,10 +35,6 @@ The merchant level Recurring Billing plan metadata for the Billing Agreement. "value": "value6" } }, - "frequency": { - "key1": "val1", - "key2": "val2" - }, "start_date": "start_date6" } ], @@ -69,10 +64,6 @@ The merchant level Recurring Billing plan metadata for the Billing Agreement. "value": "value8" } }, - "product": { - "key1": "val1", - "key2": "val2" - }, "name": "name8" } ``` diff --git a/doc/models/pricing-tier.md b/doc/models/pricing-tier.md new file mode 100644 index 0000000..bfdc56d --- /dev/null +++ b/doc/models/pricing-tier.md @@ -0,0 +1,30 @@ + +# Pricing Tier + +The pricing tier details. + +## Structure + +`PricingTier` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `starting_quantity` | `String` | Required | The starting quantity for the tier.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `ending_quantity` | `String` | Optional | The ending quantity for the tier. Optional for the last tier.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | + +## Example (as JSON) + +```json +{ + "starting_quantity": "starting_quantity4", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } +} +``` + diff --git a/doc/models/purchase-unit-request.md b/doc/models/purchase-unit-request.md index 4498964..134e621 100644 --- a/doc/models/purchase-unit-request.md +++ b/doc/models/purchase-unit-request.md @@ -15,11 +15,11 @@ The purchase unit request. Includes required information for the payment contrac | `amount` | [`AmountWithBreakdown`](../../doc/models/amount-with-breakdown.md) | Required | The total order amount with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. If you specify `amount.breakdown`, the amount equals `item_total` plus `tax_total` plus `shipping` plus `handling` plus `insurance` minus `shipping_discount` minus discount. The amount must be a positive number. For listed of supported currencies and decimal precision, see the PayPal REST APIs Currency Codes. | | `payee` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | | `payment_instruction` | [`PaymentInstruction`](../../doc/models/payment-instruction.md) | Optional | Any additional payment instructions to be consider during payment processing. This processing instruction is applicable for Capturing an order or Authorizing an Order. | -| `description` | `String` | Optional | The purchase description. The maximum length of the character is dependent on the type of characters used. The character length is specified assuming a US ASCII character. Depending on type of character; (e.g. accented character, Japanese characters) the number of characters that that can be specified as input might not equal the permissible max length.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | +| `description` | `String` | Optional | This field supports up to 3,000 characters, but any content beyond 127 characters (including spaces) will be truncated. The 127 character limit is reflected in the response representation of this field. The purchase description. The maximum length of the character is dependent on the type of characters used. The character length is specified assuming a US ASCII character. Depending on type of character; (e.g. accented character, Japanese characters) the number of characters that that can be specified as input might not equal the permissible max length.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `3000` | | `custom_id` | `String` | Optional | The API caller-provided external ID. Used to reconcile client transactions with PayPal transactions. Appears in transaction and settlement reports but is not visible to the payer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | -| `invoice_id` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | -| `soft_descriptor` | `String` | Optional | The soft descriptor is the dynamic text used to construct the statement descriptor that appears on a payer's card statement. If an Order is paid using the "PayPal Wallet", the statement descriptor will appear in following format on the payer's card statement: PAYPAL_prefix+(space)+merchant_descriptor+(space)+ soft_descriptor Note: The merchant descriptor is the descriptor of the merchant’s payment receiving preferences which can be seen by logging into the merchant account https://www.sandbox.paypal.com/businessprofile/settings/info/edit The PAYPAL prefix uses 8 characters. Only the first 22 characters will be displayed in the statement. For example, if: The PayPal prefix toggle is PAYPAL *. The merchant descriptor in the profile is Janes Gift. The soft descriptor is 800-123-1234. Then, the statement descriptor on the card is PAYPAL * Janes Gift 80.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22` | -| `items` | [`Array`](../../doc/models/item.md) | Optional | An array of items that the customer purchases from the merchant. | +| `invoice_id` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. invoice_id values are required to be unique within each merchant account by default. Although the uniqueness validation is configurable, disabling this behavior will remove the account's ability to use invoice_id in other APIs as an identifier. It is highly recommended to keep a unique invoice_id for each Order.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | +| `soft_descriptor` | `String` | Optional | This field supports up to 127 characters, but any content beyond 22 characters (including spaces) will be truncated. The 22 character limit is reflected in the response representation of this field. The soft descriptor is the dynamic text used to construct the statement descriptor that appears on a payer's card statement. If an Order is paid using the "PayPal Wallet", the statement descriptor will appear in following format on the payer's card statement: PAYPAL_prefix+(space)+merchant_descriptor+(space)+ soft_descriptor Note: The merchant descriptor is the descriptor of the merchant’s payment receiving preferences which can be seen by logging into the merchant account https://www.sandbox.paypal.com/businessprofile/settings/info/edit The PAYPAL prefix uses 8 characters. Only the first 22 characters will be displayed in the statement. For example, if: The PayPal prefix toggle is PAYPAL *. The merchant descriptor in the profile is Janes Gift. The soft descriptor is 800-123-1234. Then, the statement descriptor on the card is PAYPAL * Janes Gift 80.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1000` | +| `items` | [`Array[ItemRequest]`](../../doc/models/item-request.md) | Optional | An array of items that the customer purchases from the merchant. | | `shipping` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | | `supplementary_data` | [`SupplementaryData`](../../doc/models/supplementary-data.md) | Optional | Supplementary data about a payment. This object passes information that can be used to improve risk assessments and processing costs, for example, by providing Level 2 and Level 3 payment data. | diff --git a/doc/models/purchase-unit.md b/doc/models/purchase-unit.md index b65dfc0..af15450 100644 --- a/doc/models/purchase-unit.md +++ b/doc/models/purchase-unit.md @@ -20,11 +20,11 @@ The purchase unit details. Used to capture required information for the payment | `invoice_id` | `String` | Optional | The API caller-provided external invoice ID for this order.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127` | | `id` | `String` | Optional | The PayPal-generated ID for the purchase unit. This ID appears in both the payer's transaction history and the emails that the payer receives. In addition, this ID is available in transaction and settlement reports that merchants and API callers can use to reconcile transactions. This ID is only available when an order is saved by calling v2/checkout/orders/id/save.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `19` | | `soft_descriptor` | `String` | Optional | The payment descriptor on account transactions on the customer's credit card statement, that PayPal sends to processors. The maximum length of the soft descriptor information that you can pass in the API field is 22 characters, in the following format:22 - len(PAYPAL * (8)) - len(Descriptor in Payment Receiving Preferences of Merchant account + 1)The PAYPAL prefix uses 8 characters. The soft descriptor supports the following ASCII characters: Alphanumeric characters Dashes Asterisks Periods (.) Spaces For Wallet payments marketplace integrations: The merchant descriptor in the Payment Receiving Preferences must be the marketplace name. You can't use the remaining space to show the customer service number. The remaining spaces can be a combination of seller name and country. For unbranded payments (Direct Card) marketplace integrations, use a combination of the seller name and phone number.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22` | -| `items` | [`Array`](../../doc/models/item.md) | Optional | An array of items that the customer purchases from the merchant. | +| `items` | [`Array[Item]`](../../doc/models/item.md) | Optional | An array of items that the customer purchases from the merchant. | | `shipping` | [`ShippingWithTrackingDetails`](../../doc/models/shipping-with-tracking-details.md) | Optional | The order shipping details. | | `supplementary_data` | [`SupplementaryData`](../../doc/models/supplementary-data.md) | Optional | Supplementary data about a payment. This object passes information that can be used to improve risk assessments and processing costs, for example, by providing Level 2 and Level 3 payment data. | | `payments` | [`PaymentCollection`](../../doc/models/payment-collection.md) | Optional | The collection of payments, or transactions, for a purchase unit in an order. For example, authorized payments, captured payments, and refunds. | -| `most_recent_errors` | `Array` | Optional | The error reason code and description that are the reason for the most recent order decline.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | +| `most_recent_errors` | `Array[Object]` | Optional | The error reason code and description that are the reason for the most recent order decline.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | ## Example (as JSON) diff --git a/doc/models/reason-code.md b/doc/models/reason-code.md new file mode 100644 index 0000000..008a6e1 --- /dev/null +++ b/doc/models/reason-code.md @@ -0,0 +1,22 @@ + +# Reason Code + +The reason code for the payment failure. + +## Enumeration + +`ReasonCode` + +## Fields + +| Name | Description | +| --- | --- | +| `PAYMENT_DENIED` | PayPal declined the payment due to one or more customer issues. | +| `INTERNAL_SERVER_ERROR` | An internal server error has occurred. | +| `PAYEE_ACCOUNT_RESTRICTED` | The payee account is not in good standing and cannot receive payments. | +| `PAYER_ACCOUNT_RESTRICTED` | The payer account is not in good standing and cannot make payments. | +| `PAYER_CANNOT_PAY` | Payer cannot pay for this transaction. | +| `SENDING_LIMIT_EXCEEDED` | The transaction exceeds the payer's sending limit. | +| `TRANSACTION_RECEIVING_LIMIT_EXCEEDED` | The transaction exceeds the receiver's receiving limit. | +| `CURRENCY_MISMATCH` | The transaction is declined due to a currency mismatch. | + diff --git a/doc/models/reauthorize-request.md b/doc/models/reauthorize-request.md index bf76789..5c1ccaf 100644 --- a/doc/models/reauthorize-request.md +++ b/doc/models/reauthorize-request.md @@ -1,7 +1,7 @@ # Reauthorize Request -Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. You can reauthorize a payment only once from days four to 29. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment once. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. Note: This request is currently not supported for Partner use cases. +Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. You can reauthorize a payment only once from days four to 29. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment once. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the `amount` request parameter. ## Structure diff --git a/doc/models/refund-payment-instruction.md b/doc/models/refund-payment-instruction.md index 9b2695c..9fd38d3 100644 --- a/doc/models/refund-payment-instruction.md +++ b/doc/models/refund-payment-instruction.md @@ -11,7 +11,7 @@ Any additional payments instructions during refund payment processing. This obje | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `platform_fees` | [`Array`](../../doc/models/refund-platform-fee.md) | Optional | Specifies the amount that the API caller will contribute to the refund being processed. The amount needs to be lower than platform_fees amount originally captured or the amount that is remaining if multiple refunds have been processed. This field is only applicable to merchants that have been enabled for PayPal Commerce Platform for Marketplaces and Platforms capability. Please speak to your account manager if you want to use this capability.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | +| `platform_fees` | [`Array[RefundPlatformFee]`](../../doc/models/refund-platform-fee.md) | Optional | Specifies the amount that the API caller will contribute to the refund being processed. The amount needs to be lower than platform_fees amount originally captured or the amount that is remaining if multiple refunds have been processed. This field is only applicable to merchants that have been enabled for PayPal Commerce Platform for Marketplaces and Platforms capability. Please speak to your account manager if you want to use this capability.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | ## Example (as JSON) diff --git a/doc/models/refund.md b/doc/models/refund.md index f6fa81f..fe16b6d 100644 --- a/doc/models/refund.md +++ b/doc/models/refund.md @@ -21,7 +21,7 @@ The refund information. | `note_to_payer` | `String` | Optional | The reason for the refund. Appears in both the payer's transaction history and the emails that the payer receives. | | `seller_payable_breakdown` | [`SellerPayableBreakdown`](../../doc/models/seller-payable-breakdown.md) | Optional | The breakdown of the refund. | | `payer` | [`PayeeBase`](../../doc/models/payee-base.md) | Optional | The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee. | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | | `create_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | | `update_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | diff --git a/doc/models/return-flow.md b/doc/models/return-flow.md new file mode 100644 index 0000000..f717f6c --- /dev/null +++ b/doc/models/return-flow.md @@ -0,0 +1,16 @@ + +# Return Flow + +Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the Venmo App. + +## Enumeration + +`ReturnFlow` + +## Fields + +| Name | Description | +| --- | --- | +| `AUTO` | After payment approval in the PayPal App, buyer will automatically be redirected to the merchant website. | +| `MANUAL` | After payment approval in the PayPal App, buyer will be asked to manually navigate back to the merchant website where they started the transaction from. The buyer is shown a message like 'Return to Merchant' to return to the source where the transaction actually started. | + diff --git a/doc/models/search-error-exception.md b/doc/models/search-error-exception.md new file mode 100644 index 0000000..9854369 --- /dev/null +++ b/doc/models/search-error-exception.md @@ -0,0 +1,51 @@ + +# Search Error Exception + +The error details. + +## Structure + +`SearchErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `String` | Required | The human-readable, unique name of the error. | +| `message` | `String` | Required | The message that describes the error. | +| `debug_id` | `String` | Required | The PayPal internal ID. Used for correlation purposes. | +| `information_link` | `String` | Optional | The information link, or URI, that shows detailed information about this error for the developer. | +| `details` | [`Array[TransactionSearchErrorDetails]`](../../doc/models/transaction-search-error-details.md) | Optional | An array of additional details about the error. | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | +| `total_items` | `Integer` | Optional | The total number of transactions. Valid only for `RESULTSET_TOO_LARGE`.

**Constraints**: `>= 0`, `<= 2147483647` | +| `maximum_items` | `Integer` | Optional | The maximum number of transactions. Valid only for `RESULTSET_TOO_LARGE`.

**Constraints**: `>= 0`, `<= 2147483647` | + +## Example (as JSON) + +```json +{ + "name": "name8", + "message": "message8", + "debug_id": "debug_id6", + "information_link": "information_link0", + "details": [ + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "description": "description0" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "total_items": 20, + "maximum_items": 206 +} +``` + diff --git a/doc/models/search-response.md b/doc/models/search-response.md new file mode 100644 index 0000000..7162ba9 --- /dev/null +++ b/doc/models/search-response.md @@ -0,0 +1,228 @@ + +# Search Response + +The search response information. + +## Structure + +`SearchResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `transaction_details` | [`Array[TransactionDetails]`](../../doc/models/transaction-details.md) | Optional | An array of transaction detail objects.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `2147483647` | +| `account_number` | `String` | Optional | The merchant account number.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `start_date` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `end_date` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `last_refreshed_datetime` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `page` | `Integer` | Optional | A zero-relative index of transactions.

**Constraints**: `>= 0`, `<= 2147483647` | +| `total_items` | `Integer` | Optional | The total number of transactions as an integer beginning with the specified `page` in the full result and not just in this response.

**Constraints**: `>= 0`, `<= 2147483647` | +| `total_pages` | `Integer` | Optional | The total number of pages, as an `integer`, when the `total_items` is divided into pages of the specified `page_size`.

**Constraints**: `>= 0`, `<= 2147483647` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32767` | + +## Example (as JSON) + +```json +{ + "transaction_details": [ + { + "transaction_info": { + "paypal_account_id": "paypal_account_id4", + "transaction_id": "transaction_id0", + "paypal_reference_id": "paypal_reference_id2", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code6" + }, + "payer_info": { + "account_id": "account_id2", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status2" + }, + "shipping_info": { + "name": "name0", + "method": "method4", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } + }, + "cart_info": { + "item_details": [ + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + }, + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + } + ], + "tax_inclusive": false, + "paypal_invoice_id": "paypal_invoice_id6" + }, + "store_info": { + "store_id": "store_id2", + "terminal_id": "terminal_id6" + } + }, + { + "transaction_info": { + "paypal_account_id": "paypal_account_id4", + "transaction_id": "transaction_id0", + "paypal_reference_id": "paypal_reference_id2", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code6" + }, + "payer_info": { + "account_id": "account_id2", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status2" + }, + "shipping_info": { + "name": "name0", + "method": "method4", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } + }, + "cart_info": { + "item_details": [ + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + }, + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + } + ], + "tax_inclusive": false, + "paypal_invoice_id": "paypal_invoice_id6" + }, + "store_info": { + "store_id": "store_id2", + "terminal_id": "terminal_id6" + } + }, + { + "transaction_info": { + "paypal_account_id": "paypal_account_id4", + "transaction_id": "transaction_id0", + "paypal_reference_id": "paypal_reference_id2", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code6" + }, + "payer_info": { + "account_id": "account_id2", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status2" + }, + "shipping_info": { + "name": "name0", + "method": "method4", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } + }, + "cart_info": { + "item_details": [ + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + }, + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + } + ], + "tax_inclusive": false, + "paypal_invoice_id": "paypal_invoice_id6" + }, + "store_info": { + "store_id": "store_id2", + "terminal_id": "terminal_id6" + } + } + ], + "account_number": "account_number8", + "start_date": "start_date2", + "end_date": "end_date8", + "last_refreshed_datetime": "last_refreshed_datetime4" +} +``` + diff --git a/doc/models/seller-payable-breakdown.md b/doc/models/seller-payable-breakdown.md index a041885..5a6035e 100644 --- a/doc/models/seller-payable-breakdown.md +++ b/doc/models/seller-payable-breakdown.md @@ -16,8 +16,8 @@ The breakdown of the refund. | `paypal_fee_in_receivable_currency` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `net_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `net_amount_in_receivable_currency` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | -| `platform_fees` | [`Array`](../../doc/models/platform-fee.md) | Optional | An array of platform or partner fees, commissions, or brokerage fees for the refund.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | -| `net_amount_breakdown` | [`Array`](../../doc/models/net-amount-breakdown-item.md) | Optional | An array of breakdown values for the net amount. Returned when the currency of the refund is different from the currency of the PayPal account where the payee holds their funds. | +| `platform_fees` | [`Array[PlatformFee]`](../../doc/models/platform-fee.md) | Optional | An array of platform or partner fees, commissions, or brokerage fees for the refund.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | +| `net_amount_breakdown` | [`Array[NetAmountBreakdownItem]`](../../doc/models/net-amount-breakdown-item.md) | Optional | An array of breakdown values for the net amount. Returned when the currency of the refund is different from the currency of the PayPal account where the payee holds their funds. | | `total_refunded_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | ## Example (as JSON) diff --git a/doc/models/seller-protection.md b/doc/models/seller-protection.md index ca5b821..81fa511 100644 --- a/doc/models/seller-protection.md +++ b/doc/models/seller-protection.md @@ -12,7 +12,7 @@ The level of protection offered as defined by [PayPal Seller Protection for Merc | Name | Type | Tags | Description | | --- | --- | --- | --- | | `status` | [`SellerProtectionStatus`](../../doc/models/seller-protection-status.md) | Optional | Indicates whether the transaction is eligible for seller protection. For information, see [PayPal Seller Protection for Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection). | -| `dispute_categories` | [`Array`](../../doc/models/dispute-category.md) | Optional | An array of conditions that are covered for the transaction. | +| `dispute_categories` | [`Array[DisputeCategory]`](../../doc/models/dispute-category.md) | Optional | An array of conditions that are covered for the transaction. | ## Example (as JSON) diff --git a/doc/models/seller-receivable-breakdown.md b/doc/models/seller-receivable-breakdown.md index 16367cd..2f7cde4 100644 --- a/doc/models/seller-receivable-breakdown.md +++ b/doc/models/seller-receivable-breakdown.md @@ -17,7 +17,7 @@ The detailed breakdown of the capture activity. This is not available for transa | `net_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `receivable_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | | `exchange_rate` | [`ExchangeRate`](../../doc/models/exchange-rate.md) | Optional | The exchange rate that determines the amount to convert from one currency to another currency. | -| `platform_fees` | [`Array`](../../doc/models/platform-fee.md) | Optional | An array of platform or partner fees, commissions, or brokerage fees that associated with the captured payment.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | +| `platform_fees` | [`Array[PlatformFee]`](../../doc/models/platform-fee.md) | Optional | An array of platform or partner fees, commissions, or brokerage fees that associated with the captured payment.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `1` | ## Example (as JSON) diff --git a/doc/models/sepa-debit-experience-context.md b/doc/models/sepa-debit-experience-context.md new file mode 100644 index 0000000..e4a8d82 --- /dev/null +++ b/doc/models/sepa-debit-experience-context.md @@ -0,0 +1,27 @@ + +# Sepa Debit Experience Context + +Customizes the payer experience during the approval process for the SEPA Debit payment. + +## Structure + +`SepaDebitExperienceContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locale` | `String` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | +| `return_url` | `String` | Required | Describes the URL. | +| `cancel_url` | `String` | Required | Describes the URL. | + +## Example (as JSON) + +```json +{ + "locale": "locale8", + "return_url": "return_url6", + "cancel_url": "cancel_url8" +} +``` + diff --git a/doc/models/sepa-debit-request.md b/doc/models/sepa-debit-request.md new file mode 100644 index 0000000..74109fa --- /dev/null +++ b/doc/models/sepa-debit-request.md @@ -0,0 +1,27 @@ + +# Sepa Debit Request + +An API resource denoting a request to securely store a SEPA Debit. + +## Structure + +`SepaDebitRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `experience_context` | [`SepaDebitExperienceContext`](../../doc/models/sepa-debit-experience-context.md) | Optional | Customizes the payer experience during the approval process for the SEPA Debit payment. | + +## Example (as JSON) + +```json +{ + "experience_context": { + "locale": "locale6", + "return_url": "return_url4", + "cancel_url": "cancel_url6" + } +} +``` + diff --git a/doc/models/setup-fee-failure-action.md b/doc/models/setup-fee-failure-action.md new file mode 100644 index 0000000..714e6e7 --- /dev/null +++ b/doc/models/setup-fee-failure-action.md @@ -0,0 +1,16 @@ + +# Setup Fee Failure Action + +The action to take on the subscription if the initial payment for the setup fails. + +## Enumeration + +`SetupFeeFailureAction` + +## Fields + +| Name | Description | +| --- | --- | +| `CONTINUE` | Continues the subscription if the initial payment for the setup fails. | +| `CANCEL` | Cancels the subscription if the initial payment for the setup fails. | + diff --git a/doc/models/setup-token-request-card.md b/doc/models/setup-token-request-card.md index 513a8ad..5a067ad 100644 --- a/doc/models/setup-token-request-card.md +++ b/doc/models/setup-token-request-card.md @@ -18,7 +18,7 @@ A Resource representing a request to vault a Card. | `brand` | [`CardBrand`](../../doc/models/card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | | `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | | `verification_method` | [`VaultCardVerificationMethod`](../../doc/models/vault-card-verification-method.md) | Optional | The verification method of the card.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `experience_context` | [`SetupTokenCardExperienceContext`](../../doc/models/setup-token-card-experience-context.md) | Optional | Customizes the Vault creation flow experience for your customers. | +| `experience_context` | [`VaultCardExperienceContext`](../../doc/models/vault-card-experience-context.md) | Optional | A resource representing an experience context of vault a card. | ## Example (as JSON) @@ -28,7 +28,7 @@ A Resource representing a request to vault a Card. "number": "number0", "expiry": "expiry0", "security_code": "security_code4", - "brand": "DINERS" + "brand": "STAR" } ``` diff --git a/doc/models/setup-token-request-payment-source.md b/doc/models/setup-token-request-payment-source.md index 1f27aff..c08c413 100644 --- a/doc/models/setup-token-request-payment-source.md +++ b/doc/models/setup-token-request-payment-source.md @@ -13,8 +13,10 @@ The payment method to vault with the instrument details. | --- | --- | --- | --- | | `card` | [`SetupTokenRequestCard`](../../doc/models/setup-token-request-card.md) | Optional | A Resource representing a request to vault a Card. | | `paypal` | [`VaultPaypalWalletRequest`](../../doc/models/vault-paypal-wallet-request.md) | Optional | A resource representing a request to vault PayPal Wallet. | -| `venmo` | [`VaultVenmoRequest`](../../doc/models/vault-venmo-request.md) | Optional | - | +| `venmo` | [`VaultVenmoRequest`](../../doc/models/vault-venmo-request.md) | Optional | A resource representing a request to vault Venmo. | +| `apple_pay` | [`VaultApplePayRequest`](../../doc/models/vault-apple-pay-request.md) | Optional | A resource representing a request to vault Apple Pay. | | `token` | [`VaultTokenRequest`](../../doc/models/vault-token-request.md) | Optional | The Tokenized Payment Source representing a Request to Vault a Token. | +| `bank` | [`BankRequest`](../../doc/models/bank-request.md) | Optional | A Resource representing a request to vault a Bank used for ACH Debit. | ## Example (as JSON) @@ -25,7 +27,7 @@ The payment method to vault with the instrument details. "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "paypal": { "description": "description2", @@ -34,6 +36,7 @@ The payment method to vault with the instrument details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -58,6 +61,7 @@ The payment method to vault with the instrument details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -75,6 +79,21 @@ The payment method to vault with the instrument details. "permit_multiple_payment_tokens": false, "usage_type": "MERCHANT" }, + "apple_pay": { + "token": "token6", + "card": { + "type": "UNKNOWN", + "brand": "CB_NATIONALE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } + } + }, "token": { "id": "id6", "type": "SETUP_TOKEN" diff --git a/doc/models/setup-token-request.md b/doc/models/setup-token-request.md index a7ef369..af4a46e 100644 --- a/doc/models/setup-token-request.md +++ b/doc/models/setup-token-request.md @@ -28,7 +28,7 @@ Setup Token Request where the `source` defines the type of instrument to be stor "number": "number6", "expiry": "expiry4", "security_code": "security_code8", - "brand": "RUPAY" + "brand": "CB_NATIONALE" }, "paypal": { "description": "description2", @@ -37,6 +37,7 @@ Setup Token Request where the `source` defines the type of instrument to be stor "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -61,6 +62,7 @@ Setup Token Request where the `source` defines the type of instrument to be stor "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -78,6 +80,21 @@ Setup Token Request where the `source` defines the type of instrument to be stor "permit_multiple_payment_tokens": false, "usage_type": "MERCHANT" }, + "apple_pay": { + "token": "token6", + "card": { + "type": "UNKNOWN", + "brand": "CB_NATIONALE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } + } + }, "token": { "id": "id6", "type": "SETUP_TOKEN" diff --git a/doc/models/setup-token-response-card.md b/doc/models/setup-token-response-card.md index 6a4616a..7b971b6 100644 --- a/doc/models/setup-token-response-card.md +++ b/doc/models/setup-token-response-card.md @@ -27,7 +27,7 @@ { "name": "name8", "last_digits": "last_digits2", - "brand": "ELO", + "brand": "DISCOVER", "expiry": "expiry6", "billing_address": { "address_line_1": "address_line_12", diff --git a/doc/models/setup-token-response-payment-source.md b/doc/models/setup-token-response-payment-source.md index 7d441bc..4cfea87 100644 --- a/doc/models/setup-token-response-payment-source.md +++ b/doc/models/setup-token-response-payment-source.md @@ -12,8 +12,8 @@ The setup payment method details. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `card` | [`SetupTokenResponseCard`](../../doc/models/setup-token-response-card.md) | Optional | - | -| `paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | - | -| `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | - | +| `paypal` | [`PaypalPaymentToken`](../../doc/models/paypal-payment-token.md) | Optional | Full representation of a PayPal Payment Token. | +| `venmo` | [`VenmoPaymentToken`](../../doc/models/venmo-payment-token.md) | Optional | Full representation of a Venmo Payment Token. | ## Example (as JSON) @@ -22,7 +22,7 @@ The setup payment method details. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -40,6 +40,7 @@ The setup payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -64,6 +65,7 @@ The setup payment method details. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/setup-token-response.md b/doc/models/setup-token-response.md index a34035b..0e09b26 100644 --- a/doc/models/setup-token-response.md +++ b/doc/models/setup-token-response.md @@ -11,11 +11,11 @@ Minimal representation of a cached setup token. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `String` | Optional | The PayPal-generated ID for the vault token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `id` | `String` | Optional | The PayPal-generated ID for the vaulted payment source. This ID should be stored on the merchant's server so the saved payment source can be used for future transactions.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `customer` | [`Customer`](../../doc/models/customer.md) | Optional | This object defines a customer in your system. Use it to manage customer profiles, save payment methods and contact details. | | `status` | [`PaymentTokenStatus`](../../doc/models/payment-token-status.md) | Optional | The status of the payment token.

**Default**: `PaymentTokenStatus::CREATED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `payment_source` | [`SetupTokenResponsePaymentSource`](../../doc/models/setup-token-response-payment-source.md) | Optional | The setup payment method details. | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of related [HATEOAS links](/api/rest/responses/#hateoas).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | ## Example (as JSON) @@ -31,7 +31,7 @@ Minimal representation of a cached setup token. "card": { "name": "name6", "last_digits": "last_digits0", - "brand": "RUPAY", + "brand": "CB_NATIONALE", "expiry": "expiry4", "billing_address": { "address_line_1": "address_line_12", @@ -49,6 +49,7 @@ Minimal representation of a cached setup token. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" @@ -73,6 +74,7 @@ Minimal representation of a cached setup token. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/shipment-carrier.md b/doc/models/shipment-carrier.md index 1a71f58..806a9b6 100644 --- a/doc/models/shipment-carrier.md +++ b/doc/models/shipment-carrier.md @@ -1387,4 +1387,40 @@ The carrier for the shipment. Some carriers have a global version as well as loc | `UPS_CHECKER` | ups-checker. | | `WINESHIPPING` | Wineshipping. | | `SPEDISCI` | Spedisci online. | +| `FOURKITES` | Fourkites. | +| `ETONAS` | Etonas. | +| `FINMILE` | Fin Mile. | +| `UNIUNI` | Uniuni. | +| `RODONAVES` | Rodonaves. | +| `INPOST_IT` | Inpost Italy. | +| `TFORCE_FREIGHT` | Tforce Freight. | +| `RICHMOM` | Rich Mom. | +| `FRANCO` | Corriere Franco. | +| `ECPARCEL` | Ecparcel. | +| `FEDEX_CHINA` | Fedex China. | +| `GOFO_EXPRESS` | Gofo Express. | +| `SHIPBOB` | Shipbob. | +| `JERSEYPOST_ATLAS` | Jersey Post Group. | +| `CORETRAILS` | Coretrails. | +| `RHENUS_ITALY` | Rhenus Logistics Italy. | +| `JADLOG` | Jadlog. | +| `JITSU` | Jitsu. | +| `YANWEN_EXPRESS` | Yanwen Express. | +| `DASHLINK` | Dashlink. | +| `SEINO_SUPER_EXPRESS` | Seino Super Express. | +| `FLOSHIP` | Floship. | +| `METROSCG` | Metro Supply Chain. | +| `SENDPARCEL` | Sendparcel. | +| `P2P` | P2p. | +| `CN_EXPRESS` | Cn Express. | +| `CIRROTRACK` | Cirro Track. | +| `LAND_LOGISTICS` | Land Logistics. | +| `VEHO` | Veho. | +| `MEDLINE` | Medline. | +| `VDTRACK` | Vdtrack. | +| `SINO_SCM` | Sino Scm. | +| `ENUM_3PE_EXPRESS` | 3pe Express. | +| `SWIFTX` | Swiftx. | +| `SFYDEXPRESS` | Sfyd Express. | +| `TOPTRANS` | Toptrans. | diff --git a/doc/models/shipping-details.md b/doc/models/shipping-details.md index 17f444f..529ce46 100644 --- a/doc/models/shipping-details.md +++ b/doc/models/shipping-details.md @@ -15,7 +15,7 @@ The shipping details. | `email_address` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``^(?:[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\|\[(?:(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?\|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$`` | | `phone_number` | [`PhoneNumberWithCountryCode`](../../doc/models/phone-number-with-country-code.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | | `type` | [`FulfillmentType`](../../doc/models/fulfillment-type.md) | Optional | A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `options` | [`Array`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | +| `options` | [`Array[ShippingOption]`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | ## Example (as JSON) diff --git a/doc/models/shipping-information.md b/doc/models/shipping-information.md new file mode 100644 index 0000000..5b04dfe --- /dev/null +++ b/doc/models/shipping-information.md @@ -0,0 +1,43 @@ + +# Shipping Information + +The shipping information. + +## Structure + +`ShippingInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `String` | Optional | The recipient's name.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `method` | `String` | Optional | The shipping method that is associated with this order.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `address` | [`SimplePostalAddressCoarseGrained`](../../doc/models/simple-postal-address-coarse-grained.md) | Optional | A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. | +| `secondary_shipping_address` | [`SimplePostalAddressCoarseGrained`](../../doc/models/simple-postal-address-coarse-grained.md) | Optional | A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. | + +## Example (as JSON) + +```json +{ + "name": "name8", + "method": "method2", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } +} +``` + diff --git a/doc/models/shipping-options-purchase-unit.md b/doc/models/shipping-options-purchase-unit.md deleted file mode 100644 index fae3ca8..0000000 --- a/doc/models/shipping-options-purchase-unit.md +++ /dev/null @@ -1,108 +0,0 @@ - -# Shipping Options Purchase Unit - -This would contain shipping option and amount data at purchase unit level. - -## Structure - -`ShippingOptionsPurchaseUnit` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `reference_id` | `String` | Optional | The API caller-provided external ID for the purchase unit. Required for multiple purchase units when you must update the order through `PATCH`. If you omit this value and the order contains only one purchase unit, PayPal sets this value to `default`. Note: If there are multiple purchase units, reference_id is required for each purchase unit.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^.*$` | -| `amount` | [`AmountWithBreakdown`](../../doc/models/amount-with-breakdown.md) | Optional | The total order amount with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. If you specify `amount.breakdown`, the amount equals `item_total` plus `tax_total` plus `shipping` plus `handling` plus `insurance` minus `shipping_discount` minus discount. The amount must be a positive number. For listed of supported currencies and decimal precision, see the PayPal REST APIs Currency Codes. | -| `items` | [`Array`](../../doc/models/item.md) | Optional | An array of items that the customer purchases from the merchant. | -| `shipping_options` | [`Array`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | - -## Example (as JSON) - -```json -{ - "reference_id": "reference_id4", - "amount": { - "currency_code": "currency_code6", - "value": "value0", - "breakdown": { - "item_total": { - "currency_code": "currency_code0", - "value": "value6" - }, - "shipping": { - "currency_code": "currency_code0", - "value": "value6" - }, - "handling": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax_total": { - "currency_code": "currency_code4", - "value": "value0" - }, - "insurance": { - "currency_code": "currency_code2", - "value": "value8" - } - } - }, - "items": [ - { - "name": "name8", - "unit_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax": { - "currency_code": "currency_code0", - "value": "value6" - }, - "quantity": "quantity4", - "description": "description2", - "sku": "sku6", - "url": "url2", - "category": "DONATION" - }, - { - "name": "name8", - "unit_amount": { - "currency_code": "currency_code2", - "value": "value8" - }, - "tax": { - "currency_code": "currency_code0", - "value": "value6" - }, - "quantity": "quantity4", - "description": "description2", - "sku": "sku6", - "url": "url2", - "category": "DONATION" - } - ], - "shipping_options": [ - { - "id": "id8", - "label": "label8", - "type": "PICKUP_IN_STORE", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - }, - { - "id": "id8", - "label": "label8", - "type": "PICKUP_IN_STORE", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } - ] -} -``` - diff --git a/doc/models/shipping-with-tracking-details.md b/doc/models/shipping-with-tracking-details.md index aac3441..abaa9f1 100644 --- a/doc/models/shipping-with-tracking-details.md +++ b/doc/models/shipping-with-tracking-details.md @@ -1,8 +1,6 @@ # Shipping With Tracking Details -The order shipping details. - ## Structure `ShippingWithTrackingDetails` @@ -11,18 +9,72 @@ The order shipping details. | Name | Type | Tags | Description | | --- | --- | --- | --- | +| `trackers` | [`Array[OrderTrackerResponse]`](../../doc/models/order-tracker-response.md) | Optional | An array of trackers for a transaction. | | `name` | [`ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | | `email_address` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``^(?:[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\|\[(?:(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?\|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$`` | -| `phone_number` | [`PhoneNumberWithCountryCode`](../../doc/models/phone-number-with-country-code.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | +| `phone_number` | [`PhoneNumberWithOptionalCountryCode`](../../doc/models/phone-number-with-optional-country-code.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | | `type` | [`FulfillmentType`](../../doc/models/fulfillment-type.md) | Optional | A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `options` | [`Array`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | +| `options` | [`Array[ShippingOption]`](../../doc/models/shipping-option.md) | Optional | An array of shipping options that the payee or merchant offers to the payer to ship or pick up their items.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `10` | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | -| `trackers` | [`Array`](../../doc/models/order-tracker-response.md) | Optional | An array of trackers for a transaction. | ## Example (as JSON) ```json { + "trackers": [ + { + "id": "id2", + "status": "CANCELLED", + "items": [ + { + "name": "name8", + "quantity": "quantity4", + "sku": "sku6", + "url": "url2", + "image_url": "image_url4" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "create_time": "create_time8" + }, + { + "id": "id2", + "status": "CANCELLED", + "items": [ + { + "name": "name8", + "quantity": "quantity4", + "sku": "sku6", + "url": "url2", + "image_url": "image_url4" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "create_time": "create_time8" + } + ], "name": { "full_name": "full_name6" }, @@ -31,29 +83,7 @@ The order shipping details. "country_code": "country_code2", "national_number": "national_number6" }, - "type": "SHIPPING", - "options": [ - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - }, - { - "id": "id2", - "label": "label2", - "type": "SHIPPING", - "amount": { - "currency_code": "currency_code6", - "value": "value0" - }, - "selected": false - } - ] + "type": "SHIPPING" } ``` diff --git a/doc/models/simple-postal-address-coarse-grained.md b/doc/models/simple-postal-address-coarse-grained.md new file mode 100644 index 0000000..341225c --- /dev/null +++ b/doc/models/simple-postal-address-coarse-grained.md @@ -0,0 +1,33 @@ + +# Simple Postal Address Coarse Grained + +A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone. + +## Structure + +`SimplePostalAddressCoarseGrained` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `line_1` | `String` | Required | The first line of the address. For example, number or street. | +| `line_2` | `String` | Optional | The second line of the address. For example, suite or apartment number. | +| `city` | `String` | Required | The city name. | +| `state` | `String` | Optional | The [code](/docs/api/reference/state-codes/) for a US state or the equivalent for other countries. Required for transactions if the address is in one of these countries: [Argentina](/docs/api/reference/state-codes/#argentina), [Brazil](/docs/api/reference/state-codes/#brazil), [Canada](/docs/api/reference/state-codes/#canada), [China](/docs/api/reference/state-codes/#china), [India](/docs/api/reference/state-codes/#india), [Italy](/docs/api/reference/state-codes/#italy), [Japan](/docs/api/reference/state-codes/#japan), [Mexico](/docs/api/reference/state-codes/#mexico), [Thailand](/docs/api/reference/state-codes/#thailand), or [United States](/docs/api/reference/state-codes/#usa). Maximum length is 40 single-byte characters. | +| `country_code` | `String` | Required | The [two-character ISO 3166-1 code](/docs/integration/direct/rest/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^([A-Z]{2}\|C2)$` | +| `postal_code` | `String` | Optional | The postal code, which is the zip code or equivalent. Typically required for countries with a postal code or an equivalent. See [postal code](https://en.wikipedia.org/wiki/Postal_code). | + +## Example (as JSON) + +```json +{ + "line1": "line14", + "line2": "line26", + "city": "city2", + "state": "state8", + "country_code": "country_code2", + "postal_code": "postal_code4" +} +``` + diff --git a/doc/models/store-information.md b/doc/models/store-information.md new file mode 100644 index 0000000..74313bd --- /dev/null +++ b/doc/models/store-information.md @@ -0,0 +1,25 @@ + +# Store Information + +The store information. + +## Structure + +`StoreInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `store_id` | `String` | Optional | The ID of a store for a merchant in the system of record.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `terminal_id` | `String` | Optional | The terminal ID for the checkout stand in a merchant store.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60`, *Pattern*: `^[a-zA-Z0-9]*$` | + +## Example (as JSON) + +```json +{ + "store_id": "store_id6", + "terminal_id": "terminal_id0" +} +``` + diff --git a/doc/models/stored-payment-source.md b/doc/models/stored-payment-source.md index d49f1f2..f1bdaf2 100644 --- a/doc/models/stored-payment-source.md +++ b/doc/models/stored-payment-source.md @@ -14,7 +14,7 @@ Provides additional details to process a payment using a `payment_source` that h | `payment_initiator` | [`PaymentInitiator`](../../doc/models/payment-initiator.md) | Required | The person or party who initiated or triggered the payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `payment_type` | [`StoredPaymentSourcePaymentType`](../../doc/models/stored-payment-source-payment-type.md) | Required | Indicates the type of the stored payment_source payment.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `usage` | [`StoredPaymentSourceUsageType`](../../doc/models/stored-payment-source-usage-type.md) | Optional | Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file).

**Default**: `StoredPaymentSourceUsageType::DERIVED`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `previous_network_transaction_reference` | [`NetworkTransactionReference`](../../doc/models/network-transaction-reference.md) | Optional | Reference values used by the card network to identify a transaction. | +| `previous_network_transaction_reference` | [`NetworkTransaction`](../../doc/models/network-transaction.md) | Optional | Reference values used by the card network to identify a transaction. | ## Example (as JSON) @@ -26,7 +26,7 @@ Provides additional details to process a payment using a `payment_source` that h "previous_network_transaction_reference": { "id": "id6", "date": "date2", - "network": "DELTA", + "network": "CONFIDIS", "acquirer_reference_number": "acquirer_reference_number8" } } diff --git a/doc/models/subscriber-request.md b/doc/models/subscriber-request.md new file mode 100644 index 0000000..448b4dc --- /dev/null +++ b/doc/models/subscriber-request.md @@ -0,0 +1,67 @@ + +# Subscriber Request + +The subscriber request information . + +## Structure + +`SubscriberRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | +| `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | +| `shipping_address` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | +| `payment_source` | [`SubscriptionPaymentSource`](../../doc/models/subscription-payment-source.md) | Optional | The payment source definition. To be eligible to create subscription using debit or credit card, you will need to sign up here (https://www.paypal.com/bizsignup/entry/product/ppcp). Please note, its available only for non-3DS cards and for merchants in US and AU regions. | + +## Example (as JSON) + +```json +{ + "name": { + "given_name": "given_name2", + "surname": "surname8" + }, + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "payment_source": { + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "security_code": "security_code8", + "type": "UNKNOWN" + } + } +} +``` + diff --git a/doc/models/subscriber.md b/doc/models/subscriber.md new file mode 100644 index 0000000..889f6c9 --- /dev/null +++ b/doc/models/subscriber.md @@ -0,0 +1,66 @@ + +# Subscriber + +The subscriber response information. + +## Structure + +`Subscriber` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | +| `shipping_address` | [`ShippingDetails`](../../doc/models/shipping-details.md) | Optional | The shipping details. | +| `payment_source` | [`SubscriptionPaymentSourceResponse`](../../doc/models/subscription-payment-source-response.md) | Optional | The payment source used to fund the payment. | + +## Example (as JSON) + +```json +{ + "name": { + "given_name": "given_name2", + "surname": "surname8" + }, + "shipping_address": { + "name": { + "full_name": "full_name6" + }, + "email_address": "email_address8", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6" + }, + "type": "PICKUP_IN_STORE", + "options": [ + { + "id": "id2", + "label": "label2", + "type": "SHIPPING", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "selected": false + } + ] + }, + "payment_source": { + "card": { + "name": "name6", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + }, + "expiry": "expiry4", + "currency_code": "currency_code2" + } + } +} +``` + diff --git a/doc/models/subscription-amount-with-breakdown.md b/doc/models/subscription-amount-with-breakdown.md new file mode 100644 index 0000000..97902ef --- /dev/null +++ b/doc/models/subscription-amount-with-breakdown.md @@ -0,0 +1,51 @@ + +# Subscription Amount With Breakdown + +The breakdown details for the amount. Includes the gross, tax, fee, and shipping amounts. + +## Structure + +`SubscriptionAmountWithBreakdown` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `gross_amount` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | +| `total_item_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `fee_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `tax_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `net_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | + +## Example (as JSON) + +```json +{ + "gross_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "total_item_amount": { + "currency_code": "currency_code8", + "value": "value4" + }, + "fee_amount": { + "currency_code": "currency_code2", + "value": "value4" + }, + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "tax_amount": { + "currency_code": "currency_code2", + "value": "value8" + }, + "net_amount": { + "currency_code": "currency_code6", + "value": "value2" + } +} +``` + diff --git a/doc/models/subscription-application-context.md b/doc/models/subscription-application-context.md new file mode 100644 index 0000000..f4cbf8d --- /dev/null +++ b/doc/models/subscription-application-context.md @@ -0,0 +1,37 @@ + +# Subscription Application Context + +The application context, which customizes the payer experience during the subscription approval process with PayPal. + +## Structure + +`SubscriptionApplicationContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `brand_name` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `locale` | `String` | Optional | The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `ExperienceContextShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `user_action` | [`ApplicationContextUserAction`](../../doc/models/application-context-user-action.md) | Optional | Configures the label name to `Continue` or `Subscribe Now` for subscription consent experience.

**Default**: `ApplicationContextUserAction::SUBSCRIBE_NOW`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `payment_method` | [`PaymentMethod`](../../doc/models/payment-method.md) | Optional | The customer and merchant payment preferences. | +| `return_url` | `String` | Required | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | +| `cancel_url` | `String` | Required | The URL where the customer is redirected after the customer cancels the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | + +## Example (as JSON) + +```json +{ + "shipping_preference": "GET_FROM_FILE", + "user_action": "SUBSCRIBE_NOW", + "return_url": "return_url0", + "cancel_url": "cancel_url2", + "brand_name": "brand_name8", + "locale": "locale2", + "payment_method": { + "payee_preferred": "UNRESTRICTED" + } +} +``` + diff --git a/doc/models/subscription-billing-cycle.md b/doc/models/subscription-billing-cycle.md new file mode 100644 index 0000000..ccede75 --- /dev/null +++ b/doc/models/subscription-billing-cycle.md @@ -0,0 +1,68 @@ + +# Subscription Billing Cycle + +The billing cycle details. + +## Structure + +`SubscriptionBillingCycle` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `pricing_scheme` | [`SubscriptionPricingScheme`](../../doc/models/subscription-pricing-scheme.md) | Optional | The pricing scheme details. | +| `frequency` | [`Frequency`](../../doc/models/frequency.md) | Required | The frequency of the billing cycle. | +| `tenure_type` | [`TenureType`](../../doc/models/tenure-type.md) | Required | The tenure type of the billing cycle. In case of a plan having trial cycle, only 2 trial cycles are allowed per plan.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `sequence` | `Integer` | Required | The order in which this cycle is to run among other billing cycles. For example, a trial billing cycle has a `sequence` of `1` while a regular billing cycle has a `sequence` of `2`, so that trial cycle runs before the regular cycle.

**Constraints**: `>= 1`, `<= 99` | +| `total_cycles` | `Integer` | Optional | The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).

**Default**: `1`

**Constraints**: `>= 0`, `<= 999` | + +## Example (as JSON) + +```json +{ + "frequency": { + "interval_unit": "DAY", + "interval_count": 1 + }, + "tenure_type": "REGULAR", + "sequence": 30, + "total_cycles": 1, + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + } +} +``` + diff --git a/doc/models/subscription-billing-information.md b/doc/models/subscription-billing-information.md new file mode 100644 index 0000000..ec70fcc --- /dev/null +++ b/doc/models/subscription-billing-information.md @@ -0,0 +1,69 @@ + +# Subscription Billing Information + +The billing details for the subscription. If the subscription was or is active, these fields are populated. + +## Structure + +`SubscriptionBillingInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `outstanding_balance` | [`Money`](../../doc/models/money.md) | Required | The currency and amount for a financial transaction, such as a balance or payment due. | +| `cycle_executions` | [`Array[CycleExecution]`](../../doc/models/cycle-execution.md) | Optional | The trial and regular billing executions.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `3` | +| `last_payment` | [`LastPaymentDetails`](../../doc/models/last-payment-details.md) | Optional | The details for the last payment. | +| `next_billing_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `final_payment_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `failed_payments_count` | `Integer` | Required | The number of consecutive payment failures. Resets to `0` after a successful payment. If this reaches the `payment_failure_threshold` value, the subscription updates to the `SUSPENDED` state.

**Constraints**: `>= 0`, `<= 999` | +| `last_failed_payment` | [`FailedPaymentDetails`](../../doc/models/failed-payment-details.md) | Optional | The details for the failed payment of the subscription. | + +## Example (as JSON) + +```json +{ + "outstanding_balance": { + "currency_code": "currency_code8", + "value": "value4" + }, + "cycle_executions": [ + { + "tenure_type": "REGULAR", + "sequence": 64, + "cycles_completed": 110, + "cycles_remaining": 14, + "current_pricing_scheme_version": 99, + "total_cycles": 254 + }, + { + "tenure_type": "REGULAR", + "sequence": 64, + "cycles_completed": 110, + "cycles_remaining": 14, + "current_pricing_scheme_version": 99, + "total_cycles": 254 + } + ], + "last_payment": { + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "time": "time2" + }, + "next_billing_time": "next_billing_time0", + "final_payment_time": "final_payment_time4", + "failed_payments_count": 70, + "last_failed_payment": { + "amount": { + "currency_code": "currency_code6", + "value": "value0" + }, + "time": "time4", + "reason_code": "PAYER_CANNOT_PAY", + "next_payment_retry_time": "next_payment_retry_time6" + } +} +``` + diff --git a/doc/models/subscription-card-request.md b/doc/models/subscription-card-request.md new file mode 100644 index 0000000..bd44c46 --- /dev/null +++ b/doc/models/subscription-card-request.md @@ -0,0 +1,34 @@ + +# Subscription Card Request + +The payment card to use to fund a payment. Can be a credit or debit card. + +## Structure + +`SubscriptionCardRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `String` | Optional | The card holder's name as it appears on the card.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300`, *Pattern*: `^.{1,300}$` | +| `number` | `String` | Optional | The primary account number (PAN) for the payment card.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `19`, *Pattern*: `^[0-9]{13,19}$` | +| `expiry` | `String` | Optional | The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).

**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `7`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])$` | +| `security_code` | `String` | Optional | The three- or four-digit security code of the card. Also known as the CVV, CVC, CVN, CVE, or CID. This parameter cannot be present in the request when `payment_initiator=MERCHANT`.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `4`, *Pattern*: `^[0-9]{3,4}$` | +| `type` | [`CardType`](../../doc/models/card-type.md) | Optional | Type of card. i.e Credit, Debit and so on.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `brand` | [`SubscriptionsCardBrand`](../../doc/models/subscriptions-card-brand.md) | Optional | The card network or brand. Applies to credit, debit, gift, and payment cards.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `billing_address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | +| `attributes` | [`SubscriptionsCardAttributes`](../../doc/models/subscriptions-card-attributes.md) | Optional | Additional attributes associated with the use of this card. | + +## Example (as JSON) + +```json +{ + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "security_code": "security_code8", + "type": "UNKNOWN" +} +``` + diff --git a/doc/models/subscription-collection.md b/doc/models/subscription-collection.md new file mode 100644 index 0000000..a497e4a --- /dev/null +++ b/doc/models/subscription-collection.md @@ -0,0 +1,52 @@ + +# Subscription Collection + +The list of subscriptions. + +## Structure + +`SubscriptionCollection` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptions` | [`Array[Subscription]`](../../doc/models/subscription.md) | Optional | An array of subscriptions.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | + +## Example (as JSON) + +```json +{ + "subscriptions": [ + { + "id": "id6", + "plan_id": "plan_id8", + "start_time": "start_time0", + "quantity": "quantity2", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + } + }, + { + "id": "id6", + "plan_id": "plan_id8", + "start_time": "start_time0", + "quantity": "quantity2", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + } + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/subscription-customer-information.md b/doc/models/subscription-customer-information.md new file mode 100644 index 0000000..8388ac4 --- /dev/null +++ b/doc/models/subscription-customer-information.md @@ -0,0 +1,32 @@ + +# Subscription Customer Information + +The details about a customer in PayPal's system of record. + +## Structure + +`SubscriptionCustomerInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | +| `email_address` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | +| `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | + +## Example (as JSON) + +```json +{ + "id": "id2", + "email_address": "email_address0", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + } +} +``` + diff --git a/doc/models/subscription-error-exception.md b/doc/models/subscription-error-exception.md new file mode 100644 index 0000000..9c700a9 --- /dev/null +++ b/doc/models/subscription-error-exception.md @@ -0,0 +1,107 @@ + +# Subscription Error Exception + +The error details. + +## Structure + +`SubscriptionErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `String` | Required | The human-readable, unique name of the error. | +| `message` | `String` | Required | The message that describes the error. | +| `debug_id` | `String` | Required | The PayPal internal ID. Used for correlation purposes. | +| `information_link` | `String` | Optional | The information link, or URI, that shows detailed information about this error for the developer. | +| `details` | [`Array[ErrorDetails]`](../../doc/models/error-details.md) | Optional | An array of additional details about the error. | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links). | + +## Example (as JSON) + +```json +{ + "name": "name0", + "message": "message0", + "debug_id": "debug_id4", + "information_link": "information_link8", + "details": [ + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "description": "description0" + }, + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "description": "description0" + }, + { + "field": "field4", + "value": "value2", + "location": "location4", + "issue": "issue6", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "description": "description0" + } + ], + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/subscription-patch-application-context.md b/doc/models/subscription-patch-application-context.md new file mode 100644 index 0000000..89a0352 --- /dev/null +++ b/doc/models/subscription-patch-application-context.md @@ -0,0 +1,35 @@ + +# Subscription Patch Application Context + +The application context, which customizes the payer experience during the subscription approval process with PayPal. + +## Structure + +`SubscriptionPatchApplicationContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `brand_name` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `locale` | `String` | Optional | The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`.

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `ExperienceContextShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `payment_method` | [`PaymentMethod`](../../doc/models/payment-method.md) | Optional | The customer and merchant payment preferences. | +| `return_url` | `String` | Required | The URL where the customer is redirected after the customer approves the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | +| `cancel_url` | `String` | Required | The URL where the customer is redirected after the customer cancels the payment.

**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `4000` | + +## Example (as JSON) + +```json +{ + "shipping_preference": "GET_FROM_FILE", + "return_url": "return_url4", + "cancel_url": "cancel_url8", + "brand_name": "brand_name4", + "locale": "locale8", + "payment_method": { + "payee_preferred": "UNRESTRICTED" + } +} +``` + diff --git a/doc/models/subscription-payer-name.md b/doc/models/subscription-payer-name.md new file mode 100644 index 0000000..3278bc6 --- /dev/null +++ b/doc/models/subscription-payer-name.md @@ -0,0 +1,32 @@ + +# Subscription Payer Name + +The name of the party. + +## Structure + +`SubscriptionPayerName` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `prefix` | `String` | Optional | The prefix, or title, to the party's name.

**Constraints**: *Maximum Length*: `140` | +| `given_name` | `String` | Optional | When the party is a person, the party's given, or first, name.

**Constraints**: *Maximum Length*: `140` | +| `surname` | `String` | Optional | When the party is a person, the party's surname or family name. Also known as the last name. Required when the party is a person. Use also to store multiple surnames including the matronymic, or mother's, surname.

**Constraints**: *Maximum Length*: `140` | +| `middle_name` | `String` | Optional | When the party is a person, the party's middle name. Use also to store multiple middle names including the patronymic, or father's, middle name.

**Constraints**: *Maximum Length*: `140` | +| `suffix` | `String` | Optional | The suffix for the party's name.

**Constraints**: *Maximum Length*: `140` | +| `full_name` | `String` | Optional | When the party is a person, the party's full name.

**Constraints**: *Maximum Length*: `300` | + +## Example (as JSON) + +```json +{ + "prefix": "prefix4", + "given_name": "given_name8", + "surname": "surname2", + "middle_name": "middle_name4", + "suffix": "suffix4" +} +``` + diff --git a/doc/models/subscription-payment-source-response.md b/doc/models/subscription-payment-source-response.md new file mode 100644 index 0000000..6c72045 --- /dev/null +++ b/doc/models/subscription-payment-source-response.md @@ -0,0 +1,35 @@ + +# Subscription Payment Source Response + +The payment source used to fund the payment. + +## Structure + +`SubscriptionPaymentSourceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `card` | [`CardResponseWithBillingAddress`](../../doc/models/card-response-with-billing-address.md) | Optional | The payment card used to fund the payment. Card can be a credit or debit card. | + +## Example (as JSON) + +```json +{ + "card": { + "name": "name6", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + }, + "expiry": "expiry4", + "currency_code": "currency_code2" + } +} +``` + diff --git a/doc/models/subscription-payment-source.md b/doc/models/subscription-payment-source.md new file mode 100644 index 0000000..7a8781c --- /dev/null +++ b/doc/models/subscription-payment-source.md @@ -0,0 +1,29 @@ + +# Subscription Payment Source + +The payment source definition. To be eligible to create subscription using debit or credit card, you will need to sign up here (https://www.paypal.com/bizsignup/entry/product/ppcp). Please note, its available only for non-3DS cards and for merchants in US and AU regions. + +## Structure + +`SubscriptionPaymentSource` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `card` | [`SubscriptionCardRequest`](../../doc/models/subscription-card-request.md) | Optional | The payment card to use to fund a payment. Can be a credit or debit card. | + +## Example (as JSON) + +```json +{ + "card": { + "name": "name6", + "number": "number6", + "expiry": "expiry4", + "security_code": "security_code8", + "type": "UNKNOWN" + } +} +``` + diff --git a/doc/models/subscription-plan-status.md b/doc/models/subscription-plan-status.md new file mode 100644 index 0000000..2f4e757 --- /dev/null +++ b/doc/models/subscription-plan-status.md @@ -0,0 +1,17 @@ + +# Subscription Plan Status + +The plan status. + +## Enumeration + +`SubscriptionPlanStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `CREATED` | The plan was created. You cannot create subscriptions for a plan in this state. | +| `INACTIVE` | The plan is inactive. | +| `ACTIVE` | The plan is active. You can only create subscriptions for a plan in this state. | + diff --git a/doc/models/subscription-pricing-model.md b/doc/models/subscription-pricing-model.md new file mode 100644 index 0000000..a76c322 --- /dev/null +++ b/doc/models/subscription-pricing-model.md @@ -0,0 +1,16 @@ + +# Subscription Pricing Model + +The pricing model for tiered plan. The `tiers` parameter is required. + +## Enumeration + +`SubscriptionPricingModel` + +## Fields + +| Name | Description | +| --- | --- | +| `VOLUME` | A volume pricing model. | +| `TIERED` | A tiered pricing model. | + diff --git a/doc/models/subscription-pricing-scheme.md b/doc/models/subscription-pricing-scheme.md new file mode 100644 index 0000000..69c043a --- /dev/null +++ b/doc/models/subscription-pricing-scheme.md @@ -0,0 +1,60 @@ + +# Subscription Pricing Scheme + +The pricing scheme details. + +## Structure + +`SubscriptionPricingScheme` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `Integer` | Optional | The version of the pricing scheme.

**Constraints**: `>= 0`, `<= 999` | +| `fixed_price` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `pricing_model` | [`SubscriptionPricingModel`](../../doc/models/subscription-pricing-model.md) | Optional | The pricing model for tiered plan. The `tiers` parameter is required.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `tiers` | [`Array[PricingTier]`](../../doc/models/pricing-tier.md) | Optional | An array of pricing tiers which are used for billing volume/tiered plans. pricing_model field has to be specified.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `32` | +| `create_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `update_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | + +## Example (as JSON) + +```json +{ + "version": 172, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time2" +} +``` + diff --git a/doc/models/subscription-transaction-details.md b/doc/models/subscription-transaction-details.md new file mode 100644 index 0000000..47f9038 --- /dev/null +++ b/doc/models/subscription-transaction-details.md @@ -0,0 +1,64 @@ + +# Subscription Transaction Details + +The transaction details. + +## Structure + +`SubscriptionTransactionDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `status` | [`CaptureStatus`](../../doc/models/capture-status.md) | Optional | The status of the captured payment. | +| `id` | `String` | Required | The PayPal-generated transaction ID.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `50` | +| `amount_with_breakdown` | [`SubscriptionAmountWithBreakdown`](../../doc/models/subscription-amount-with-breakdown.md) | Required | The breakdown details for the amount. Includes the gross, tax, fee, and shipping amounts. | +| `payer_name` | [`SubscriptionPayerName`](../../doc/models/subscription-payer-name.md) | Optional | The name of the party. | +| `payer_email` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``^(?:[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\|\[(?:(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?\|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$`` | +| `time` | `String` | Required | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | + +## Example (as JSON) + +```json +{ + "status": "REFUNDED", + "id": "id4", + "amount_with_breakdown": { + "gross_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "total_item_amount": { + "currency_code": "currency_code8", + "value": "value4" + }, + "fee_amount": { + "currency_code": "currency_code2", + "value": "value4" + }, + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "tax_amount": { + "currency_code": "currency_code2", + "value": "value8" + }, + "net_amount": { + "currency_code": "currency_code6", + "value": "value2" + } + }, + "payer_name": { + "prefix": "prefix8", + "given_name": "given_name2", + "surname": "surname8", + "middle_name": "middle_name0", + "suffix": "suffix0" + }, + "payer_email": "payer_email2", + "time": "time4" +} +``` + diff --git a/doc/models/subscription.md b/doc/models/subscription.md new file mode 100644 index 0000000..40af096 --- /dev/null +++ b/doc/models/subscription.md @@ -0,0 +1,42 @@ + +# Subscription + +The subscription details. + +## Structure + +`Subscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Optional | The PayPal-generated ID for the subscription.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `50` | +| `plan_id` | `String` | Optional | The ID of the plan.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `50` | +| `start_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `quantity` | `String` | Optional | The quantity of the product in the subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32`, *Pattern*: `^([0-9]+\|([0-9]+)?[.][0-9]+)$` | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `subscriber` | [`Subscriber`](../../doc/models/subscriber.md) | Optional | The subscriber response information. | +| `billing_info` | [`SubscriptionBillingInformation`](../../doc/models/subscription-billing-information.md) | Optional | The billing details for the subscription. If the subscription was or is active, these fields are populated. | +| `create_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `update_time` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `custom_id` | `String` | Optional | The custom id for the subscription. Can be invoice id.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[\x20-\x7E]+` | +| `plan_overridden` | `TrueClass \| FalseClass` | Optional | Indicates whether the subscription has overridden any plan attributes. | +| `plan` | [`PlanDetails`](../../doc/models/plan-details.md) | Optional | The plan details. | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). | + +## Example (as JSON) + +```json +{ + "id": "id4", + "plan_id": "plan_id6", + "start_time": "start_time8", + "quantity": "quantity0", + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + } +} +``` + diff --git a/doc/models/subscriptions-card-attributes.md b/doc/models/subscriptions-card-attributes.md new file mode 100644 index 0000000..078ac81 --- /dev/null +++ b/doc/models/subscriptions-card-attributes.md @@ -0,0 +1,41 @@ + +# Subscriptions Card Attributes + +Additional attributes associated with the use of this card. + +## Structure + +`SubscriptionsCardAttributes` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customer` | [`CardCustomer`](../../doc/models/card-customer.md) | Optional | The details about a customer in PayPal's system of record. | +| `vault` | [`VaultInstructionBase`](../../doc/models/vault-instruction-base.md) | Optional | Basic vault instruction specification that can be extended by specific payment sources that supports vaulting. | +| `verification` | [`CardVerification`](../../doc/models/card-verification.md) | Optional | The API caller can opt in to verify the card through PayPal offered verification services (e.g. Smart Dollar Auth, 3DS). | + +## Example (as JSON) + +```json +{ + "customer": { + "id": "id0", + "email_address": "email_address2", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "merchant_customer_id": "merchant_customer_id2" + }, + "vault": { + "store_in_vault": "ON_SUCCESS" + }, + "verification": { + "method": "3D_SECURE" + } +} +``` + diff --git a/doc/models/subscriptions-card-brand.md b/doc/models/subscriptions-card-brand.md new file mode 100644 index 0000000..2289cd9 --- /dev/null +++ b/doc/models/subscriptions-card-brand.md @@ -0,0 +1,39 @@ + +# Subscriptions Card Brand + +The card network or brand. Applies to credit, debit, gift, and payment cards. + +## Enumeration + +`SubscriptionsCardBrand` + +## Fields + +| Name | Description | +| --- | --- | +| `VISA` | Visa card. | +| `MASTERCARD` | Mastercard card. | +| `DISCOVER` | Discover card. | +| `AMEX` | American Express card. | +| `SOLO` | Solo debit card. | +| `JCB` | Japan Credit Bureau card. | +| `STAR` | Military Star card. | +| `DELTA` | Delta Airlines card. | +| `SWITCH` | Switch credit card. | +| `MAESTRO` | Maestro credit card. | +| `CB_NATIONALE` | Carte Bancaire (CB) credit card. | +| `CONFIGOGA` | Configoga credit card. | +| `CONFIDIS` | Confidis credit card. | +| `ELECTRON` | Visa Electron credit card. | +| `CETELEM` | Cetelem credit card. | +| `CHINA_UNION_PAY` | China union pay credit card. | +| `DINERS` | The Diners Club International banking and payment services capability network owned by Discover Financial Services (DFS), one of the most recognized brands in US financial services. | +| `ELO` | The Brazilian Elo card payment network. | +| `HIPER` | The Hiper - Ingenico ePayment network. | +| `HIPERCARD` | The Brazilian Hipercard payment network that's widely accepted in the retail market. | +| `RUPAY` | The RuPay payment network. | +| `GE` | The GE Credit Union 3Point card payment network. | +| `SYNCHRONY` | The Synchrony Financial (SYF) payment network. | +| `EFTPOS` | The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment network. | +| `UNKNOWN` | UNKNOWN payment network. | + diff --git a/doc/models/supplementary-purchase-data.md b/doc/models/supplementary-purchase-data.md deleted file mode 100644 index 5647a7a..0000000 --- a/doc/models/supplementary-purchase-data.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Supplementary Purchase Data - -The capture identification-related fields. Includes the invoice ID, custom ID, note to payer, and soft descriptor. - -## Structure - -`SupplementaryPurchaseData` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice_id` | `String` | Optional | The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.{1,127}$` | -| `note_to_payer` | `String` | Optional | An informational note about this settlement. Appears in both the payer's transaction history and the emails that the payer receives.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^.{1,255}$` | - -## Example (as JSON) - -```json -{ - "invoice_id": "invoice_id8", - "note_to_payer": "note_to_payer0" -} -``` - diff --git a/doc/models/suspend-subscription.md b/doc/models/suspend-subscription.md new file mode 100644 index 0000000..eedf865 --- /dev/null +++ b/doc/models/suspend-subscription.md @@ -0,0 +1,23 @@ + +# Suspend Subscription + +The suspend subscription request details. + +## Structure + +`SuspendSubscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `reason` | `String` | Required | The reason for suspension of the Subscription.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128`, *Pattern*: `^.*$` | + +## Example (as JSON) + +```json +{ + "reason": "reason4" +} +``` + diff --git a/doc/models/tax-amount.md b/doc/models/tax-amount.md new file mode 100644 index 0000000..d6a7f82 --- /dev/null +++ b/doc/models/tax-amount.md @@ -0,0 +1,26 @@ + +# Tax Amount + +The tax levied by a government on the purchase of goods or services. + +## Structure + +`TaxAmount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `tax_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | + +## Example (as JSON) + +```json +{ + "tax_amount": { + "currency_code": "currency_code2", + "value": "value8" + } +} +``` + diff --git a/doc/models/taxes-override.md b/doc/models/taxes-override.md new file mode 100644 index 0000000..fb97cbc --- /dev/null +++ b/doc/models/taxes-override.md @@ -0,0 +1,25 @@ + +# Taxes Override + +The tax details. + +## Structure + +`TaxesOverride` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `percentage` | `String` | Optional | The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.

**Constraints**: *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | +| `inclusive` | `TrueClass \| FalseClass` | Optional | Indicates whether the tax was already included in the billing amount. | + +## Example (as JSON) + +```json +{ + "percentage": "percentage8", + "inclusive": false +} +``` + diff --git a/doc/models/taxes.md b/doc/models/taxes.md new file mode 100644 index 0000000..7300659 --- /dev/null +++ b/doc/models/taxes.md @@ -0,0 +1,25 @@ + +# Taxes + +The tax details. + +## Structure + +`Taxes` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `percentage` | `String` | Required | The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.

**Constraints**: *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | +| `inclusive` | `TrueClass \| FalseClass` | Optional | Indicates whether the tax was already included in the billing amount.

**Default**: `true` | + +## Example (as JSON) + +```json +{ + "percentage": "percentage6", + "inclusive": true +} +``` + diff --git a/doc/models/tenure-type.md b/doc/models/tenure-type.md index 7d57a94..4da9e8a 100644 --- a/doc/models/tenure-type.md +++ b/doc/models/tenure-type.md @@ -1,7 +1,7 @@ # Tenure Type -The tenure type of the billing cycle identifies if the billing cycle is a trial(free or discounted) or regular billing cycle. +The tenure type of the billing cycle identifies if the billing cycle is a trial(free or discounted) or regular billing cycle., The tenure type of the billing cycle. In case of a plan having trial cycle, only 2 trial cycles are allowed per plan., The type of the billing cycle. ## Enumeration diff --git a/doc/models/transaction-details.md b/doc/models/transaction-details.md new file mode 100644 index 0000000..484e1ad --- /dev/null +++ b/doc/models/transaction-details.md @@ -0,0 +1,90 @@ + +# Transaction Details + +The transaction details. + +## Structure + +`TransactionDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `transaction_info` | [`TransactionInformation`](../../doc/models/transaction-information.md) | Optional | The transaction information. | +| `payer_info` | [`PayerInformation`](../../doc/models/payer-information.md) | Optional | The payer information. | +| `shipping_info` | [`ShippingInformation`](../../doc/models/shipping-information.md) | Optional | The shipping information. | +| `cart_info` | [`CartInformation`](../../doc/models/cart-information.md) | Optional | The cart information. | +| `store_info` | [`StoreInformation`](../../doc/models/store-information.md) | Optional | The store information. | +| `auction_info` | [`AuctionInformation`](../../doc/models/auction-information.md) | Optional | The auction information. | +| `incentive_info` | [`IncentiveInformation`](../../doc/models/incentive-information.md) | Optional | The incentive details. | + +## Example (as JSON) + +```json +{ + "transaction_info": { + "paypal_account_id": "paypal_account_id4", + "transaction_id": "transaction_id0", + "paypal_reference_id": "paypal_reference_id2", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code6" + }, + "payer_info": { + "account_id": "account_id2", + "email_address": "email_address2", + "phone_number": { + "country_code": "country_code2", + "national_number": "national_number6", + "extension_number": "extension_number8" + }, + "address_status": "address_status2", + "payer_status": "payer_status2" + }, + "shipping_info": { + "name": "name0", + "method": "method4", + "address": { + "line1": "line18", + "line2": "line20", + "city": "city6", + "state": "state2", + "country_code": "country_code6", + "postal_code": "postal_code8" + }, + "secondary_shipping_address": { + "line1": "line16", + "line2": "line28", + "city": "city4", + "state": "state0", + "country_code": "country_code4", + "postal_code": "postal_code6" + } + }, + "cart_info": { + "item_details": [ + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + }, + { + "item_code": "item_code0", + "item_name": "item_name8", + "item_description": "item_description4", + "item_options": "item_options2", + "item_quantity": "item_quantity2" + } + ], + "tax_inclusive": false, + "paypal_invoice_id": "paypal_invoice_id6" + }, + "store_info": { + "store_id": "store_id2", + "terminal_id": "terminal_id6" + } +} +``` + diff --git a/doc/models/transaction-information.md b/doc/models/transaction-information.md new file mode 100644 index 0000000..e448082 --- /dev/null +++ b/doc/models/transaction-information.md @@ -0,0 +1,60 @@ + +# Transaction Information + +The transaction information. + +## Structure + +`TransactionInformation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paypal_account_id` | `String` | Optional | The ID of the PayPal account of the counterparty.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `transaction_id` | `String` | Optional | The PayPal-generated transaction ID.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `paypal_reference_id` | `String` | Optional | The PayPal-generated base ID. PayPal exclusive. Cannot be altered. Defined as a related, pre-existing transaction or event.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `paypal_reference_id_type` | [`PaypalReferenceIdType`](../../doc/models/paypal-reference-id-type.md) | Optional | The PayPal reference ID type.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `transaction_event_code` | `String` | Optional | A five-digit transaction event code that classifies the transaction type based on money movement and debit or credit. For example, T0001. See [Transaction event codes](/docs/integration/direct/transaction-search/transaction-event-codes/).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `5`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `transaction_initiation_date` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `transaction_updated_date` | `String` | Optional | The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `64`, *Pattern*: `^[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|[1-2][0-9]\|3[0-1])[T,t]([0-1][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)([.][0-9]+)?([Zz]\|[+-][0-9]{2}:[0-9]{2})$` | +| `transaction_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `fee_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `discount_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `insurance_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `sales_tax_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_discount_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `shipping_tax_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `other_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `tip_amount` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `transaction_status` | `String` | Optional | A code that indicates the transaction status. Value is: Status code Description D PayPal or merchant rules denied the transaction. P The transaction is pending. The transaction was created but waits for another payment process to complete, such as an ACH transaction, before the status changes to S. S The transaction successfully completed without a denial and after any pending statuses. V A successful transaction was fully reversed and funds were refunded to the original sender.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `transaction_subject` | `String` | Optional | The subject of payment. The payer passes this value to the payee. The payer controls this data through the interface through which he or she sends the data.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `256`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `transaction_note` | `String` | Optional | A special note that the payer passes to the payee. Might contain special customer requests, such as shipping instructions.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `payment_tracking_id` | `String` | Optional | The payment tracking ID, which is a unique ID that partners specify to either get information about a payment or request a refund.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `bank_reference_id` | `String` | Optional | The bank reference ID. The bank provides this value for an ACH transaction.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `ending_balance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `available_balance` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `invoice_id` | `String` | Optional | The invoice ID that is sent by the merchant with the transaction. Note: If an invoice ID was sent with the capture request, the value is reported. Otherwise, the invoice ID of the authorizing transaction is reported.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `custom_field` | `String` | Optional | The merchant-provided custom text. Note: Usually, this field includes the unique ID for payments made with MassPay type transaction.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^[a-zA-Z0-9_'\-., ":;\!?]*$` | +| `protection_eligibility` | `String` | Optional | Indicates whether the transaction is eligible for protection. Value is: 01. Eligible. 02. Not eligible 03. Partially eligible.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2`, *Pattern*: `^[a-zA-Z0-9]*$` | +| `credit_term` | `String` | Optional | The credit term. The time span covered by the installment payments as expressed in the term length plus the length time unit code.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `25`, *Pattern*: `^[a-zA-Z0-9.]*$` | +| `credit_transactional_fee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `credit_promotional_fee` | [`Money`](../../doc/models/money.md) | Optional | The currency and amount for a financial transaction, such as a balance or payment due. | +| `annual_percentage_rate` | `String` | Optional | The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.

**Constraints**: *Pattern*: `^((-?[0-9]+)\|(-?([0-9]+)?[.][0-9]+))$` | +| `payment_method_type` | `String` | Optional | The payment method that was used for a transaction. Value is PUI, installment, or mEFT. Note: Appears only for pay upon invoice (PUI), installment, and mEFT transactions. Merchants and partners in the EMEA region can use this attribute to note transactions that attract turn-over tax.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `20`, *Pattern*: `^[a-zA-Z0-9-]*$` | +| `instrument_type` | `String` | Optional | A high-level classification of the type of financial instrument that was used to fund a payment. The pattern is not provided because the value is defined by an external party. E.g. PAYPAL, CREDIT_CARD, DEBIT_CARD, APPLE_PAY, BANK , VENMO ,Pay Upon Invoice, Pay Later or Alternative Payment Methods (APM).

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | +| `instrument_sub_type` | `String` | Optional | A finer-grained classification of the financial instrument that was used to fund a payment. For example, `Visa card` or a `Mastercard` for a credit card, BANKCARD ,DISCOVER etc. The pattern is not provided because the value is defined by an external party.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | + +## Example (as JSON) + +```json +{ + "paypal_account_id": "paypal_account_id6", + "transaction_id": "transaction_id2", + "paypal_reference_id": "paypal_reference_id4", + "paypal_reference_id_type": "ODR", + "transaction_event_code": "transaction_event_code8" +} +``` + diff --git a/doc/models/transaction-search-error-details.md b/doc/models/transaction-search-error-details.md new file mode 100644 index 0000000..7cf9707 --- /dev/null +++ b/doc/models/transaction-search-error-details.md @@ -0,0 +1,31 @@ + +# Transaction Search Error Details + +The error details. Required for client-side `4XX` errors. + +## Structure + +`TransactionSearchErrorDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `field` | `String` | Optional | The field that caused the error. If this field is in the body, set this value to the field's JSON pointer value. Required for client-side errors. | +| `value` | `String` | Optional | The value of the field that caused the error. | +| `location` | `String` | Optional | The location of the field that caused the error. Value is `body`, `path`, or `query`.

**Default**: `'body'` | +| `issue` | `String` | Required | The unique, fine-grained application-level error code. | +| `description` | `String` | Optional | The human-readable description for an issue. The description can change over the lifetime of an API, so clients must not depend on this value. | + +## Example (as JSON) + +```json +{ + "location": "body", + "issue": "issue2", + "field": "field0", + "value": "value8", + "description": "description6" +} +``` + diff --git a/doc/models/transactions-list.md b/doc/models/transactions-list.md new file mode 100644 index 0000000..1ac46b3 --- /dev/null +++ b/doc/models/transactions-list.md @@ -0,0 +1,80 @@ + +# Transactions List + +The list transactions for a subscription request details. + +## Structure + +`TransactionsList` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `transactions` | [`Array[SubscriptionTransactionDetails]`](../../doc/models/subscription-transaction-details.md) | Optional | An array of transactions.

**Constraints**: *Minimum Items*: `0`, *Maximum Items*: `32767` | +| `total_items` | `Integer` | Optional | The total number of items.

**Constraints**: `>= 0`, `<= 500000000` | +| `total_pages` | `Integer` | Optional | The total number of pages.

**Constraints**: `>= 0`, `<= 100000000` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | + +## Example (as JSON) + +```json +{ + "transactions": [ + { + "status": "PARTIALLY_REFUNDED", + "id": "id8", + "amount_with_breakdown": { + "gross_amount": { + "currency_code": "currency_code4", + "value": "value0" + }, + "total_item_amount": { + "currency_code": "currency_code8", + "value": "value4" + }, + "fee_amount": { + "currency_code": "currency_code2", + "value": "value4" + }, + "shipping_amount": { + "currency_code": "currency_code0", + "value": "value6" + }, + "tax_amount": { + "currency_code": "currency_code2", + "value": "value8" + }, + "net_amount": { + "currency_code": "currency_code6", + "value": "value2" + } + }, + "payer_name": { + "prefix": "prefix8", + "given_name": "given_name2", + "surname": "surname8", + "middle_name": "middle_name0", + "suffix": "suffix0" + }, + "payer_email": "payer_email6", + "time": "time8" + } + ], + "total_items": 254, + "total_pages": 34, + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ] +} +``` + diff --git a/doc/models/update-pricing-scheme.md b/doc/models/update-pricing-scheme.md new file mode 100644 index 0000000..9298ec6 --- /dev/null +++ b/doc/models/update-pricing-scheme.md @@ -0,0 +1,59 @@ + +# Update Pricing Scheme + +The update pricing scheme request details. + +## Structure + +`UpdatePricingScheme` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `billing_cycle_sequence` | `Integer` | Required | The billing cycle sequence.

**Constraints**: `>= 1`, `<= 99` | +| `pricing_scheme` | [`SubscriptionPricingScheme`](../../doc/models/subscription-pricing-scheme.md) | Required | The pricing scheme details. | + +## Example (as JSON) + +```json +{ + "billing_cycle_sequence": 99, + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + } +} +``` + diff --git a/doc/models/update-pricing-schemes-request.md b/doc/models/update-pricing-schemes-request.md new file mode 100644 index 0000000..fa22541 --- /dev/null +++ b/doc/models/update-pricing-schemes-request.md @@ -0,0 +1,62 @@ + +# Update Pricing Schemes Request + +The update pricing scheme request details. + +## Structure + +`UpdatePricingSchemesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `pricing_schemes` | [`Array[UpdatePricingScheme]`](../../doc/models/update-pricing-scheme.md) | Required | An array of pricing schemes.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `99` | + +## Example (as JSON) + +```json +{ + "pricing_schemes": [ + { + "billing_cycle_sequence": 34, + "pricing_scheme": { + "version": 10, + "fixed_price": { + "currency_code": "currency_code4", + "value": "value0" + }, + "pricing_model": "VOLUME", + "tiers": [ + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + }, + { + "starting_quantity": "starting_quantity8", + "ending_quantity": "ending_quantity6", + "amount": { + "currency_code": "currency_code6", + "value": "value0" + } + } + ], + "create_time": "create_time4" + } + } + ] +} +``` + diff --git a/doc/models/vault-apple-pay-request.md b/doc/models/vault-apple-pay-request.md new file mode 100644 index 0000000..9547d08 --- /dev/null +++ b/doc/models/vault-apple-pay-request.md @@ -0,0 +1,36 @@ + +# Vault Apple Pay Request + +A resource representing a request to vault Apple Pay. + +## Structure + +`VaultApplePayRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `token` | `String` | Optional | Encrypted Apple Pay token, containing card information. This token would be base64 encoded.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000`, *Pattern*: `^.*$` | +| `card` | [`ApplePayRequestCard`](../../doc/models/apple-pay-request-card.md) | Optional | The payment card to be used to fund a payment. Can be a credit or debit card. | + +## Example (as JSON) + +```json +{ + "token": "token4", + "card": { + "type": "UNKNOWN", + "brand": "CB_NATIONALE", + "billing_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_28", + "admin_area_2": "admin_area_28", + "admin_area_1": "admin_area_14", + "postal_code": "postal_code0", + "country_code": "country_code8" + } + } +} +``` + diff --git a/doc/models/setup-token-card-experience-context.md b/doc/models/vault-card-experience-context.md similarity index 66% rename from doc/models/setup-token-card-experience-context.md rename to doc/models/vault-card-experience-context.md index 7ac10fb..6a016e3 100644 --- a/doc/models/setup-token-card-experience-context.md +++ b/doc/models/vault-card-experience-context.md @@ -1,31 +1,33 @@ -# Setup Token Card Experience Context +# Vault Card Experience Context -Customizes the Vault creation flow experience for your customers. +A resource representing an experience context of vault a card. ## Structure -`SetupTokenCardExperienceContext` +`VaultCardExperienceContext` ## Fields | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `brand_name` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300`, *Pattern*: `^.*$` | +| `brand_name` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | | `locale` | `String` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | | `return_url` | `String` | Optional | The URL where the customer is redirected after customer approves leaves the flow. It is a required field for contingency flows like PayPal wallet, 3DS.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000` | | `cancel_url` | `String` | Optional | The URL where the customer is redirected after customer cancels or leaves the flow. It is a required field for contingency flows like PayPal wallet, 3DS.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000` | -| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | Vault Instruction on action to be performed after a successful payer approval.

**Default**: `VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | DEPRECATED. Vault Instruction on action to be performed after a successful payer approval.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `user_action` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `VaultUserAction::CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | ## Example (as JSON) ```json { - "vault_instruction": "ON_CREATE_PAYMENT_TOKENS", - "brand_name": "brand_name2", - "locale": "locale6", + "user_action": "CONTINUE", + "brand_name": "brand_name4", + "locale": "locale8", "return_url": "return_url4", - "cancel_url": "cancel_url6" + "cancel_url": "cancel_url8", + "vault_instruction": "ON_CREATE_PAYMENT_TOKENS" } ``` diff --git a/doc/models/vault-experience-context.md b/doc/models/vault-experience-context.md index 3dd312f..efb0243 100644 --- a/doc/models/vault-experience-context.md +++ b/doc/models/vault-experience-context.md @@ -11,19 +11,21 @@ Customizes the Vault creation flow experience for your customers. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `brand_name` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300`, *Pattern*: `^.*$` | +| `brand_name` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | | `locale` | `String` | Optional | The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).

**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10`, *Pattern*: `^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}\|[0-9]{3}))?$` | | `return_url` | `String` | Optional | The URL where the customer is redirected after customer approves leaves the flow. It is a required field for contingency flows like PayPal wallet, 3DS.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000` | | `cancel_url` | `String` | Optional | The URL where the customer is redirected after customer cancels or leaves the flow. It is a required field for contingency flows like PayPal wallet, 3DS.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4000` | -| `shipping_preference` | [`OrderApplicationContextShippingPreference`](../../doc/models/order-application-context-shipping-preference.md) | Optional | The shipping preference. This only applies to PayPal payment source.

**Default**: `OrderApplicationContextShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | Vault Instruction on action to be performed after a successful payer approval.

**Default**: `VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The shipping preference. This only applies to PayPal payment source.

**Default**: `ExperienceContextShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | +| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | DEPRECATED. Vault Instruction on action to be performed after a successful payer approval.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `app_switch_context` | [`AppSwitchContext`](../../doc/models/app-switch-context.md) | Optional | Merchant provided details of the native app or mobile web browser to facilitate buyer's app switch to the PayPal consumer app. | +| `user_action` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `VaultUserAction::CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | ## Example (as JSON) ```json { "shipping_preference": "GET_FROM_FILE", - "vault_instruction": "ON_CREATE_PAYMENT_TOKENS", + "user_action": "CONTINUE", "brand_name": "brand_name0", "locale": "locale4", "return_url": "return_url2", diff --git a/doc/models/vault-paypal-wallet-request.md b/doc/models/vault-paypal-wallet-request.md index 5a949ae..e50e949 100644 --- a/doc/models/vault-paypal-wallet-request.md +++ b/doc/models/vault-paypal-wallet-request.md @@ -18,7 +18,7 @@ A resource representing a request to vault PayPal Wallet. | `usage_type` | [`PaypalPaymentTokenUsageType`](../../doc/models/paypal-payment-token-usage-type.md) | Optional | The usage type associated with a digital wallet payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `billing_plan` | [`Plan`](../../doc/models/plan.md) | Optional | The merchant level Recurring Billing plan metadata for the Billing Agreement. | -| `experience_context` | [`VaultExperienceContext`](../../doc/models/vault-experience-context.md) | Optional | Customizes the Vault creation flow experience for your customers. | +| `experience_context` | [`VaultExperienceContext`](../../doc/models/vault-experience-context.md) | Optional | A resource representing an experience context of vault PayPal Wallet. | ## Example (as JSON) @@ -31,6 +31,7 @@ A resource representing a request to vault PayPal Wallet. "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/vault-response-customer.md b/doc/models/vault-response-customer.md index 5ce7800..286900f 100644 --- a/doc/models/vault-response-customer.md +++ b/doc/models/vault-response-customer.md @@ -13,7 +13,7 @@ This object defines a customer in your system. Use it to manage customer profile | --- | --- | --- | --- | | `id` | `String` | Optional | The unique ID for a customer generated by PayPal.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `22`, *Pattern*: `^[0-9a-zA-Z_-]+$` | | `merchant_customer_id` | `String` | Optional | Merchants and partners may already have a data-store where their customer information is persisted. Use merchant_customer_id to associate the PayPal-generated customer.id to your representation of a customer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64`, *Pattern*: `^[0-9a-zA-Z-_.^*$@#]+$` | -| `links` | `Array` | Optional | DEPRECATED. This field is DEPRECATED.

**Constraints**: *Maximum Items*: `16` | +| `links` | `Array[Object]` | Optional | DEPRECATED. This field is DEPRECATED.

**Constraints**: *Maximum Items*: `16` | ## Example (as JSON) diff --git a/doc/models/vault-response.md b/doc/models/vault-response.md index 9933d91..da8a3bf 100644 --- a/doc/models/vault-response.md +++ b/doc/models/vault-response.md @@ -14,7 +14,7 @@ The details about a saved payment source. | `id` | `String` | Optional | The PayPal-generated ID for the saved payment source.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | | `status` | [`VaultStatus`](../../doc/models/vault-status.md) | Optional | The vault status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `customer` | [`VaultCustomer`](../../doc/models/vault-customer.md) | Optional | This object represents a merchant’s customer, allowing them to store contact details, and track all payments associated with the same customer. | -| `links` | [`Array`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | ## Example (as JSON) diff --git a/doc/models/vault-user-action.md b/doc/models/vault-user-action.md new file mode 100644 index 0000000..a7d5044 --- /dev/null +++ b/doc/models/vault-user-action.md @@ -0,0 +1,16 @@ + +# Vault User Action + +User Action on action to be performed after a successful payer approval. + +## Enumeration + +`VaultUserAction` + +## Fields + +| Name | Description | +| --- | --- | +| `SETUP_NOW` | After you redirect the customer to the PayPal payment page, a Setup Now button appears. Use this option when no additional inputs are needed from merchant site and to create the billing agreement immediately when the customer clicks Setup Now. | +| `CONTINUE` | After you redirect the customer to the PayPal payment page, a Continue button appears. Use this option when you want to redirect the customer from the completed payment page to the merchant site for additional inputs without immediately creating the billing agreement. | + diff --git a/doc/models/vault-venmo-experience-context.md b/doc/models/vault-venmo-experience-context.md deleted file mode 100644 index 163f8a0..0000000 --- a/doc/models/vault-venmo-experience-context.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Vault Venmo Experience Context - -Customizes the Vault creation flow experience for your customers. - -## Structure - -`VaultVenmoExperienceContext` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `brand_name` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `300`, *Pattern*: `^.*$` | -| `shipping_preference` | [`OrderApplicationContextShippingPreference`](../../doc/models/order-application-context-shipping-preference.md) | Optional | The shipping preference. This only applies to PayPal payment source.

**Default**: `OrderApplicationContextShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | Vault Instruction on action to be performed after a successful payer approval.

**Default**: `VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | - -## Example (as JSON) - -```json -{ - "shipping_preference": "GET_FROM_FILE", - "vault_instruction": "ON_CREATE_PAYMENT_TOKENS", - "brand_name": "brand_name0" -} -``` - diff --git a/doc/models/vault-venmo-request.md b/doc/models/vault-venmo-request.md index 6d3ad90..3b351b3 100644 --- a/doc/models/vault-venmo-request.md +++ b/doc/models/vault-venmo-request.md @@ -1,6 +1,8 @@ # Vault Venmo Request +A resource representing a request to vault Venmo. + ## Structure `VaultVenmoRequest` @@ -15,7 +17,7 @@ | `permit_multiple_payment_tokens` | `TrueClass \| FalseClass` | Optional | Create multiple payment tokens for the same payer, merchant/platform combination. Use this when the customer has not logged in at merchant/platform. The payment token thus generated, can then also be used to create the customer account at merchant/platform. Use this also when multiple payment tokens are required for the same payer, different customer at merchant/platform. This helps to identify customers distinctly even though they may share the same PayPal account. This only applies to PayPal payment source.

**Default**: `false` | | `usage_type` | [`PaypalPaymentTokenUsageType`](../../doc/models/paypal-payment-token-usage-type.md) | Optional | The usage type associated with a digital wallet payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `experience_context` | [`VaultVenmoExperienceContext`](../../doc/models/vault-venmo-experience-context.md) | Optional | Customizes the Vault creation flow experience for your customers. | +| `experience_context` | [`VenmoExperienceContext`](../../doc/models/venmo-experience-context.md) | Optional | A resource representing an experience context of vault a venmo account. | ## Example (as JSON) @@ -28,6 +30,7 @@ "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/vaulted-digital-wallet-shipping-details.md b/doc/models/vaulted-digital-wallet-shipping-details.md index 3de4c13..fc1b188 100644 --- a/doc/models/vaulted-digital-wallet-shipping-details.md +++ b/doc/models/vaulted-digital-wallet-shipping-details.md @@ -12,6 +12,7 @@ The shipping details. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `name` | [`ShippingName`](../../doc/models/shipping-name.md) | Optional | The name of the party. | +| `email_address` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``^(?:[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\|\[(?:(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]\|2[0-4][0-9]\|[01]?[0-9][0-9]?\|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$`` | | `phone_number` | [`PhoneNumberWithCountryCode`](../../doc/models/phone-number-with-country-code.md) | Optional | The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | | `type` | [`FulfillmentType`](../../doc/models/fulfillment-type.md) | Optional | A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either `type` or `options` may be present, but not both.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | @@ -23,6 +24,7 @@ The shipping details. "name": { "full_name": "full_name6" }, + "email_address": "email_address6", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/vaulted-digital-wallet.md b/doc/models/vaulted-digital-wallet.md index ebbb587..16c2c3e 100644 --- a/doc/models/vaulted-digital-wallet.md +++ b/doc/models/vaulted-digital-wallet.md @@ -29,6 +29,7 @@ Resource consolidating common request and response attributes for vaulting a Dig "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/venmo-experience-context.md b/doc/models/venmo-experience-context.md new file mode 100644 index 0000000..8f36068 --- /dev/null +++ b/doc/models/venmo-experience-context.md @@ -0,0 +1,29 @@ + +# Venmo Experience Context + +A resource representing an experience context of vault a venmo account. + +## Structure + +`VenmoExperienceContext` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `brand_name` | `String` | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | +| `shipping_preference` | [`ExperienceContextShippingPreference`](../../doc/models/experience-context-shipping-preference.md) | Optional | The shipping preference. This only applies to PayPal payment source.

**Default**: `ExperienceContextShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | +| `vault_instruction` | [`VaultInstructionAction`](../../doc/models/vault-instruction-action.md) | Optional | DEPRECATED. Vault Instruction on action to be performed after a successful payer approval.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | +| `user_action` | [`VaultUserAction`](../../doc/models/vault-user-action.md) | Optional | User Action on action to be performed after a successful payer approval.

**Default**: `VaultUserAction::CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[A-Z_]+$` | + +## Example (as JSON) + +```json +{ + "shipping_preference": "GET_FROM_FILE", + "user_action": "CONTINUE", + "brand_name": "brand_name0", + "vault_instruction": "ON_CREATE_PAYMENT_TOKENS" +} +``` + diff --git a/doc/models/venmo-payment-token.md b/doc/models/venmo-payment-token.md index 230b411..a438ae4 100644 --- a/doc/models/venmo-payment-token.md +++ b/doc/models/venmo-payment-token.md @@ -1,6 +1,8 @@ # Venmo Payment Token +Full representation of a Venmo Payment Token. + ## Structure `VenmoPaymentToken` @@ -15,7 +17,7 @@ | `permit_multiple_payment_tokens` | `TrueClass \| FalseClass` | Optional | Create multiple payment tokens for the same payer, merchant/platform combination. Use this when the customer has not logged in at merchant/platform. The payment token thus generated, can then also be used to create the customer account at merchant/platform. Use this also when multiple payment tokens are required for the same payer, different customer at merchant/platform. This helps to identify customers distinctly even though they may share the same PayPal account. This only applies to PayPal payment source.

**Default**: `false` | | `usage_type` | [`PaypalPaymentTokenUsageType`](../../doc/models/paypal-payment-token-usage-type.md) | Optional | The usage type associated with a digital wallet payment token.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | | `customer_type` | [`PaypalPaymentTokenCustomerType`](../../doc/models/paypal-payment-token-customer-type.md) | Optional | The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | -| `email_address` | `String` | Optional | The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | +| `email_address` | `String` | Optional | The internationalized email address.
Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.


**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `254`, *Pattern*: ``(?:[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{\|}~-]+)*\|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\|\[(?:(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]\|[0-4][0-9])\|1[0-9][0-9]\|[1-9]?[0-9])\|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]\|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])`` | | `payer_id` | `String` | Optional | The account identifier for a PayPal account.

**Constraints**: *Minimum Length*: `13`, *Maximum Length*: `13`, *Pattern*: `^[2-9A-HJ-NP-Z]{13}$` | | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `phone` | [`PhoneWithType`](../../doc/models/phone-with-type.md) | Optional | The phone information. | @@ -33,6 +35,7 @@ "name": { "full_name": "full_name6" }, + "email_address": "email_address2", "phone_number": { "country_code": "country_code2", "national_number": "national_number6" diff --git a/doc/models/venmo-vault-response-status.md b/doc/models/venmo-vault-response-status.md new file mode 100644 index 0000000..e5371c0 --- /dev/null +++ b/doc/models/venmo-vault-response-status.md @@ -0,0 +1,17 @@ + +# Venmo Vault Response Status + +The vault status. + +## Enumeration + +`VenmoVaultResponseStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `VAULTED` | The payment source has been saved in your customer's vault. This vault status reflects `/v3/vault` status. | +| `CREATED` | DEPRECATED. The payment source has been saved in your customer's vault. This status applies to deprecated integration patterns and will not be returned for v3/vault integrations. | +| `APPROVED` | Customer has approved the action of saving the specified payment_source into their vault. Use v3/vault/payment-tokens with given setup_token to save the payment source in the vault | + diff --git a/doc/models/venmo-vault-response.md b/doc/models/venmo-vault-response.md new file mode 100644 index 0000000..2fc2cad --- /dev/null +++ b/doc/models/venmo-vault-response.md @@ -0,0 +1,58 @@ + +# Venmo Vault Response + +The details about a saved venmo payment source. + +## Structure + +`VenmoVaultResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Optional | The PayPal-generated ID for the saved payment source.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `status` | [`VenmoVaultResponseStatus`](../../doc/models/venmo-vault-response-status.md) | Optional | The vault status.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255`, *Pattern*: `^[0-9A-Z_]+$` | +| `links` | [`Array[LinkDescription]`](../../doc/models/link-description.md) | Optional | An array of request-related HATEOAS links.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | +| `customer` | [`CustomerInformation`](../../doc/models/customer-information.md) | Optional | This object represents a merchant’s customer, allowing them to store contact details, and track all payments associated with the same customer. | + +## Example (as JSON) + +```json +{ + "id": "id2", + "status": "CREATED", + "links": [ + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + }, + { + "href": "href6", + "rel": "rel0", + "method": "HEAD" + } + ], + "customer": { + "id": "id0", + "email_address": "email_address2", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "name": { + "given_name": "given_name2", + "surname": "surname8" + } + } +} +``` + diff --git a/doc/models/venmo-wallet-attributes-response.md b/doc/models/venmo-wallet-attributes-response.md index 56c9a29..17faf29 100644 --- a/doc/models/venmo-wallet-attributes-response.md +++ b/doc/models/venmo-wallet-attributes-response.md @@ -11,7 +11,7 @@ Additional attributes associated with the use of a Venmo Wallet. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `vault` | [`VaultResponse`](../../doc/models/vault-response.md) | Optional | The details about a saved payment source. | +| `vault` | [`VenmoVaultResponse`](../../doc/models/venmo-vault-response.md) | Optional | The details about a saved venmo payment source. | ## Example (as JSON) @@ -20,20 +20,27 @@ Additional attributes associated with the use of a Venmo Wallet. "vault": { "id": "id6", "status": "APPROVED", - "customer": { - "id": "id0", - "name": { - "given_name": "given_name2", - "surname": "surname8" - } - }, "links": [ { "href": "href6", "rel": "rel0", "method": "HEAD" } - ] + ], + "customer": { + "id": "id0", + "email_address": "email_address2", + "phone": { + "phone_type": "OTHER", + "phone_number": { + "national_number": "national_number6" + } + }, + "name": { + "given_name": "given_name2", + "surname": "surname8" + } + } } } ``` diff --git a/doc/models/shipping-preference.md b/doc/models/venmo-wallet-experience-context-shipping-preference.md similarity index 83% rename from doc/models/shipping-preference.md rename to doc/models/venmo-wallet-experience-context-shipping-preference.md index c724a22..f1c53d2 100644 --- a/doc/models/shipping-preference.md +++ b/doc/models/venmo-wallet-experience-context-shipping-preference.md @@ -1,11 +1,11 @@ -# Shipping Preference +# Venmo Wallet Experience Context Shipping Preference The location from which the shipping address is derived. ## Enumeration -`ShippingPreference` +`VenmoWalletExperienceContextShippingPreference` ## Fields diff --git a/doc/models/venmo-wallet-experience-context-user-action.md b/doc/models/venmo-wallet-experience-context-user-action.md new file mode 100644 index 0000000..7f111b4 --- /dev/null +++ b/doc/models/venmo-wallet-experience-context-user-action.md @@ -0,0 +1,16 @@ + +# Venmo Wallet Experience Context User Action + +Configures a Continue or Pay Now checkout flow. + +## Enumeration + +`VenmoWalletExperienceContextUserAction` + +## Fields + +| Name | Description | +| --- | --- | +| `CONTINUE` | After you redirect the customer to the Venmo payment page, a Continue button appears. Use this option when the final amount is not known when the checkout flow is initiated and you want to redirect the customer to the merchant page without processing the payment. | +| `PAY_NOW` | After you redirect the customer to the Venmo payment page, a Pay Now button appears. Use this option when the final amount is known when the checkout is initiated and you want to process the payment immediately when the customer clicks Pay Now. | + diff --git a/doc/models/venmo-wallet-experience-context.md b/doc/models/venmo-wallet-experience-context.md index 434ee79..2c68cb3 100644 --- a/doc/models/venmo-wallet-experience-context.md +++ b/doc/models/venmo-wallet-experience-context.md @@ -12,14 +12,16 @@ Customizes the buyer experience during the approval process for payment with Ven | Name | Type | Tags | Description | | --- | --- | --- | --- | | `brand_name` | `String` | Optional | The business name of the merchant. The pattern is defined by an external party and supports Unicode.

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `127`, *Pattern*: `^.*$` | -| `shipping_preference` | [`ShippingPreference`](../../doc/models/shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `ShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | +| `shipping_preference` | [`VenmoWalletExperienceContextShippingPreference`](../../doc/models/venmo-wallet-experience-context-shipping-preference.md) | Optional | The location from which the shipping address is derived.

**Default**: `VenmoWalletExperienceContextShippingPreference::GET_FROM_FILE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `24`, *Pattern*: `^[A-Z_]+$` | | `order_update_callback_config` | [`CallbackConfiguration`](../../doc/models/callback-configuration.md) | Optional | CallBack Configuration that the merchant can provide to PayPal/Venmo. | +| `user_action` | [`VenmoWalletExperienceContextUserAction`](../../doc/models/venmo-wallet-experience-context-user-action.md) | Optional | Configures a Continue or Pay Now checkout flow.

**Default**: `VenmoWalletExperienceContextUserAction::CONTINUE`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `8`, *Pattern*: `^[0-9A-Z_]+$` | ## Example (as JSON) ```json { "shipping_preference": "GET_FROM_FILE", + "user_action": "CONTINUE", "brand_name": "brand_name6", "order_update_callback_config": { "callback_events": [ diff --git a/doc/models/venmo-wallet-request.md b/doc/models/venmo-wallet-request.md index 22c6a96..de24bca 100644 --- a/doc/models/venmo-wallet-request.md +++ b/doc/models/venmo-wallet-request.md @@ -32,7 +32,8 @@ Information needed to pay using Venmo. "SHIPPING_OPTIONS" ], "callback_url": "callback_url6" - } + }, + "user_action": "CONTINUE" }, "attributes": { "customer": { diff --git a/doc/models/venmo-wallet-response.md b/doc/models/venmo-wallet-response.md index afdf872..b0ab147 100644 --- a/doc/models/venmo-wallet-response.md +++ b/doc/models/venmo-wallet-response.md @@ -17,12 +17,14 @@ Venmo wallet response. | `name` | [`Name`](../../doc/models/name.md) | Optional | The name of the party. | | `phone_number` | [`PhoneNumber`](../../doc/models/phone-number.md) | Optional | The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). | | `address` | [`Address`](../../doc/models/address.md) | Optional | The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute). | +| `return_flow` | [`ReturnFlow`](../../doc/models/return-flow.md) | Optional | Merchant preference on how the buyer can navigate back to merchant website post approving the transaction on the Venmo App.

**Default**: `ReturnFlow::AUTO`

**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `6`, *Pattern*: `^[A-Z_]+$` | | `attributes` | [`VenmoWalletAttributesResponse`](../../doc/models/venmo-wallet-attributes-response.md) | Optional | Additional attributes associated with the use of a Venmo Wallet. | ## Example (as JSON) ```json { + "return_flow": "AUTO", "email_address": "email_address6", "account_id": "account_id8", "user_name": "user_name2", diff --git a/doc/proxy-settings.md b/doc/proxy-settings.md new file mode 100644 index 0000000..e9d4c63 --- /dev/null +++ b/doc/proxy-settings.md @@ -0,0 +1,31 @@ + +# ProxySettings + +Represents the proxy server configurations for API calls. + +## Properties + +| Name | Type | Tag | Description | +| --- | --- | --- | --- | +| address | `String` | required | The proxy server URL. | +| port | `Integer` | optional | The port to connect to the proxy server. | +| username | `String` | optional | Username for proxy authentication. | +| password | `String` | optional | Password for proxy authentication. | + +## Usage Example + +```ruby +require 'paypal_server_sdk' +include PaypalServerSdk + + +client = PaypalServerSdk::Client.new( + proxy_settings: ProxySettings.new( + address: "http://localhost", + port: 8888, + username: 'user', + password: 'pass' + ) +) +``` + diff --git a/lib/paypal_server_sdk.rb b/lib/paypal_server_sdk.rb index 2b421f1..a79eaa5 100644 --- a/lib/paypal_server_sdk.rb +++ b/lib/paypal_server_sdk.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). require 'date' require 'json' @@ -23,6 +23,8 @@ require_relative 'paypal_server_sdk/http/http_method_enum' require_relative 'paypal_server_sdk/http/http_request' require_relative 'paypal_server_sdk/http/http_response' +require_relative 'paypal_server_sdk/http/proxy_settings' + # Logger require_relative 'paypal_server_sdk/logging/configuration/' \ @@ -32,303 +34,391 @@ # Models require_relative 'paypal_server_sdk/models/base_model' -require_relative 'paypal_server_sdk/models/apple_pay_card_response' require_relative 'paypal_server_sdk/models/activity_timestamps' -require_relative 'paypal_server_sdk/models/amount_with_breakdown' -require_relative 'paypal_server_sdk/models/apple_pay_experience_context' -require_relative 'paypal_server_sdk/models/authentication_response' -require_relative 'paypal_server_sdk/models/authorization_with_additional_data' -require_relative 'paypal_server_sdk/models/billing_cycle' -require_relative 'paypal_server_sdk/models/blik_one_click_payment_object' -require_relative 'paypal_server_sdk/models/card_customer_information' -require_relative 'paypal_server_sdk/models/card_response' -require_relative 'paypal_server_sdk/models/confirm_order_request' -require_relative 'paypal_server_sdk/models/customer_information' require_relative 'paypal_server_sdk/models/amount_breakdown' +require_relative 'paypal_server_sdk/models/amount_with_breakdown' +require_relative 'paypal_server_sdk/models/app_switch_context' require_relative 'paypal_server_sdk/models/apple_pay_payment_object' require_relative 'paypal_server_sdk/models/apple_pay_attributes' require_relative 'paypal_server_sdk/models/apple_pay_attributes_response' +require_relative 'paypal_server_sdk/models/apple_pay_card_response' +require_relative 'paypal_server_sdk/models/apple_pay_decrypted_token_data' +require_relative 'paypal_server_sdk/models/apple_pay_experience_context' require_relative 'paypal_server_sdk/models/apple_pay_payment_data' +require_relative 'paypal_server_sdk/models/apple_pay_request' require_relative 'paypal_server_sdk/models/assurance_details' +require_relative 'paypal_server_sdk/models/authentication_response' require_relative 'paypal_server_sdk/models/authorization' +require_relative 'paypal_server_sdk/models/link_description' +require_relative 'paypal_server_sdk/models/authorization_status_with_details' require_relative 'paypal_server_sdk/models/authorization_status_details' +require_relative 'paypal_server_sdk/models/authorization_with_additional_data' require_relative 'paypal_server_sdk/models/bancontact_payment_object' +require_relative 'paypal_server_sdk/models/bancontact_payment_request' +require_relative 'paypal_server_sdk/models/billing_cycle' require_relative 'paypal_server_sdk/models/bin_details' require_relative 'paypal_server_sdk/models/blik_payment_object' -require_relative 'paypal_server_sdk/models/blik_level0_payment_object' -require_relative 'paypal_server_sdk/models/orders_capture' -require_relative 'paypal_server_sdk/models/capture_status_details' -require_relative 'paypal_server_sdk/models/card_stored_credential' -require_relative 'paypal_server_sdk/models/card_supplementary_data' -require_relative 'paypal_server_sdk/models/card_verification' -require_relative 'paypal_server_sdk/models/authorization_status_with_details' require_relative 'paypal_server_sdk/models/blik_experience_context' require_relative 'paypal_server_sdk/models/blik_one_click_payment_request' +require_relative 'paypal_server_sdk/models/blik_one_click_payment_object' require_relative 'paypal_server_sdk/models/blik_payment_request' +require_relative 'paypal_server_sdk/models/blik_level0_payment_object' require_relative 'paypal_server_sdk/models/callback_configuration' +require_relative 'paypal_server_sdk/models/orders_capture' require_relative 'paypal_server_sdk/models/capture_status_with_details' -require_relative 'paypal_server_sdk/models/card_request' -require_relative 'paypal_server_sdk/models/cobranded_card' -require_relative 'paypal_server_sdk/models/apple_pay_decrypted_token_data' -require_relative 'paypal_server_sdk/models/apple_pay_request' -require_relative 'paypal_server_sdk/models/link_description' -require_relative 'paypal_server_sdk/models/bancontact_payment_request' +require_relative 'paypal_server_sdk/models/capture_status_details' require_relative 'paypal_server_sdk/models/card_attributes' require_relative 'paypal_server_sdk/models/card_attributes_response' +require_relative 'paypal_server_sdk/models/card_customer_information' require_relative 'paypal_server_sdk/models/card_experience_context' require_relative 'paypal_server_sdk/models/card_from_request' +require_relative 'paypal_server_sdk/models/card_request' +require_relative 'paypal_server_sdk/models/card_response' +require_relative 'paypal_server_sdk/models/card_stored_credential' +require_relative 'paypal_server_sdk/models/card_supplementary_data' require_relative 'paypal_server_sdk/models/card_vault_response' +require_relative 'paypal_server_sdk/models/card_verification' +require_relative 'paypal_server_sdk/models/cobranded_card' +require_relative 'paypal_server_sdk/models/confirm_order_request' +require_relative 'paypal_server_sdk/models/customer_information' require_relative 'paypal_server_sdk/models/platform_fee' -require_relative 'paypal_server_sdk/models/purchase_unit_request' -require_relative 'paypal_server_sdk/models/shipping_option' -require_relative 'paypal_server_sdk/models/google_pay_wallet_response' +require_relative 'paypal_server_sdk/models/money' require_relative 'paypal_server_sdk/models/eps_payment_object' require_relative 'paypal_server_sdk/models/eps_payment_request' +require_relative 'paypal_server_sdk/models/error_details' +require_relative 'paypal_server_sdk/models/exchange_rate' +require_relative 'paypal_server_sdk/models/experience_context' require_relative 'paypal_server_sdk/models/giropay_payment_object' +require_relative 'paypal_server_sdk/models/giropay_payment_request' +require_relative 'paypal_server_sdk/models/google_pay_wallet_response' +require_relative 'paypal_server_sdk/models/google_pay_card_response' +require_relative 'paypal_server_sdk/models/google_pay_decrypted_token_data' require_relative 'paypal_server_sdk/models/google_pay_experience_context' -require_relative 'paypal_server_sdk/models/order_application_context' -require_relative 'paypal_server_sdk/models/order_billing_plan' require_relative 'paypal_server_sdk/models/google_pay_request' -require_relative 'paypal_server_sdk/models/order_tracker_request' -require_relative 'paypal_server_sdk/models/p24_payment_request' require_relative 'paypal_server_sdk/models/ideal_payment_object' +require_relative 'paypal_server_sdk/models/ideal_payment_request' require_relative 'paypal_server_sdk/models/item' +require_relative 'paypal_server_sdk/models/item_request' +require_relative 'paypal_server_sdk/models/level2_card_processing_data' require_relative 'paypal_server_sdk/models/level3_card_processing_data' -require_relative 'paypal_server_sdk/models/payment_method_preference' -require_relative 'paypal_server_sdk/models/paypal_wallet' -require_relative 'paypal_server_sdk/models/money' +require_relative 'paypal_server_sdk/models/line_item' +require_relative 'paypal_server_sdk/models/mobile_web_context' require_relative 'paypal_server_sdk/models/mybank_payment_object' -require_relative 'paypal_server_sdk/models/paypal_wallet_attributes' -require_relative 'paypal_server_sdk/models/network_token' -require_relative 'paypal_server_sdk/models/order_authorize_request' -require_relative 'paypal_server_sdk/models/order_request' -require_relative 'paypal_server_sdk/models/order_update_callback_error_response' -require_relative 'paypal_server_sdk/models/order_update_callback_request' -require_relative 'paypal_server_sdk/models/order_update_callback_response' -require_relative 'paypal_server_sdk/models/payer_base' -require_relative 'paypal_server_sdk/models/payment_source_response' -require_relative 'paypal_server_sdk/models/experience_context' -require_relative 'paypal_server_sdk/models/giropay_payment_request' -require_relative 'paypal_server_sdk/models/google_pay_card_response' -require_relative 'paypal_server_sdk/models/google_pay_decrypted_token_data' -require_relative 'paypal_server_sdk/models/level2_card_processing_data' require_relative 'paypal_server_sdk/models/mybank_payment_request' -require_relative 'paypal_server_sdk/models/order' -require_relative 'paypal_server_sdk/models/order_capture_request' -require_relative 'paypal_server_sdk/models/payer' -require_relative 'paypal_server_sdk/models/payment_collection' -require_relative 'paypal_server_sdk/models/paypal_wallet_customer' -require_relative 'paypal_server_sdk/models/error_details' -require_relative 'paypal_server_sdk/models/exchange_rate' -require_relative 'paypal_server_sdk/models/ideal_payment_request' -require_relative 'paypal_server_sdk/models/line_item' +require_relative 'paypal_server_sdk/models/native_app_context' require_relative 'paypal_server_sdk/models/net_amount_breakdown_item' -require_relative 'paypal_server_sdk/models/network_transaction_reference' +require_relative 'paypal_server_sdk/models/network_token' +require_relative 'paypal_server_sdk/models/network_transaction' +require_relative 'paypal_server_sdk/models/order' +require_relative 'paypal_server_sdk/models/order_application_context' +require_relative 'paypal_server_sdk/models/order_authorize_request' require_relative 'paypal_server_sdk/models/order_authorize_response' +require_relative 'paypal_server_sdk/models/order_billing_plan' +require_relative 'paypal_server_sdk/models/order_capture_request' require_relative 'paypal_server_sdk/models/order_confirm_application_context' -require_relative 'paypal_server_sdk/models/' \ - 'order_update_callback_error_response_details' +require_relative 'paypal_server_sdk/models/order_request' +require_relative 'paypal_server_sdk/models/order_tracker_request' require_relative 'paypal_server_sdk/models/p24_payment_object' +require_relative 'paypal_server_sdk/models/p24_payment_request' require_relative 'paypal_server_sdk/models/participant_metadata' require_relative 'paypal_server_sdk/models/patch' require_relative 'paypal_server_sdk/models/payee_base' +require_relative 'paypal_server_sdk/models/payer' +require_relative 'paypal_server_sdk/models/payment_collection' require_relative 'paypal_server_sdk/models/payment_instruction' +require_relative 'paypal_server_sdk/models/payment_method_preference' require_relative 'paypal_server_sdk/models/payment_source' +require_relative 'paypal_server_sdk/models/payment_source_response' +require_relative 'paypal_server_sdk/models/paypal_wallet' +require_relative 'paypal_server_sdk/models/paypal_wallet_attributes' require_relative 'paypal_server_sdk/models/paypal_wallet_attributes_response' +require_relative 'paypal_server_sdk/models/paypal_wallet_customer' +require_relative 'paypal_server_sdk/models/paypal_wallet_experience_context' require_relative 'paypal_server_sdk/models/paypal_wallet_response' -require_relative 'paypal_server_sdk/models/phone_number' -require_relative 'paypal_server_sdk/models/processor_response' +require_relative 'paypal_server_sdk/models/paypal_wallet_stored_credential' require_relative 'paypal_server_sdk/models/paypal_wallet_vault_response' -require_relative 'paypal_server_sdk/models/pricing_scheme' -require_relative 'paypal_server_sdk/models/paypal_wallet_experience_context' +require_relative 'paypal_server_sdk/models/phone_number' require_relative 'paypal_server_sdk/models/phone_with_type' -require_relative 'paypal_server_sdk/models/paypal_wallet_stored_credential' +require_relative 'paypal_server_sdk/models/pricing_scheme' +require_relative 'paypal_server_sdk/models/processor_response' +require_relative 'paypal_server_sdk/models/purchase_unit' +require_relative 'paypal_server_sdk/models/purchase_unit_request' require_relative 'paypal_server_sdk/models/refund' require_relative 'paypal_server_sdk/models/refund_status_with_details' require_relative 'paypal_server_sdk/models/refund_status_details' require_relative 'paypal_server_sdk/models/risk_supplementary_data' require_relative 'paypal_server_sdk/models/seller_payable_breakdown' require_relative 'paypal_server_sdk/models/seller_protection' -require_relative 'paypal_server_sdk/models/purchase_unit' require_relative 'paypal_server_sdk/models/seller_receivable_breakdown' require_relative 'paypal_server_sdk/models/shipping_details' -require_relative 'paypal_server_sdk/models/shipping_options_purchase_unit' -require_relative 'paypal_server_sdk/models/token' -require_relative 'paypal_server_sdk/models/order_tracker_item' -require_relative 'paypal_server_sdk/models/universal_product_code' -require_relative 'paypal_server_sdk/models/venmo_wallet_additional_attributes' -require_relative 'paypal_server_sdk/models/google_pay_request_card' -require_relative 'paypal_server_sdk/models/order_capture_request_payment_source' +require_relative 'paypal_server_sdk/models/shipping_option' +require_relative 'paypal_server_sdk/models/sofort_payment_object' require_relative 'paypal_server_sdk/models/sofort_payment_request' -require_relative 'paypal_server_sdk/models/' \ - 'three_d_secure_authentication_response' -require_relative 'paypal_server_sdk/models/vault_instruction' -require_relative 'paypal_server_sdk/models/vault_response' -require_relative 'paypal_server_sdk/models/venmo_wallet_response' -require_relative 'paypal_server_sdk/models/address' -require_relative 'paypal_server_sdk/models/shipping_with_tracking_details' require_relative 'paypal_server_sdk/models/stored_payment_source' -require_relative 'paypal_server_sdk/models/vault_instruction_base' -require_relative 'paypal_server_sdk/models/venmo_wallet_vault_attributes' -require_relative 'paypal_server_sdk/models/venmo_wallet_attributes_response' -require_relative 'paypal_server_sdk/models/venmo_wallet_request' -require_relative 'paypal_server_sdk/models/name' -require_relative 'paypal_server_sdk/models/' \ - 'order_authorize_response_payment_source' -require_relative 'paypal_server_sdk/models/' \ - 'order_update_callback_shipping_address' -require_relative 'paypal_server_sdk/models/sofort_payment_object' require_relative 'paypal_server_sdk/models/supplementary_data' require_relative 'paypal_server_sdk/models/tax_info' +require_relative 'paypal_server_sdk/models/' \ + 'three_d_secure_authentication_response' +require_relative 'paypal_server_sdk/models/token' require_relative 'paypal_server_sdk/models/order_tracker_response' +require_relative 'paypal_server_sdk/models/order_tracker_item' require_relative 'paypal_server_sdk/models/trustly_payment_object' require_relative 'paypal_server_sdk/models/trustly_payment_request' +require_relative 'paypal_server_sdk/models/universal_product_code' +require_relative 'paypal_server_sdk/models/vault_instruction' +require_relative 'paypal_server_sdk/models/vault_instruction_base' +require_relative 'paypal_server_sdk/models/vault_response' +require_relative 'paypal_server_sdk/models/venmo_wallet_vault_attributes' +require_relative 'paypal_server_sdk/models/venmo_vault_response' +require_relative 'paypal_server_sdk/models/venmo_wallet_additional_attributes' +require_relative 'paypal_server_sdk/models/venmo_wallet_attributes_response' require_relative 'paypal_server_sdk/models/venmo_wallet_experience_context' +require_relative 'paypal_server_sdk/models/venmo_wallet_request' +require_relative 'paypal_server_sdk/models/venmo_wallet_response' +require_relative 'paypal_server_sdk/models/payer_base' +require_relative 'paypal_server_sdk/models/address' require_relative 'paypal_server_sdk/models/apple_pay_tokenized_card' require_relative 'paypal_server_sdk/models/google_pay_card' +require_relative 'paypal_server_sdk/models/google_pay_request_card' +require_relative 'paypal_server_sdk/models/name' require_relative 'paypal_server_sdk/models/' \ 'order_authorize_request_payment_source' require_relative 'paypal_server_sdk/models/' \ - 'order_update_callback_shipping_option' -require_relative 'paypal_server_sdk/models/refund_platform_fee' -require_relative 'paypal_server_sdk/models/payments_capture' -require_relative 'paypal_server_sdk/models/apple_pay_payment_token' + 'order_authorize_response_payment_source' +require_relative 'paypal_server_sdk/models/order_capture_request_payment_source' +require_relative 'paypal_server_sdk/models/paypal_wallet_customer_request' +require_relative 'paypal_server_sdk/models/paypal_wallet_vault_instruction' require_relative 'paypal_server_sdk/models/phone_number_with_country_code' +require_relative 'paypal_server_sdk/models/' \ + 'phone_number_with_optional_country_code' require_relative 'paypal_server_sdk/models/shipping_name' +require_relative 'paypal_server_sdk/models/shipping_with_tracking_details' +require_relative 'paypal_server_sdk/models/vault_customer' require_relative 'paypal_server_sdk/models/venmo_wallet_customer_information' +require_relative 'paypal_server_sdk/models/payment_authorization' +require_relative 'paypal_server_sdk/models/payments_capture' +require_relative 'paypal_server_sdk/models/captured_payment' require_relative 'paypal_server_sdk/models/capture_request' +require_relative 'paypal_server_sdk/models/refund_platform_fee' require_relative 'paypal_server_sdk/models/refund_payment_instruction' -require_relative 'paypal_server_sdk/models/payments_processor_response' require_relative 'paypal_server_sdk/models/reauthorize_request' -require_relative 'paypal_server_sdk/models/related_identifiers' -require_relative 'paypal_server_sdk/models/paypal_wallet_customer_request' -require_relative 'paypal_server_sdk/models/paypal_wallet_vault_instruction' -require_relative 'paypal_server_sdk/models/vault_customer' -require_relative 'paypal_server_sdk/models/payment_authorization' -require_relative 'paypal_server_sdk/models/captured_payment' require_relative 'paypal_server_sdk/models/refund_request' +require_relative 'paypal_server_sdk/models/related_identifiers' require_relative 'paypal_server_sdk/models/payment_supplementary_data' -require_relative 'paypal_server_sdk/models/supplementary_purchase_data' require_relative 'paypal_server_sdk/models/capture_payment_instruction' +require_relative 'paypal_server_sdk/models/apple_pay_payment_token' +require_relative 'paypal_server_sdk/models/vault_apple_pay_request' +require_relative 'paypal_server_sdk/models/bank_request' +require_relative 'paypal_server_sdk/models/vault_card_experience_context' require_relative 'paypal_server_sdk/models/card_payment_token_entity' -require_relative 'paypal_server_sdk/models/' \ - 'payment_token_response_payment_source' -require_relative 'paypal_server_sdk/models/phone' -require_relative 'paypal_server_sdk/models/vaulted_digital_wallet' -require_relative 'paypal_server_sdk/models/setup_token_request_card' -require_relative 'paypal_server_sdk/models/vault_venmo_experience_context' +require_relative 'paypal_server_sdk/models/card_verification_details' require_relative 'paypal_server_sdk/models/customer' -require_relative 'paypal_server_sdk/models/setup_token_request' +require_relative 'paypal_server_sdk/models/' \ + 'customer_vault_payment_tokens_response' require_relative 'paypal_server_sdk/models/payment_token_request_payment_source' +require_relative 'paypal_server_sdk/models/vault_experience_context' +require_relative 'paypal_server_sdk/models/network_transaction_reference_entity' +require_relative 'paypal_server_sdk/models/one_time_charge' +require_relative 'paypal_server_sdk/models/' \ + 'payment_token_response_payment_source' +require_relative 'paypal_server_sdk/models/payment_token_request' +require_relative 'paypal_server_sdk/models/payment_token_response' require_relative 'paypal_server_sdk/models/vault_paypal_wallet_request' require_relative 'paypal_server_sdk/models/paypal_payment_token' -require_relative 'paypal_server_sdk/models/vault_token_request' -require_relative 'paypal_server_sdk/models/card_authentication_response' -require_relative 'paypal_server_sdk/models/card_verification_processor_response' +require_relative 'paypal_server_sdk/models/phone' +require_relative 'paypal_server_sdk/models/plan' +require_relative 'paypal_server_sdk/models/sepa_debit_experience_context' +require_relative 'paypal_server_sdk/models/sepa_debit_request' +require_relative 'paypal_server_sdk/models/setup_token_request' require_relative 'paypal_server_sdk/models/setup_token_response' require_relative 'paypal_server_sdk/models/' \ 'three_d_secure_card_authentication_response' +require_relative 'paypal_server_sdk/models/vault_token_request' +require_relative 'paypal_server_sdk/models/venmo_experience_context' require_relative 'paypal_server_sdk/models/vault_venmo_request' require_relative 'paypal_server_sdk/models/venmo_payment_token' +require_relative 'paypal_server_sdk/models/vaulted_digital_wallet' require_relative 'paypal_server_sdk/models/apple_pay_card' +require_relative 'paypal_server_sdk/models/apple_pay_request_card' +require_relative 'paypal_server_sdk/models/card_authentication_response' +require_relative 'paypal_server_sdk/models/card_response_address' +require_relative 'paypal_server_sdk/models/card_verification_processor_response' +require_relative 'paypal_server_sdk/models/customer_response' require_relative 'paypal_server_sdk/models/payment_token_request_card' +require_relative 'paypal_server_sdk/models/setup_token_request_card' +require_relative 'paypal_server_sdk/models/setup_token_request_payment_source' require_relative 'paypal_server_sdk/models/setup_token_response_card' +require_relative 'paypal_server_sdk/models/setup_token_response_payment_source' require_relative 'paypal_server_sdk/models/vault_response_customer' require_relative 'paypal_server_sdk/models/' \ 'vaulted_digital_wallet_shipping_details' -require_relative 'paypal_server_sdk/models/card_verification_details' +require_relative 'paypal_server_sdk/models/simple_postal_address_coarse_grained' +require_relative 'paypal_server_sdk/models/auction_information' +require_relative 'paypal_server_sdk/models/balance_information' +require_relative 'paypal_server_sdk/models/balances_response' +require_relative 'paypal_server_sdk/models/cart_information' +require_relative 'paypal_server_sdk/models/checkout_option' +require_relative 'paypal_server_sdk/models/transaction_search_error_details' +require_relative 'paypal_server_sdk/models/incentive_details' +require_relative 'paypal_server_sdk/models/incentive_information' +require_relative 'paypal_server_sdk/models/item_details' +require_relative 'paypal_server_sdk/models/tax_amount' +require_relative 'paypal_server_sdk/models/payer_name' +require_relative 'paypal_server_sdk/models/payer_information' +require_relative 'paypal_server_sdk/models/search_response' +require_relative 'paypal_server_sdk/models/shipping_information' +require_relative 'paypal_server_sdk/models/store_information' +require_relative 'paypal_server_sdk/models/transaction_details' +require_relative 'paypal_server_sdk/models/transaction_information' +require_relative 'paypal_server_sdk/models/subscription_amount_with_breakdown' +require_relative 'paypal_server_sdk/models/subscription_application_context' +require_relative 'paypal_server_sdk/models/subscription_billing_cycle' +require_relative 'paypal_server_sdk/models/billing_cycle_override' +require_relative 'paypal_server_sdk/models/subscriptions_card_attributes' +require_relative 'paypal_server_sdk/models/card_customer' +require_relative 'paypal_server_sdk/models/subscription_card_request' +require_relative 'paypal_server_sdk/models/card_response_with_billing_address' +require_relative 'paypal_server_sdk/models/subscription_customer_information' +require_relative 'paypal_server_sdk/models/cycle_execution' +require_relative 'paypal_server_sdk/models/failed_payment_details' +require_relative 'paypal_server_sdk/models/frequency' +require_relative 'paypal_server_sdk/models/merchant_preferences' +require_relative 'paypal_server_sdk/models/subscription_payer_name' +require_relative 'paypal_server_sdk/models/payment_preferences' +require_relative 'paypal_server_sdk/models/payment_preferences_override' +require_relative 'paypal_server_sdk/models/subscription_payment_source' +require_relative 'paypal_server_sdk/models/subscription_payment_source_response' +require_relative 'paypal_server_sdk/models/billing_plan' +require_relative 'paypal_server_sdk/models/plan_collection' +require_relative 'paypal_server_sdk/models/plan_override' +require_relative 'paypal_server_sdk/models/plan_request' +require_relative 'paypal_server_sdk/models/subscription_pricing_scheme' +require_relative 'paypal_server_sdk/models/pricing_tier' +require_relative 'paypal_server_sdk/models/subscriber' +require_relative 'paypal_server_sdk/models/subscriber_request' +require_relative 'paypal_server_sdk/models/subscription' +require_relative 'paypal_server_sdk/models/activate_subscription_request' +require_relative 'paypal_server_sdk/models/subscription_billing_information' +require_relative 'paypal_server_sdk/models/cancel_subscription_request' +require_relative 'paypal_server_sdk/models/capture_subscription_request' +require_relative 'paypal_server_sdk/models/subscription_collection' +require_relative 'paypal_server_sdk/models/create_subscription_request' +require_relative 'paypal_server_sdk/models/modify_subscription_request' +require_relative 'paypal_server_sdk/models/modify_subscription_response' +require_relative 'paypal_server_sdk/models/suspend_subscription' +require_relative 'paypal_server_sdk/models/taxes' +require_relative 'paypal_server_sdk/models/taxes_override' +require_relative 'paypal_server_sdk/models/subscription_transaction_details' +require_relative 'paypal_server_sdk/models/transactions_list' +require_relative 'paypal_server_sdk/models/update_pricing_scheme' +require_relative 'paypal_server_sdk/models/update_pricing_schemes_request' +require_relative 'paypal_server_sdk/models/last_payment_details' +require_relative 'paypal_server_sdk/models/payment_method' +require_relative 'paypal_server_sdk/models/plan_details' require_relative 'paypal_server_sdk/models/' \ - 'customer_vault_payment_tokens_response' -require_relative 'paypal_server_sdk/models/vault_experience_context' -require_relative 'paypal_server_sdk/models/network_transaction_reference_entity' -require_relative 'paypal_server_sdk/models/one_time_charge' -require_relative 'paypal_server_sdk/models/payment_token_request' -require_relative 'paypal_server_sdk/models/payment_token_response' -require_relative 'paypal_server_sdk/models/plan' -require_relative 'paypal_server_sdk/models/card_response_address' -require_relative 'paypal_server_sdk/models/customer_response' -require_relative 'paypal_server_sdk/models/setup_token_card_experience_context' -require_relative 'paypal_server_sdk/models/setup_token_request_payment_source' -require_relative 'paypal_server_sdk/models/setup_token_response_payment_source' + 'subscription_patch_application_context' require_relative 'paypal_server_sdk/models/o_auth_token' -require_relative 'paypal_server_sdk/models/disbursement_mode' require_relative 'paypal_server_sdk/models/callback_events' +require_relative 'paypal_server_sdk/models/card_brand' require_relative 'paypal_server_sdk/models/card_type' +require_relative 'paypal_server_sdk/models/usage_pattern' require_relative 'paypal_server_sdk/models/checkout_payment_intent' +require_relative 'paypal_server_sdk/models/disbursement_mode' require_relative 'paypal_server_sdk/models/dispute_category' require_relative 'paypal_server_sdk/models/eci_flag' -require_relative 'paypal_server_sdk/models/card_brand' -require_relative 'paypal_server_sdk/models/usage_pattern' require_relative 'paypal_server_sdk/models/enrollment_status' -require_relative 'paypal_server_sdk/models/pa_res_status' -require_relative 'paypal_server_sdk/models/payment_initiator' require_relative 'paypal_server_sdk/models/liability_shift_indicator' require_relative 'paypal_server_sdk/models/order_status' +require_relative 'paypal_server_sdk/models/pa_res_status' require_relative 'paypal_server_sdk/models/payee_payment_method_preference' +require_relative 'paypal_server_sdk/models/payment_initiator' require_relative 'paypal_server_sdk/models/phone_type' require_relative 'paypal_server_sdk/models/shipment_carrier' -require_relative 'paypal_server_sdk/models/stored_payment_source_usage_type' -require_relative 'paypal_server_sdk/models/capture_incomplete_reason' -require_relative 'paypal_server_sdk/models/link_http_method' -require_relative 'paypal_server_sdk/models/' \ - 'order_application_context_landing_page' -require_relative 'paypal_server_sdk/models/orders_card_verification_method' -require_relative 'paypal_server_sdk/models/paypal_experience_landing_page' +require_relative 'paypal_server_sdk/models/shipping_type' +require_relative 'paypal_server_sdk/models/store_in_vault_instruction' require_relative 'paypal_server_sdk/models/stored_payment_source_payment_type' +require_relative 'paypal_server_sdk/models/stored_payment_source_usage_type' require_relative 'paypal_server_sdk/models/order_tracker_status' -require_relative 'paypal_server_sdk/models/authorization_status' -require_relative 'paypal_server_sdk/models/cvv_code' -require_relative 'paypal_server_sdk/models/item_category' -require_relative 'paypal_server_sdk/models/paypal_payment_token_customer_type' -require_relative 'paypal_server_sdk/models/shipping_type' +require_relative 'paypal_server_sdk/models/apple_pay_payment_data_type' require_relative 'paypal_server_sdk/models/authorization_incomplete_reason' +require_relative 'paypal_server_sdk/models/authorization_status' require_relative 'paypal_server_sdk/models/avs_code' +require_relative 'paypal_server_sdk/models/capture_incomplete_reason' +require_relative 'paypal_server_sdk/models/capture_status' +require_relative 'paypal_server_sdk/models/cvv_code' +require_relative 'paypal_server_sdk/models/' \ + 'experience_context_shipping_preference' +require_relative 'paypal_server_sdk/models/experience_status' require_relative 'paypal_server_sdk/models/fulfillment_type' +require_relative 'paypal_server_sdk/models/google_pay_authentication_method' require_relative 'paypal_server_sdk/models/google_pay_payment_method' +require_relative 'paypal_server_sdk/models/item_category' +require_relative 'paypal_server_sdk/models/link_http_method' +require_relative 'paypal_server_sdk/models/mobile_return_flow' +require_relative 'paypal_server_sdk/models/' \ + 'order_application_context_landing_page' require_relative 'paypal_server_sdk/models/' \ 'order_application_context_shipping_preference' require_relative 'paypal_server_sdk/models/' \ 'order_application_context_user_action' +require_relative 'paypal_server_sdk/models/orders_card_verification_method' +require_relative 'paypal_server_sdk/models/os_type' require_relative 'paypal_server_sdk/models/patch_op' require_relative 'paypal_server_sdk/models/payment_advice_code' +require_relative 'paypal_server_sdk/models/paypal_experience_landing_page' require_relative 'paypal_server_sdk/models/paypal_experience_user_action' -require_relative 'paypal_server_sdk/models/store_in_vault_instruction' -require_relative 'paypal_server_sdk/models/apple_pay_payment_data_type' -require_relative 'paypal_server_sdk/models/capture_status' -require_relative 'paypal_server_sdk/models/google_pay_authentication_method' -require_relative 'paypal_server_sdk/models/pricing_model' +require_relative 'paypal_server_sdk/models/paypal_payment_token_customer_type' require_relative 'paypal_server_sdk/models/paypal_payment_token_usage_type' +require_relative 'paypal_server_sdk/models/' \ + 'paypal_wallet_account_verification_status' +require_relative 'paypal_server_sdk/models/paypal_wallet_contact_preference' +require_relative 'paypal_server_sdk/models/' \ + 'paypal_wallet_context_shipping_preference' +require_relative 'paypal_server_sdk/models/paypal_wallet_vault_status' +require_relative 'paypal_server_sdk/models/pricing_model' require_relative 'paypal_server_sdk/models/processor_response_code' require_relative 'paypal_server_sdk/models/refund_incomplete_reason' require_relative 'paypal_server_sdk/models/refund_status' +require_relative 'paypal_server_sdk/models/return_flow' require_relative 'paypal_server_sdk/models/seller_protection_status' -require_relative 'paypal_server_sdk/models/shipping_preference' require_relative 'paypal_server_sdk/models/standard_entry_class_code' +require_relative 'paypal_server_sdk/models/tax_id_type' +require_relative 'paypal_server_sdk/models/tenure_type' +require_relative 'paypal_server_sdk/models/token_type' +require_relative 'paypal_server_sdk/models/upc_type' require_relative 'paypal_server_sdk/models/vault_status' +require_relative 'paypal_server_sdk/models/venmo_payment_token_customer_type' require_relative 'paypal_server_sdk/models/venmo_payment_token_usage_pattern' require_relative 'paypal_server_sdk/models/venmo_payment_token_usage_type' -require_relative 'paypal_server_sdk/models/payments_payment_advice_code' +require_relative 'paypal_server_sdk/models/venmo_vault_response_status' require_relative 'paypal_server_sdk/models/' \ - 'paypal_wallet_account_verification_status' -require_relative 'paypal_server_sdk/models/tenure_type' -require_relative 'paypal_server_sdk/models/token_type' -require_relative 'paypal_server_sdk/models/paypal_wallet_contact_preference' + 'venmo_wallet_experience_context_shipping_preference' require_relative 'paypal_server_sdk/models/' \ - 'paypal_wallet_context_shipping_preference' -require_relative 'paypal_server_sdk/models/paypal_wallet_vault_status' -require_relative 'paypal_server_sdk/models/tax_id_type' -require_relative 'paypal_server_sdk/models/upc_type' -require_relative 'paypal_server_sdk/models/venmo_payment_token_customer_type' + 'venmo_wallet_experience_context_user_action' require_relative 'paypal_server_sdk/models/vault_card_verification_method' require_relative 'paypal_server_sdk/models/card_verification_status' require_relative 'paypal_server_sdk/models/payment_token_status' +require_relative 'paypal_server_sdk/models/vault_user_action' require_relative 'paypal_server_sdk/models/vault_instruction_action' require_relative 'paypal_server_sdk/models/vault_token_request_type' +require_relative 'paypal_server_sdk/models/paypal_reference_id_type' +require_relative 'paypal_server_sdk/models/subscriptions_card_brand' +require_relative 'paypal_server_sdk/models/application_context_user_action' +require_relative 'paypal_server_sdk/models/capture_type' +require_relative 'paypal_server_sdk/models/interval_unit' +require_relative 'paypal_server_sdk/models/plan_request_status' +require_relative 'paypal_server_sdk/models/reason_code' +require_relative 'paypal_server_sdk/models/setup_fee_failure_action' +require_relative 'paypal_server_sdk/models/subscription_plan_status' +require_relative 'paypal_server_sdk/models/subscription_pricing_model' require_relative 'paypal_server_sdk/models/o_auth_provider_error' # Exceptions require_relative 'paypal_server_sdk/exceptions/api_exception' require_relative 'paypal_server_sdk/exceptions/error_exception' +require_relative 'paypal_server_sdk/exceptions/default_error_exception' +require_relative 'paypal_server_sdk/exceptions/search_error_exception' +require_relative 'paypal_server_sdk/exceptions/subscription_error_exception' require_relative 'paypal_server_sdk/exceptions/o_auth_provider_exception' require_relative 'paypal_server_sdk/configuration' @@ -338,4 +428,6 @@ require_relative 'paypal_server_sdk/controllers/orders_controller' require_relative 'paypal_server_sdk/controllers/payments_controller' require_relative 'paypal_server_sdk/controllers/vault_controller' +require_relative 'paypal_server_sdk/controllers/transaction_search_controller' +require_relative 'paypal_server_sdk/controllers/subscriptions_controller' require_relative 'paypal_server_sdk/controllers/o_auth_authorization_controller' diff --git a/lib/paypal_server_sdk/api_helper.rb b/lib/paypal_server_sdk/api_helper.rb index d78542e..2c1e8e2 100644 --- a/lib/paypal_server_sdk/api_helper.rb +++ b/lib/paypal_server_sdk/api_helper.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # API utility class diff --git a/lib/paypal_server_sdk/client.rb b/lib/paypal_server_sdk/client.rb index 751df2b..9bdd5a4 100644 --- a/lib/paypal_server_sdk/client.rb +++ b/lib/paypal_server_sdk/client.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # paypal_server_sdk client class. @@ -32,6 +32,18 @@ def vault @vault ||= VaultController.new @global_configuration end + # Access to transaction_search controller. + # @return [TransactionSearchController] Returns the controller instance. + def transaction_search + @transaction_search ||= TransactionSearchController.new @global_configuration + end + + # Access to subscriptions controller. + # @return [SubscriptionsController] Returns the controller instance. + def subscriptions + @subscriptions ||= SubscriptionsController.new @global_configuration + end + # Access to o_auth_authorization controller. # @return [OAuthAuthorizationController] Returns the controller instance. def o_auth_authorization @@ -42,7 +54,7 @@ def initialize( connection: nil, adapter: :net_http_persistent, timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 2, retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], - retry_methods: %i[get put], http_callback: nil, + retry_methods: %i[get put], http_callback: nil, proxy_settings: nil, logging_configuration: nil, environment: Environment::SANDBOX, client_credentials_auth_credentials: nil, config: nil ) @@ -53,6 +65,7 @@ def initialize( backoff_factor: backoff_factor, retry_statuses: retry_statuses, retry_methods: retry_methods, http_callback: http_callback, + proxy_settings: proxy_settings, logging_configuration: logging_configuration, environment: environment, client_credentials_auth_credentials: client_credentials_auth_credentials diff --git a/lib/paypal_server_sdk/configuration.rb b/lib/paypal_server_sdk/configuration.rb index 8bcbb39..744d02c 100644 --- a/lib/paypal_server_sdk/configuration.rb +++ b/lib/paypal_server_sdk/configuration.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # An enum for SDK environments. @@ -35,15 +35,15 @@ def initialize( connection: nil, adapter: :net_http_persistent, timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 2, retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], - retry_methods: %i[get put], http_callback: nil, + retry_methods: %i[get put], http_callback: nil, proxy_settings: nil, logging_configuration: nil, environment: Environment::SANDBOX, client_credentials_auth_credentials: nil ) - super connection: connection, adapter: adapter, timeout: timeout, max_retries: max_retries, retry_interval: retry_interval, backoff_factor: backoff_factor, retry_statuses: retry_statuses, retry_methods: retry_methods, http_callback: http_callback, + proxy_settings: proxy_settings, logging_configuration: logging_configuration # Current API environment @@ -53,7 +53,7 @@ def initialize( @client_credentials_auth_credentials = client_credentials_auth_credentials # Initializing OAuth 2 Client Credentials Grant credentials with the provided auth parameters - @client_credentials_auth_credentials = client_credentials_auth_credentials + @client_credentials_auth_credentials = client_credentials_auth_credentials # The Http Client to use for making requests. set_http_client CoreLibrary::FaradayClient.new(self) @@ -62,8 +62,8 @@ def initialize( def clone_with(connection: nil, adapter: nil, timeout: nil, max_retries: nil, retry_interval: nil, backoff_factor: nil, retry_statuses: nil, retry_methods: nil, http_callback: nil, - logging_configuration: nil, environment: nil, - client_credentials_auth_credentials: nil) + proxy_settings: nil, logging_configuration: nil, + environment: nil, client_credentials_auth_credentials: nil) connection ||= self.connection adapter ||= self.adapter timeout ||= self.timeout @@ -73,15 +73,17 @@ def clone_with(connection: nil, adapter: nil, timeout: nil, retry_statuses ||= self.retry_statuses retry_methods ||= self.retry_methods http_callback ||= self.http_callback + proxy_settings ||= self.proxy_settings logging_configuration ||= self.logging_configuration environment ||= self.environment - client_credentials_auth_credentials ||= client_credentials_auth_credentials + client_credentials_auth_credentials ||= self.client_credentials_auth_credentials Configuration.new( connection: connection, adapter: adapter, timeout: timeout, max_retries: max_retries, retry_interval: retry_interval, backoff_factor: backoff_factor, retry_statuses: retry_statuses, retry_methods: retry_methods, http_callback: http_callback, + proxy_settings: proxy_settings, logging_configuration: logging_configuration, environment: environment, client_credentials_auth_credentials: client_credentials_auth_credentials ) diff --git a/lib/paypal_server_sdk/controllers/base_controller.rb b/lib/paypal_server_sdk/controllers/base_controller.rb index 6e5c803..5e608c8 100644 --- a/lib/paypal_server_sdk/controllers/base_controller.rb +++ b/lib/paypal_server_sdk/controllers/base_controller.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # BaseController. @@ -10,7 +10,7 @@ class BaseController attr_accessor :config, :http_call_back def self.user_agent - 'PayPal REST API Ruby SDK, Version: 1.1.0, on OS {os-info}' + 'PayPal REST API Ruby SDK, Version: 2.0.0, on OS {os-info}' end def self.user_agent_parameters @@ -34,12 +34,6 @@ def initialize(global_configuration) @api_call = ApiCall.new(@global_configuration) end - # Creates a new builder for the Api Call instance. - # @return [ApiCall] The instance of ApiCall. - def new_api_call_builder - @api_call.new_builder - end - # Creates a new instance of the request builder. # @param [String] http_method The HTTP method to use in the request. # @param [String] path The endpoint path to use in the request. diff --git a/lib/paypal_server_sdk/controllers/o_auth_authorization_controller.rb b/lib/paypal_server_sdk/controllers/o_auth_authorization_controller.rb index 224932a..75c8408 100644 --- a/lib/paypal_server_sdk/controllers/o_auth_authorization_controller.rb +++ b/lib/paypal_server_sdk/controllers/o_auth_authorization_controller.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # OAuthAuthorizationController @@ -13,10 +13,10 @@ class OAuthAuthorizationController < BaseController # space-delimited list. # @param [Hash] _field_parameters Additional optional form parameters are # supported by this endpoint. - # @return [ApiResponse] the complete http response with raw body and status code. + # @return [ApiResponse] Complete http response with raw body and status code. def request_token(options = {}, _field_parameters: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/v1/oauth2/token', Server::DEFAULT) diff --git a/lib/paypal_server_sdk/controllers/orders_controller.rb b/lib/paypal_server_sdk/controllers/orders_controller.rb index 975b4ea..7aa6dfc 100644 --- a/lib/paypal_server_sdk/controllers/orders_controller.rb +++ b/lib/paypal_server_sdk/controllers/orders_controller.rb @@ -1,11 +1,123 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # OrdersController class OrdersController < BaseController + # Creates an order. Merchants and partners can add Level 2 and 3 data to + # payments to reduce risk and payment processing costs. For more information + # about processing payments, see checkout or multiparty checkout. Note: For + # error handling and troubleshooting, see Orders v2 errors. + # @param [OrderRequest] body Required parameter: TODO: type description + # here + # @param [String] paypal_mock_response Optional parameter: PayPal's REST API + # uses a request header to invoke negative testing in the sandbox. This + # header configures the sandbox into a negative testing state for + # transactions that include the merchant. + # @param [String] paypal_request_id Optional parameter: The server stores + # keys for 6 hours. The API callers can request the times to up to 72 hours + # by speaking to their Account Manager. It is mandatory for all single-step + # create order calls (E.g. Create Order Request with payment source + # information like Card, PayPal.vault_id, PayPal.billing_agreement_id, + # etc). + # @param [String] paypal_partner_attribution_id Optional parameter: TODO: + # type description here + # @param [String] paypal_client_metadata_id Optional parameter: TODO: type + # description here + # @param [String] prefer Optional parameter: The preferred server response + # upon successful completion of the request. Value is: return=minimal. The + # server returns a minimal response to optimize communication between the + # API caller and the server. A minimal response includes the id, status and + # HATEOAS links. return=representation. The server returns a complete + # resource representation, including the current state of the resource. + # @param [String] paypal_auth_assertion Optional parameter: An + # API-caller-provided JSON Web Token (JWT) assertion that identifies the + # merchant. For details, see PayPal-Auth-Assertion. + # @return [ApiResponse] Complete http response with raw body and status code. + def create_order(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v2/checkout/orders', + Server::DEFAULT) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) + .header_param(new_parameter(options['paypal_mock_response'], key: 'PayPal-Mock-Response')) + .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) + .header_param(new_parameter(options['paypal_partner_attribution_id'], key: 'PayPal-Partner-Attribution-Id')) + .header_param(new_parameter(options['paypal_client_metadata_id'], key: 'PayPal-Client-Metadata-Id')) + .header_param(new_parameter(options['prefer'], key: 'Prefer')) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) + .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(Order.method(:from_hash)) + .is_api_response(true) + .local_error('400', + 'Request is not well-formed, syntactically incorrect, or'\ + ' violates schema.', + ErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + ErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + ErrorException) + .local_error('default', + 'The error response.', + ErrorException)) + .execute + end + + # Shows details for an order, by ID. Note: For error handling and + # troubleshooting, see Orders v2 errors. + # @param [String] id Required parameter: The ID of the order for which to + # show details. + # @param [String] paypal_mock_response Optional parameter: PayPal's REST API + # uses a request header to invoke negative testing in the sandbox. This + # header configures the sandbox into a negative testing state for + # transactions that include the merchant. + # @param [String] paypal_auth_assertion Optional parameter: An + # API-caller-provided JSON Web Token (JWT) assertion that identifies the + # merchant. For details, see PayPal-Auth-Assertion. + # @param [String] fields Optional parameter: A comma-separated list of + # fields that should be returned for the order. Valid filter field is + # `payment_source`. + # @return [ApiResponse] Complete http response with raw body and status code. + def get_order(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/v2/checkout/orders/{id}', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .header_param(new_parameter(options['paypal_mock_response'], key: 'PayPal-Mock-Response')) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) + .query_param(new_parameter(options['fields'], key: 'fields')) + .header_param(new_parameter('application/json', key: 'accept')) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(Order.method(:from_hash)) + .is_api_response(true) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + ErrorException) + .local_error('404', + 'The specified resource does not exist.', + ErrorException) + .local_error('default', + 'The error response.', + ErrorException)) + .execute + end + # Updates an order with a `CREATED` or `APPROVED` status. You cannot update # an order with the `COMPLETED` status.

To make an update, you must # provide a `reference_id`. If you omit this value with an order that @@ -76,9 +188,9 @@ class OrdersController < BaseController # merchant. For details, see PayPal-Auth-Assertion. # @param [Array[Patch]] body Optional parameter: TODO: type description # here - # @return [ApiResponse] the complete http response with raw body and status code. + # @return [ApiResponse] Complete http response with raw body and status code. def patch_order(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PATCH, '/v2/checkout/orders/{id}', Server::DEFAULT) @@ -114,163 +226,39 @@ def patch_order(options = {}) .execute end - # Authorizes payment for an order. To successfully authorize payment for an - # order, the buyer must first approve the order or a valid payment_source - # must be provided in the request. A buyer can approve the order upon being - # redirected to the rel:approve URL that was returned in the HATEOAS links - # in the create order response. Note: For error handling and - # troubleshooting, see Orders v2 errors. - # @param [String] id Required parameter: The ID of the order for which to - # authorize. - # @param [String] paypal_mock_response Optional parameter: PayPal's REST API - # uses a request header to invoke negative testing in the sandbox. This - # header configures the sandbox into a negative testing state for - # transactions that include the merchant. - # @param [String] paypal_request_id Optional parameter: The server stores - # keys for 6 hours. The API callers can request the times to up to 72 hours - # by speaking to their Account Manager. It is mandatory for all single-step - # create order calls (E.g. Create Order Request with payment source - # information like Card, PayPal.vault_id, PayPal.billing_agreement_id, - # etc). + # Payer confirms their intent to pay for the the Order with the given + # payment source. + # @param [String] id Required parameter: The ID of the order for which the + # payer confirms their intent to pay. + # @param [String] paypal_client_metadata_id Optional parameter: TODO: type + # description here + # @param [String] paypal_auth_assertion Optional parameter: An + # API-caller-provided JSON Web Token (JWT) assertion that identifies the + # merchant. For details, see PayPal-Auth-Assertion. # @param [String] prefer Optional parameter: The preferred server response # upon successful completion of the request. Value is: return=minimal. The # server returns a minimal response to optimize communication between the # API caller and the server. A minimal response includes the id, status and # HATEOAS links. return=representation. The server returns a complete # resource representation, including the current state of the resource. - # @param [String] paypal_client_metadata_id Optional parameter: TODO: type - # description here - # @param [String] paypal_auth_assertion Optional parameter: An - # API-caller-provided JSON Web Token (JWT) assertion that identifies the - # merchant. For details, see PayPal-Auth-Assertion. - # @param [OrderAuthorizeRequest] body Optional parameter: TODO: type + # @param [ConfirmOrderRequest] body Optional parameter: TODO: type # description here - # @return [ApiResponse] the complete http response with raw body and status code. - def authorize_order(options = {}) - new_api_call_builder + # @return [ApiResponse] Complete http response with raw body and status code. + def confirm_order(options = {}) + @api_call .request(new_request_builder(HttpMethodEnum::POST, - '/v2/checkout/orders/{id}/authorize', + '/v2/checkout/orders/{id}/confirm-payment-source', Server::DEFAULT) .template_param(new_parameter(options['id'], key: 'id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) - .header_param(new_parameter(options['paypal_mock_response'], key: 'PayPal-Mock-Response')) - .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) - .header_param(new_parameter(options['prefer'], key: 'Prefer')) .header_param(new_parameter(options['paypal_client_metadata_id'], key: 'PayPal-Client-Metadata-Id')) .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) + .header_param(new_parameter(options['prefer'], key: 'Prefer')) .body_param(new_parameter(options['body'])) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) - .response(new_response_handler - .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(OrderAuthorizeResponse.method(:from_hash)) - .is_api_response(true) - .local_error('400', - 'Request is not well-formed, syntactically incorrect, or'\ - ' violates schema.', - ErrorException) - .local_error('401', - 'Authentication failed due to missing authorization header, or'\ - ' invalid authentication credentials.', - ErrorException) - .local_error('403', - 'The authorized payment failed due to insufficient permissions'\ - '.', - ErrorException) - .local_error('404', - 'The specified resource does not exist.', - ErrorException) - .local_error('422', - 'The requested action could not be performed, semantically'\ - ' incorrect, or failed business validation.', - ErrorException) - .local_error('500', - 'An internal server error has occurred.', - ErrorException) - .local_error('default', - 'The error response.', - ErrorException)) - .execute - end - - # Updates or cancels the tracking information for a PayPal order, by ID. - # Updatable attributes or objects: Attribute Op Notes items replace Using - # replace op for items will replace the entire items object with the value - # sent in request. notify_payer replace, add status replace Only patching - # status to CANCELLED is currently supported. - # @param [String] id Required parameter: The ID of the order that the - # tracking information is associated with. - # @param [String] tracker_id Required parameter: The order tracking ID. - # @param [String] paypal_auth_assertion Optional parameter: An - # API-caller-provided JSON Web Token (JWT) assertion that identifies the - # merchant. For details, see PayPal-Auth-Assertion. - # @param [Array[Patch]] body Optional parameter: TODO: type description - # here - # @return [ApiResponse] the complete http response with raw body and status code. - def update_order_tracking(options = {}) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::PATCH, - '/v2/checkout/orders/{id}/trackers/{tracker_id}', - Server::DEFAULT) - .template_param(new_parameter(options['id'], key: 'id') - .should_encode(true)) - .template_param(new_parameter(options['tracker_id'], key: 'tracker_id') - .should_encode(true)) - .header_param(new_parameter('application/json', key: 'Content-Type')) - .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) - .body_param(new_parameter(options['body'])) - .body_serializer(proc do |param| param.to_json unless param.nil? end) - .auth(Single.new('Oauth2'))) - .response(new_response_handler - .is_response_void(true) - .is_api_response(true) - .local_error('400', - 'Request is not well-formed, syntactically incorrect, or'\ - ' violates schema.', - ErrorException) - .local_error('403', - 'Authorization failed due to insufficient permissions.', - ErrorException) - .local_error('404', - 'The specified resource does not exist.', - ErrorException) - .local_error('422', - 'The requested action could not be performed, semantically'\ - ' incorrect, or failed business validation.', - ErrorException) - .local_error('500', - 'An internal server error has occurred.', - ErrorException) - .local_error('default', - 'The error response.', - ErrorException)) - .execute - end - - # Adds tracking information for an Order. - # @param [String] id Required parameter: The ID of the order that the - # tracking information is associated with. - # @param [OrderTrackerRequest] body Required parameter: TODO: type - # description here - # @param [String] paypal_auth_assertion Optional parameter: An - # API-caller-provided JSON Web Token (JWT) assertion that identifies the - # merchant. For details, see PayPal-Auth-Assertion. - # @return [ApiResponse] the complete http response with raw body and status code. - def create_order_tracking(options = {}) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::POST, - '/v2/checkout/orders/{id}/track', - Server::DEFAULT) - .template_param(new_parameter(options['id'], key: 'id') - .should_encode(true)) - .header_param(new_parameter('application/json', key: 'Content-Type')) - .body_param(new_parameter(options['body'])) - .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) - .header_param(new_parameter('application/json', key: 'accept')) - .body_serializer(proc do |param| param.to_json unless param.nil? end) - .auth(Single.new('Oauth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(Order.method(:from_hash)) @@ -282,9 +270,6 @@ def create_order_tracking(options = {}) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) - .local_error('404', - 'The specified resource does not exist.', - ErrorException) .local_error('422', 'The requested action could not be performed, semantically'\ ' incorrect, or failed business validation.', @@ -298,12 +283,14 @@ def create_order_tracking(options = {}) .execute end - # Creates an order. Merchants and partners can add Level 2 and 3 data to - # payments to reduce risk and payment processing costs. For more information - # about processing payments, see checkout or multiparty checkout. Note: For - # error handling and troubleshooting, see Orders v2 errors. - # @param [OrderRequest] body Required parameter: TODO: type description - # here + # Authorizes payment for an order. To successfully authorize payment for an + # order, the buyer must first approve the order or a valid payment_source + # must be provided in the request. A buyer can approve the order upon being + # redirected to the rel:approve URL that was returned in the HATEOAS links + # in the create order response. Note: For error handling and + # troubleshooting, see Orders v2 errors. + # @param [String] id Required parameter: The ID of the order for which to + # authorize. # @param [String] paypal_mock_response Optional parameter: PayPal's REST API # uses a request header to invoke negative testing in the sandbox. This # header configures the sandbox into a negative testing state for @@ -314,39 +301,40 @@ def create_order_tracking(options = {}) # create order calls (E.g. Create Order Request with payment source # information like Card, PayPal.vault_id, PayPal.billing_agreement_id, # etc). - # @param [String] paypal_partner_attribution_id Optional parameter: TODO: - # type description here - # @param [String] paypal_client_metadata_id Optional parameter: TODO: type - # description here # @param [String] prefer Optional parameter: The preferred server response # upon successful completion of the request. Value is: return=minimal. The # server returns a minimal response to optimize communication between the # API caller and the server. A minimal response includes the id, status and # HATEOAS links. return=representation. The server returns a complete # resource representation, including the current state of the resource. + # @param [String] paypal_client_metadata_id Optional parameter: TODO: type + # description here # @param [String] paypal_auth_assertion Optional parameter: An # API-caller-provided JSON Web Token (JWT) assertion that identifies the # merchant. For details, see PayPal-Auth-Assertion. - # @return [ApiResponse] the complete http response with raw body and status code. - def create_order(options = {}) - new_api_call_builder + # @param [OrderAuthorizeRequest] body Optional parameter: TODO: type + # description here + # @return [ApiResponse] Complete http response with raw body and status code. + def authorize_order(options = {}) + @api_call .request(new_request_builder(HttpMethodEnum::POST, - '/v2/checkout/orders', + '/v2/checkout/orders/{id}/authorize', Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) - .body_param(new_parameter(options['body'])) .header_param(new_parameter(options['paypal_mock_response'], key: 'PayPal-Mock-Response')) .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) - .header_param(new_parameter(options['paypal_partner_attribution_id'], key: 'PayPal-Partner-Attribution-Id')) - .header_param(new_parameter(options['paypal_client_metadata_id'], key: 'PayPal-Client-Metadata-Id')) .header_param(new_parameter(options['prefer'], key: 'Prefer')) + .header_param(new_parameter(options['paypal_client_metadata_id'], key: 'PayPal-Client-Metadata-Id')) .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) + .body_param(new_parameter(options['body'])) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(Order.method(:from_hash)) + .deserialize_into(OrderAuthorizeResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Request is not well-formed, syntactically incorrect, or'\ @@ -356,10 +344,20 @@ def create_order(options = {}) 'Authentication failed due to missing authorization header, or'\ ' invalid authentication credentials.', ErrorException) + .local_error('403', + 'The authorized payment failed due to insufficient permissions'\ + '.', + ErrorException) + .local_error('404', + 'The specified resource does not exist.', + ErrorException) .local_error('422', 'The requested action could not be performed, semantically'\ ' incorrect, or failed business validation.', ErrorException) + .local_error('500', + 'An internal server error has occurred.', + ErrorException) .local_error('default', 'The error response.', ErrorException)) @@ -397,9 +395,9 @@ def create_order(options = {}) # merchant. For details, see PayPal-Auth-Assertion. # @param [OrderCaptureRequest] body Optional parameter: TODO: type # description here - # @return [ApiResponse] the complete http response with raw body and status code. + # @return [ApiResponse] Complete http response with raw body and status code. def capture_order(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/v2/checkout/orders/{id}/capture', Server::DEFAULT) @@ -447,86 +445,85 @@ def capture_order(options = {}) .execute end - # Shows details for an order, by ID. Note: For error handling and - # troubleshooting, see Orders v2 errors. - # @param [String] id Required parameter: The ID of the order for which to - # show details. - # @param [String] paypal_mock_response Optional parameter: PayPal's REST API - # uses a request header to invoke negative testing in the sandbox. This - # header configures the sandbox into a negative testing state for - # transactions that include the merchant. + # Adds tracking information for an Order. + # @param [String] id Required parameter: The ID of the order that the + # tracking information is associated with. + # @param [OrderTrackerRequest] body Required parameter: TODO: type + # description here # @param [String] paypal_auth_assertion Optional parameter: An # API-caller-provided JSON Web Token (JWT) assertion that identifies the # merchant. For details, see PayPal-Auth-Assertion. - # @param [String] fields Optional parameter: A comma-separated list of - # fields that should be returned for the order. Valid filter field is - # `payment_source`. - # @return [ApiResponse] the complete http response with raw body and status code. - def get_order(options = {}) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::GET, - '/v2/checkout/orders/{id}', + # @return [ApiResponse] Complete http response with raw body and status code. + def create_order_tracking(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v2/checkout/orders/{id}/track', Server::DEFAULT) .template_param(new_parameter(options['id'], key: 'id') .should_encode(true)) - .header_param(new_parameter(options['paypal_mock_response'], key: 'PayPal-Mock-Response')) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) - .query_param(new_parameter(options['fields'], key: 'fields')) .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(Order.method(:from_hash)) .is_api_response(true) - .local_error('401', - 'Authentication failed due to missing authorization header, or'\ - ' invalid authentication credentials.', + .local_error('400', + 'Request is not well-formed, syntactically incorrect, or'\ + ' violates schema.', + ErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', ErrorException) .local_error('404', 'The specified resource does not exist.', ErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + ErrorException) + .local_error('500', + 'An internal server error has occurred.', + ErrorException) .local_error('default', 'The error response.', ErrorException)) .execute end - # Payer confirms their intent to pay for the the Order with the given - # payment source. - # @param [String] id Required parameter: The ID of the order for which the - # payer confirms their intent to pay. - # @param [String] paypal_client_metadata_id Optional parameter: TODO: type - # description here + # Updates or cancels the tracking information for a PayPal order, by ID. + # Updatable attributes or objects: Attribute Op Notes items replace Using + # replace op for items will replace the entire items object with the value + # sent in request. notify_payer replace, add status replace Only patching + # status to CANCELLED is currently supported. + # @param [String] id Required parameter: The ID of the order that the + # tracking information is associated with. + # @param [String] tracker_id Required parameter: The order tracking ID. # @param [String] paypal_auth_assertion Optional parameter: An # API-caller-provided JSON Web Token (JWT) assertion that identifies the # merchant. For details, see PayPal-Auth-Assertion. - # @param [String] prefer Optional parameter: The preferred server response - # upon successful completion of the request. Value is: return=minimal. The - # server returns a minimal response to optimize communication between the - # API caller and the server. A minimal response includes the id, status and - # HATEOAS links. return=representation. The server returns a complete - # resource representation, including the current state of the resource. - # @param [ConfirmOrderRequest] body Optional parameter: TODO: type - # description here - # @return [ApiResponse] the complete http response with raw body and status code. - def confirm_order(options = {}) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::POST, - '/v2/checkout/orders/{id}/confirm-payment-source', + # @param [Array[Patch]] body Optional parameter: TODO: type description + # here + # @return [ApiResponse] Complete http response with raw body and status code. + def update_order_tracking(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::PATCH, + '/v2/checkout/orders/{id}/trackers/{tracker_id}', Server::DEFAULT) .template_param(new_parameter(options['id'], key: 'id') .should_encode(true)) + .template_param(new_parameter(options['tracker_id'], key: 'tracker_id') + .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) - .header_param(new_parameter(options['paypal_client_metadata_id'], key: 'PayPal-Client-Metadata-Id')) .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) - .header_param(new_parameter(options['prefer'], key: 'Prefer')) .body_param(new_parameter(options['body'])) - .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) .response(new_response_handler - .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(Order.method(:from_hash)) + .is_response_void(true) .is_api_response(true) .local_error('400', 'Request is not well-formed, syntactically incorrect, or'\ @@ -535,6 +532,9 @@ def confirm_order(options = {}) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) + .local_error('404', + 'The specified resource does not exist.', + ErrorException) .local_error('422', 'The requested action could not be performed, semantically'\ ' incorrect, or failed business validation.', diff --git a/lib/paypal_server_sdk/controllers/payments_controller.rb b/lib/paypal_server_sdk/controllers/payments_controller.rb index a07beff..27d24a5 100644 --- a/lib/paypal_server_sdk/controllers/payments_controller.rb +++ b/lib/paypal_server_sdk/controllers/payments_controller.rb @@ -1,11 +1,62 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # PaymentsController class PaymentsController < BaseController + # Shows details for an authorized payment, by ID. + # @param [String] authorization_id Required parameter: The ID of the + # authorized payment for which to show details. + # @param [String] paypal_mock_response Optional parameter: PayPal's REST API + # uses a request header to invoke negative testing in the sandbox. This + # header configures the sandbox into a negative testing state for + # transactions that include the merchant. + # @param [String] paypal_auth_assertion Optional parameter: An + # API-caller-provided JSON Web Token (JWT) assertion that identifies the + # merchant. For details, see + # [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-asse + # rtion). Note:For three party transactions in which a partner is managing + # the API calls on behalf of a merchant, the partner must identify the + # merchant using either a PayPal-Auth-Assertion header or an access token + # with target_subject. + # @return [ApiResponse] Complete http response with raw body and status code. + def get_authorized_payment(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/v2/payments/authorizations/{authorization_id}', + Server::DEFAULT) + .template_param(new_parameter(options['authorization_id'], key: 'authorization_id') + .should_encode(true)) + .header_param(new_parameter(options['paypal_mock_response'], key: 'PayPal-Mock-Response')) + .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) + .header_param(new_parameter('application/json', key: 'accept')) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(PaymentAuthorization.method(:from_hash)) + .is_api_response(true) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + ErrorException) + .local_error('403', + 'The request failed because the caller has insufficient'\ + ' permissions.', + ErrorException) + .local_error('404', + 'The request failed because the resource does not exist.', + ErrorException) + .local_error('500', + 'The request failed because an internal server error occurred.', + APIException) + .local_error('default', + 'The error response.', + ErrorException)) + .execute + end + # Captures an authorized payment, by ID. # @param [String] authorization_id Required parameter: The PayPal-generated # ID for the authorized payment to capture. @@ -31,9 +82,9 @@ class PaymentsController < BaseController # with target_subject. # @param [CaptureRequest] body Optional parameter: TODO: type description # here - # @return [ApiResponse] the complete http response with raw body and status code. + # @return [ApiResponse] Complete http response with raw body and status code. def capture_authorized_payment(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/v2/payments/authorizations/{authorization_id}/capture', Server::DEFAULT) @@ -84,48 +135,6 @@ def capture_authorized_payment(options = {}) .execute end - # Shows details for a captured payment, by ID. - # @param [String] capture_id Required parameter: The PayPal-generated ID for - # the captured payment for which to show details. - # @param [String] paypal_mock_response Optional parameter: PayPal's REST API - # uses a request header to invoke negative testing in the sandbox. This - # header configures the sandbox into a negative testing state for - # transactions that include the merchant. - # @return [ApiResponse] the complete http response with raw body and status code. - def get_captured_payment(options = {}) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::GET, - '/v2/payments/captures/{capture_id}', - Server::DEFAULT) - .template_param(new_parameter(options['capture_id'], key: 'capture_id') - .should_encode(true)) - .header_param(new_parameter(options['paypal_mock_response'], key: 'PayPal-Mock-Response')) - .header_param(new_parameter('application/json', key: 'accept')) - .auth(Single.new('Oauth2'))) - .response(new_response_handler - .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(CapturedPayment.method(:from_hash)) - .is_api_response(true) - .local_error('401', - 'Authentication failed due to missing authorization header, or'\ - ' invalid authentication credentials.', - ErrorException) - .local_error('403', - 'The request failed because the caller has insufficient'\ - ' permissions.', - ErrorException) - .local_error('404', - 'The request failed because the resource does not exist.', - ErrorException) - .local_error('500', - 'The request failed because an internal server error occurred.', - APIException) - .local_error('default', - 'The error response.', - ErrorException)) - .execute - end - # Reauthorizes an authorized PayPal account payment, by ID. To ensure that # funds are still available, reauthorize a payment after its initial # three-day honor period expires. Within the 29-day authorization period, @@ -137,8 +146,7 @@ def get_captured_payment(options = {}) # 29 days after the 3-day honor period. The allowed amount depends on # context and geography, for example in US it is up to 115% of the original # authorized amount, not to exceed an increase of $75 USD. Supports only the - # `amount` request parameter. Note: This request is currently not supported - # for Partner use cases. + # `amount` request parameter. # @param [String] authorization_id Required parameter: The PayPal-generated # ID for the authorized payment to reauthorize. # @param [String] paypal_request_id Optional parameter: The server stores @@ -159,9 +167,9 @@ def get_captured_payment(options = {}) # with target_subject. # @param [ReauthorizeRequest] body Optional parameter: TODO: type # description here - # @return [ApiResponse] the complete http response with raw body and status code. + # @return [ApiResponse] Complete http response with raw body and status code. def reauthorize_payment(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/v2/payments/authorizations/{authorization_id}/reauthorize', Server::DEFAULT) @@ -187,6 +195,10 @@ def reauthorize_payment(options = {}) 'Authentication failed due to missing authorization header, or'\ ' invalid authentication credentials.', ErrorException) + .local_error('403', + 'The request failed because the caller has insufficient'\ + ' permissions.', + ErrorException) .local_error('404', 'The request failed because the resource does not exist.', ErrorException) @@ -227,9 +239,9 @@ def reauthorize_payment(options = {}) # API caller and the server. A minimal response includes the id, status and # HATEOAS links. return=representation. The server returns a complete # resource representation, including the current state of the resource. - # @return [ApiResponse] the complete http response with raw body and status code. + # @return [ApiResponse] Complete http response with raw body and status code. def void_payment(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/v2/payments/authorizations/{authorization_id}/void', Server::DEFAULT) @@ -274,6 +286,48 @@ def void_payment(options = {}) .execute end + # Shows details for a captured payment, by ID. + # @param [String] capture_id Required parameter: The PayPal-generated ID for + # the captured payment for which to show details. + # @param [String] paypal_mock_response Optional parameter: PayPal's REST API + # uses a request header to invoke negative testing in the sandbox. This + # header configures the sandbox into a negative testing state for + # transactions that include the merchant. + # @return [ApiResponse] Complete http response with raw body and status code. + def get_captured_payment(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/v2/payments/captures/{capture_id}', + Server::DEFAULT) + .template_param(new_parameter(options['capture_id'], key: 'capture_id') + .should_encode(true)) + .header_param(new_parameter(options['paypal_mock_response'], key: 'PayPal-Mock-Response')) + .header_param(new_parameter('application/json', key: 'accept')) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(CapturedPayment.method(:from_hash)) + .is_api_response(true) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + ErrorException) + .local_error('403', + 'The request failed because the caller has insufficient'\ + ' permissions.', + ErrorException) + .local_error('404', + 'The request failed because the resource does not exist.', + ErrorException) + .local_error('500', + 'The request failed because an internal server error occurred.', + APIException) + .local_error('default', + 'The error response.', + ErrorException)) + .execute + end + # Refunds a captured payment, by ID. For a full refund, include an empty # payload in the JSON request body. For a partial refund, include an amount # object in the JSON request body. @@ -301,9 +355,9 @@ def void_payment(options = {}) # with target_subject. # @param [RefundRequest] body Optional parameter: TODO: type description # here - # @return [ApiResponse] the complete http response with raw body and status code. + # @return [ApiResponse] Complete http response with raw body and status code. def refund_captured_payment(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/v2/payments/captures/{capture_id}/refund', Server::DEFAULT) @@ -354,53 +408,6 @@ def refund_captured_payment(options = {}) .execute end - # Shows details for an authorized payment, by ID. - # @param [String] authorization_id Required parameter: The ID of the - # authorized payment for which to show details. - # @param [String] paypal_mock_response Optional parameter: PayPal's REST API - # uses a request header to invoke negative testing in the sandbox. This - # header configures the sandbox into a negative testing state for - # transactions that include the merchant. - # @param [String] paypal_auth_assertion Optional parameter: An - # API-caller-provided JSON Web Token (JWT) assertion that identifies the - # merchant. For details, see - # [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-asse - # rtion). Note:For three party transactions in which a partner is managing - # the API calls on behalf of a merchant, the partner must identify the - # merchant using either a PayPal-Auth-Assertion header or an access token - # with target_subject. - # @return [ApiResponse] the complete http response with raw body and status code. - def get_authorized_payment(options = {}) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::GET, - '/v2/payments/authorizations/{authorization_id}', - Server::DEFAULT) - .template_param(new_parameter(options['authorization_id'], key: 'authorization_id') - .should_encode(true)) - .header_param(new_parameter(options['paypal_mock_response'], key: 'PayPal-Mock-Response')) - .header_param(new_parameter(options['paypal_auth_assertion'], key: 'PayPal-Auth-Assertion')) - .header_param(new_parameter('application/json', key: 'accept')) - .auth(Single.new('Oauth2'))) - .response(new_response_handler - .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(PaymentAuthorization.method(:from_hash)) - .is_api_response(true) - .local_error('401', - 'Authentication failed due to missing authorization header, or'\ - ' invalid authentication credentials.', - ErrorException) - .local_error('404', - 'The request failed because the resource does not exist.', - ErrorException) - .local_error('500', - 'The request failed because an internal server error occurred.', - APIException) - .local_error('default', - 'The error response.', - ErrorException)) - .execute - end - # Shows details for a refund, by ID. # @param [String] refund_id Required parameter: The PayPal-generated ID for # the refund for which to show details. @@ -416,9 +423,9 @@ def get_authorized_payment(options = {}) # the API calls on behalf of a merchant, the partner must identify the # merchant using either a PayPal-Auth-Assertion header or an access token # with target_subject. - # @return [ApiResponse] the complete http response with raw body and status code. + # @return [ApiResponse] Complete http response with raw body and status code. def get_refund(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/v2/payments/refunds/{refund_id}', Server::DEFAULT) diff --git a/lib/paypal_server_sdk/controllers/subscriptions_controller.rb b/lib/paypal_server_sdk/controllers/subscriptions_controller.rb new file mode 100644 index 0000000..0efdf09 --- /dev/null +++ b/lib/paypal_server_sdk/controllers/subscriptions_controller.rb @@ -0,0 +1,843 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # SubscriptionsController + class SubscriptionsController < BaseController + # Creates a plan that defines pricing and billing cycle details for + # subscriptions. + # @param [String] prefer Optional parameter: The preferred server response + # upon successful completion of the request. Value is: return=minimal. The + # server returns a minimal response to optimize communication between the + # API caller and the server. A minimal response includes the id, status and + # HATEOAS links. return=representation. The server returns a complete + # resource representation, including the current state of the resource. + # @param [String] paypal_request_id Optional parameter: The server stores + # keys for 72 hours. + # @param [PlanRequest] body Optional parameter: TODO: type description + # here + # @return [ApiResponse] Complete http response with raw body and status code. + def create_billing_plan(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v1/billing/plans', + Server::DEFAULT) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .header_param(new_parameter(options['prefer'], key: 'Prefer')) + .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) + .body_param(new_parameter(options['body'])) + .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(BillingPlan.method(:from_hash)) + .is_api_response(true) + .local_error('400', + 'Bad Request. Request is not well-formed, syntactically'\ + ' incorrect, or violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Lists billing plans. + # @param [String] prefer Optional parameter: The preferred server response + # upon successful completion of the request. Value is: return=minimal. The + # server returns a minimal response to optimize communication between the + # API caller and the server. A minimal response includes the id, name, + # description and HATEOAS links. return=representation. The server returns a + # complete resource representation, including the current state of the + # resource. + # @param [String] product_id Optional parameter: Filters the response by a + # Product ID. + # @param [Integer] page_size Optional parameter: The number of items to + # return in the response. + # @param [Integer] page Optional parameter: A non-zero integer which is the + # start index of the entire list of items to return in the response. The + # combination of `page=1` and `page_size=20` returns the first 20 items. The + # combination of `page=2` and `page_size=20` returns the next 20 items. + # @param [TrueClass | FalseClass] total_required Optional parameter: + # Indicates whether to show the total count in the response. + # @return [ApiResponse] Complete http response with raw body and status code. + def list_billing_plans(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/v1/billing/plans', + Server::DEFAULT) + .header_param(new_parameter(options['prefer'], key: 'Prefer')) + .query_param(new_parameter(options['product_id'], key: 'product_id')) + .query_param(new_parameter(options['page_size'], key: 'page_size')) + .query_param(new_parameter(options['page'], key: 'page')) + .query_param(new_parameter(options['total_required'], key: 'total_required')) + .header_param(new_parameter('application/json', key: 'accept')) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(PlanCollection.method(:from_hash)) + .is_api_response(true) + .local_error('400', + 'Request is not well-formed, syntactically incorrect, or'\ + ' violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Shows details for a plan, by ID. + # @param [String] id Required parameter: The ID of the plan. + # @return [ApiResponse] Complete http response with raw body and status code. + def get_billing_plan(id) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/v1/billing/plans/{id}', + Server::DEFAULT) + .template_param(new_parameter(id, key: 'id') + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'accept')) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(BillingPlan.method(:from_hash)) + .is_api_response(true) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Updates a plan with the `CREATED` or `ACTIVE` status. For an `INACTIVE` + # plan, you can make only status updates. You can patch these attributes and + # objects: Attribute or object Operations description replace + # payment_preferences.auto_bill_outstanding replace taxes.percentage replace + # payment_preferences.payment_failure_threshold replace + # payment_preferences.setup_fee replace + # payment_preferences.setup_fee_failure_action replace name replace + # @param [String] id Required parameter: The ID of the plan. + # @param [Array[Patch]] body Optional parameter: TODO: type description + # here + # @return [ApiResponse] Complete http response with raw body and status code. + def patch_billing_plan(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::PATCH, + '/v1/billing/plans/{id}', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .is_response_void(true) + .is_api_response(true) + .local_error('400', + 'Request is not well-formed, syntactically incorrect, or'\ + ' violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Activates a plan, by ID. + # @param [String] id Required parameter: The ID of the plan. + # @return [ApiResponse] Complete http response with raw body and status code. + def activate_billing_plan(id) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v1/billing/plans/{id}/activate', + Server::DEFAULT) + .template_param(new_parameter(id, key: 'id') + .should_encode(true)) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .is_response_void(true) + .is_api_response(true) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Deactivates a plan, by ID. + # @param [String] id Required parameter: The ID of the plan. + # @return [ApiResponse] Complete http response with raw body and status code. + def deactivate_billing_plan(id) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v1/billing/plans/{id}/deactivate', + Server::DEFAULT) + .template_param(new_parameter(id, key: 'id') + .should_encode(true)) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .is_response_void(true) + .is_api_response(true) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Updates pricing for a plan. For example, you can update a regular billing + # cycle from $5 per month to $7 per month. + # @param [String] id Required parameter: The ID for the plan. + # @param [UpdatePricingSchemesRequest] body Optional parameter: TODO: type + # description here + # @return [ApiResponse] Complete http response with raw body and status code. + def update_billing_plan_pricing_schemes(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v1/billing/plans/{id}/update-pricing-schemes', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .is_response_void(true) + .is_api_response(true) + .local_error('400', + 'Bad Request. Request is not well-formed, syntactically'\ + ' incorrect, or violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Creates a subscription. + # @param [String] prefer Optional parameter: The preferred server response + # upon successful completion of the request. Value is: return=minimal. The + # server returns a minimal response to optimize communication between the + # API caller and the server. A minimal response includes the id, status and + # HATEOAS links. return=representation. The server returns a complete + # resource representation, including the current state of the resource. + # @param [String] paypal_request_id Optional parameter: The server stores + # keys for 72 hours. + # @param [String] paypal_client_metadata_id Optional parameter: The PayPal + # Client Metadata Id(CMID) is used to provide device-specific information to + # PayPal's risk engine. This is crucial for transactions that require + # device-specific risk assessments. Merchants typically use the Paypal SDK + # that automatically submits the CMID or they use tools like Fraudnet JS for + # web or Magnes JS for mobile to generate the CMID on the frontend and then + # pass it to the API as part of the request headers. + # @param [CreateSubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [ApiResponse] Complete http response with raw body and status code. + def create_subscription(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v1/billing/subscriptions', + Server::DEFAULT) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .header_param(new_parameter(options['prefer'], key: 'Prefer')) + .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) + .header_param(new_parameter(options['paypal_client_metadata_id'], key: 'PayPal-Client-Metadata-Id')) + .body_param(new_parameter(options['body'])) + .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(Subscription.method(:from_hash)) + .is_api_response(true) + .local_error('400', + 'Bad Request. Request is not well-formed, syntactically'\ + ' incorrect, or violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # List all subscriptions for merchant account. + # @param [String] plan_ids Optional parameter: Filters the response by list + # of plan IDs. Filter supports upto 70 plan IDs. URLs should not exceed a + # length of 2000 characters. + # @param [String] statuses Optional parameter: Filters the response by list + # of subscription statuses. + # @param [String] created_after Optional parameter: Filters the response by + # subscription creation start time for a range of subscriptions. + # @param [String] created_before Optional parameter: Filters the response by + # subscription creation end time for a range of subscriptions. + # @param [String] status_updated_before Optional parameter: Filters the + # response by status update start time for a range of subscriptions. + # @param [String] status_updated_after Optional parameter: Filters the + # response by status update end time for a range of subscriptions. + # @param [String] filter Optional parameter: Filter the response using + # complex expressions that could use comparison operators like ge, gt, le, + # lt and logical operators such as 'and' and 'or'. + # @param [Integer] page_size Optional parameter: The number of items to + # return in the response. + # @param [Integer] page Optional parameter: A non-zero integer which is the + # start index of the entire list of items to return in the response. The + # combination of `page=1` and `page_size=20` returns the first 20 items. The + # combination of `page=2` and `page_size=20` returns the next 20 items. + # @param [Array[String]] customer_ids Optional parameter: Filters the + # response by comma separated vault customer IDs (FSS subscriptions only). + # @return [ApiResponse] Complete http response with raw body and status code. + def list_subscriptions(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/v1/billing/subscriptions', + Server::DEFAULT) + .query_param(new_parameter(options['plan_ids'], key: 'plan_ids')) + .query_param(new_parameter(options['statuses'], key: 'statuses')) + .query_param(new_parameter(options['created_after'], key: 'created_after')) + .query_param(new_parameter(options['created_before'], key: 'created_before')) + .query_param(new_parameter(options['status_updated_before'], key: 'status_updated_before')) + .query_param(new_parameter(options['status_updated_after'], key: 'status_updated_after')) + .query_param(new_parameter(options['filter'], key: 'filter')) + .query_param(new_parameter(options['page_size'], key: 'page_size')) + .query_param(new_parameter(options['page'], key: 'page')) + .query_param(new_parameter(options['customer_ids'], key: 'customer_ids')) + .header_param(new_parameter('application/json', key: 'accept')) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(SubscriptionCollection.method(:from_hash)) + .is_api_response(true) + .local_error('400', + 'Request is not well-formed, syntactically incorrect, or'\ + ' violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Shows details for a subscription, by ID. + # @param [String] id Required parameter: The ID of the subscription. + # @param [String] fields Optional parameter: List of fields that are to be + # returned in the response. Possible value for fields are + # last_failed_payment and plan. + # @return [ApiResponse] Complete http response with raw body and status code. + def get_subscription(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/v1/billing/subscriptions/{id}', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .query_param(new_parameter(options['fields'], key: 'fields')) + .header_param(new_parameter('application/json', key: 'accept')) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(Subscription.method(:from_hash)) + .is_api_response(true) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Updates a subscription which could be in ACTIVE or SUSPENDED status. You + # can override plan level default attributes by providing customised values + # for plan path in the patch request. You cannot update attributes that have + # already completed (Example - trial cycles can’t be updated if completed). + # Once overridden, changes to plan resource will not impact subscription. + # Any price update will not impact billing cycles within next 10 days + # (Applicable only for subscriptions funded by PayPal account). Following + # are the fields eligible for patch. Attribute or object Operations + # billing_info.outstanding_balance replace custom_id add,replace + # plan.billing_cycles[@sequence==n]. pricing_scheme.fixed_price add,replace + # plan.billing_cycles[@sequence==n]. pricing_scheme.tiers replace + # plan.billing_cycles[@sequence==n]. total_cycles replace + # plan.payment_preferences. auto_bill_outstanding replace + # plan.payment_preferences. payment_failure_threshold replace + # plan.taxes.inclusive add,replace plan.taxes.percentage add,replace + # shipping_amount add,replace start_time replace subscriber.shipping_address + # add,replace subscriber.payment_source (for subscriptions funded by card + # payments) replace + # @param [String] id Required parameter: The ID for the subscription. + # @param [Array[Patch]] body Optional parameter: TODO: type description + # here + # @return [ApiResponse] Complete http response with raw body and status code. + def patch_subscription(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::PATCH, + '/v1/billing/subscriptions/{id}', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .is_response_void(true) + .is_api_response(true) + .local_error('400', + 'Request is not well-formed, syntactically incorrect, or'\ + ' violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Updates the quantity of the product or service in a subscription. You can + # also use this method to switch the plan and update the `shipping_amount`, + # `shipping_address` values for the subscription. This type of update + # requires the buyer's consent. + # @param [String] id Required parameter: The ID of the subscription. + # @param [ModifySubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [ApiResponse] Complete http response with raw body and status code. + def revise_subscription(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v1/billing/subscriptions/{id}/revise', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) + .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(ModifySubscriptionResponse.method(:from_hash)) + .is_api_response(true) + .local_error('400', + 'Bad Request. Request is not well-formed, syntactically'\ + ' incorrect, or violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Suspends the subscription. + # @param [String] id Required parameter: The ID of the subscription. + # @param [SuspendSubscription] body Optional parameter: TODO: type + # description here + # @return [ApiResponse] Complete http response with raw body and status code. + def suspend_subscription(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v1/billing/subscriptions/{id}/suspend', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .is_response_void(true) + .is_api_response(true) + .local_error('400', + 'Bad Request. Request is not well-formed, syntactically'\ + ' incorrect, or violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Cancels the subscription. + # @param [String] id Required parameter: The ID of the subscription. + # @param [CancelSubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [ApiResponse] Complete http response with raw body and status code. + def cancel_subscription(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v1/billing/subscriptions/{id}/cancel', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .is_response_void(true) + .is_api_response(true) + .local_error('400', + 'Bad Request. Request is not well-formed, syntactically'\ + ' incorrect, or violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Activates the subscription. + # @param [String] id Required parameter: The ID of the subscription. + # @param [ActivateSubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [ApiResponse] Complete http response with raw body and status code. + def activate_subscription(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v1/billing/subscriptions/{id}/activate', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .is_response_void(true) + .is_api_response(true) + .local_error('400', + 'Bad Request. Request is not well-formed, syntactically'\ + ' incorrect, or violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Captures an authorized payment from the subscriber on the subscription. + # @param [String] id Required parameter: The ID of the subscription. + # @param [String] paypal_request_id Optional parameter: The server stores + # keys for 72 hours. + # @param [CaptureSubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [ApiResponse] Complete http response with raw body and status code. + def capture_subscription(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v1/billing/subscriptions/{id}/capture', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) + .body_param(new_parameter(options['body'])) + .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .is_nullable_response(true) + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(SubscriptionTransactionDetails.method(:from_hash)) + .is_api_response(true) + .local_error('400', + 'Bad Request. Request is not well-formed, syntactically'\ + ' incorrect, or violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + + # Lists transactions for a subscription. + # @param [String] id Required parameter: The ID of the subscription. + # @param [String] start_time Required parameter: The start time of the range + # of transactions to list. + # @param [String] end_time Required parameter: The end time of the range of + # transactions to list. + # @return [ApiResponse] Complete http response with raw body and status code. + def list_subscription_transactions(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/v1/billing/subscriptions/{id}/transactions', + Server::DEFAULT) + .template_param(new_parameter(options['id'], key: 'id') + .should_encode(true)) + .query_param(new_parameter(options['start_time'], key: 'start_time')) + .query_param(new_parameter(options['end_time'], key: 'end_time')) + .header_param(new_parameter('application/json', key: 'accept')) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(TransactionsList.method(:from_hash)) + .is_api_response(true) + .local_error('400', + 'Bad Request. Request is not well-formed, syntactically'\ + ' incorrect, or violates schema.', + SubscriptionErrorException) + .local_error('401', + 'Authentication failed due to missing authorization header, or'\ + ' invalid authentication credentials.', + SubscriptionErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + SubscriptionErrorException) + .local_error('404', + 'The specified resource does not exist.', + SubscriptionErrorException) + .local_error('500', + 'An internal server error has occurred.', + SubscriptionErrorException) + .local_error('default', + 'The error response.', + SubscriptionErrorException)) + .execute + end + end +end diff --git a/lib/paypal_server_sdk/controllers/transaction_search_controller.rb b/lib/paypal_server_sdk/controllers/transaction_search_controller.rb new file mode 100644 index 0000000..be665e0 --- /dev/null +++ b/lib/paypal_server_sdk/controllers/transaction_search_controller.rb @@ -0,0 +1,178 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # TransactionSearchController + class TransactionSearchController < BaseController + # Lists transactions. Specify one or more query parameters to filter the + # transaction that appear in the response. Notes: If you specify one or more + # optional query parameters, the ending_balance response field is empty. It + # takes a maximum of three hours for executed transactions to appear in the + # list transactions call. This call lists transaction for the previous three + # years. + # @param [String] start_date Required parameter: Filters the transactions in + # the response by a start date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required. Fractional seconds are optional. + # @param [String] end_date Required parameter: Filters the transactions in + # the response by an end date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required. Fractional seconds are optional. The maximum supported range is + # 31 days. + # @param [String] transaction_id Optional parameter: Filters the + # transactions in the response by a PayPal transaction ID. A valid + # transaction ID is 17 characters long, except for an order ID, which is 19 + # characters long. Note: A transaction ID is not unique in the reporting + # system. The response can list two transactions with the same ID. One + # transaction can be balance affecting while the other is non-balance + # affecting. + # @param [String] transaction_type Optional parameter: Filters the + # transactions in the response by a PayPal transaction event code. See + # [Transaction event + # codes](/docs/integration/direct/transaction-search/transaction-event-codes + # /). + # @param [String] transaction_status Optional parameter: Filters the + # transactions in the response by a PayPal transaction status code. Value + # is: Status code Description D PayPal or merchant rules denied the + # transaction. P The transaction is pending. The transaction was created but + # waits for another payment process to complete, such as an ACH transaction, + # before the status changes to S. S The transaction successfully completed + # without a denial and after any pending statuses. V A successful + # transaction was reversed and funds were refunded to the original sender. + # @param [String] transaction_amount Optional parameter: Filters the + # transactions in the response by a gross transaction amount range. Specify + # the range as ` TO `, where ` ` is the lower limit of the gross PayPal + # transaction amount and ` ` is the upper limit of the gross transaction + # amount. Specify the amounts in lower denominations. For example, to search + # for transactions from $5.00 to $10.05, specify `[500 TO 1005]`. Note:The + # values must be URL encoded. + # @param [String] transaction_currency Optional parameter: Filters the + # transactions in the response by a [three-character ISO-4217 currency + # code](/api/rest/reference/currency-codes/) for the PayPal transaction + # currency. + # @param [String] payment_instrument_type Optional parameter: Filters the + # transactions in the response by a payment instrument type. Value is + # either: CREDITCARD. Returns a direct credit card transaction with a + # corresponding value. DEBITCARD. Returns a debit card transaction with a + # corresponding value. If you omit this parameter, the API does not apply + # this filter. + # @param [String] store_id Optional parameter: Filters the transactions in + # the response by a store ID. + # @param [String] terminal_id Optional parameter: Filters the transactions + # in the response by a terminal ID. + # @param [String] fields Optional parameter: Indicates which fields appear + # in the response. Value is a single field or a comma-separated list of + # fields. The transaction_info value returns only the transaction details in + # the response. To include all fields in the response, specify fields=all. + # Valid fields are: transaction_info. The transaction information. Includes + # the ID of the PayPal account of the payee, the PayPal-generated + # transaction ID, the PayPal-generated base ID, the PayPal reference ID + # type, the transaction event code, the date and time when the transaction + # was initiated and was last updated, the transaction amounts including the + # PayPal fee, any discounts, insurance, the transaction status, and other + # information about the transaction. payer_info. The payer information. + # Includes the PayPal customer account ID and the payer's email address, + # primary phone number, name, country code, address, and whether the payer + # is verified or unverified. shipping_info. The shipping information. + # Includes the recipient's name, the shipping method for this order, the + # shipping address for this order, and the secondary address associated with + # this order. auction_info. The auction information. Includes the name of + # the auction site, the auction site URL, the ID of the customer who makes + # the purchase in the auction, and the date and time when the auction + # closes. cart_info. The cart information. Includes an array of item + # details, whether the item amount or the shipping amount already includes + # tax, and the ID of the invoice for PayPal-generated invoices. + # incentive_info. An array of incentive detail objects. Each object includes + # the incentive, such as a special offer or coupon, the incentive amount, + # and the incentive program code that identifies a merchant loyalty or + # incentive program. store_info. The store information. Includes the ID of + # the merchant store and the terminal ID for the checkout stand in the + # merchant store. + # @param [String] balance_affecting_records_only Optional parameter: + # Indicates whether the response includes only balance-impacting + # transactions or all transactions. Value is either: Y. The default. The + # response includes only balance transactions. N. The response includes all + # transactions. + # @param [Integer] page_size Optional parameter: The number of items to + # return in the response. So, the combination of `page=1` and `page_size=20` + # returns the first 20 items. The combination of `page=2` and `page_size=20` + # returns the next 20 items. + # @param [Integer] page Optional parameter: The zero-relative start index of + # the entire list of items that are returned in the response. So, the + # combination of `page=1` and `page_size=20` returns the first 20 items. + # @return [ApiResponse] Complete http response with raw body and status code. + def search_transactions(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/v1/reporting/transactions', + Server::DEFAULT) + .query_param(new_parameter(options['start_date'], key: 'start_date')) + .query_param(new_parameter(options['end_date'], key: 'end_date')) + .query_param(new_parameter(options['transaction_id'], key: 'transaction_id')) + .query_param(new_parameter(options['transaction_type'], key: 'transaction_type')) + .query_param(new_parameter(options['transaction_status'], key: 'transaction_status')) + .query_param(new_parameter(options['transaction_amount'], key: 'transaction_amount')) + .query_param(new_parameter(options['transaction_currency'], key: 'transaction_currency')) + .query_param(new_parameter(options['payment_instrument_type'], key: 'payment_instrument_type')) + .query_param(new_parameter(options['store_id'], key: 'store_id')) + .query_param(new_parameter(options['terminal_id'], key: 'terminal_id')) + .query_param(new_parameter(options['fields'], key: 'fields')) + .query_param(new_parameter(options['balance_affecting_records_only'], key: 'balance_affecting_records_only')) + .query_param(new_parameter(options['page_size'], key: 'page_size')) + .query_param(new_parameter(options['page'], key: 'page')) + .header_param(new_parameter('application/json', key: 'accept')) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(SearchResponse.method(:from_hash)) + .is_api_response(true) + .local_error('default', + 'The error response.', + SearchErrorException)) + .execute + end + + # List all balances. Specify date time to list balances for that time that + # appear in the response. Notes: It takes a maximum of three hours for + # balances to appear in the list balances call. This call lists balances + # upto the previous three years. + # @param [String] as_of_time Optional parameter: List balances in the + # response at the date time provided, will return the last refreshed balance + # in the system when not provided. + # @param [String] currency_code Optional parameter: Filters the transactions + # in the response by a [three-character ISO-4217 currency + # code](/api/rest/reference/currency-codes/) for the PayPal transaction + # currency. + # @return [ApiResponse] Complete http response with raw body and status code. + def search_balances(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/v1/reporting/balances', + Server::DEFAULT) + .query_param(new_parameter(options['as_of_time'], key: 'as_of_time')) + .query_param(new_parameter(options['currency_code'], key: 'currency_code')) + .header_param(new_parameter('application/json', key: 'accept')) + .auth(Single.new('Oauth2'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(BalancesResponse.method(:from_hash)) + .is_api_response(true) + .local_error('400', + 'The request is not well-formed, is syntactically incorrect, or'\ + ' violates schema.', + DefaultErrorException) + .local_error('403', + 'Authorization failed due to insufficient permissions.', + DefaultErrorException) + .local_error('500', + 'An internal server error occurred.', + DefaultErrorException) + .local_error('default', + 'The error response.', + DefaultErrorException)) + .execute + end + end +end diff --git a/lib/paypal_server_sdk/controllers/vault_controller.rb b/lib/paypal_server_sdk/controllers/vault_controller.rb index 69fbe76..e8e6de0 100644 --- a/lib/paypal_server_sdk/controllers/vault_controller.rb +++ b/lib/paypal_server_sdk/controllers/vault_controller.rb @@ -1,24 +1,32 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # VaultController class VaultController < BaseController - # Delete the payment token associated with the payment token id. - # @param [String] id Required parameter: ID of the payment token. - # @return [ApiResponse] the complete http response with raw body and status code. - def delete_payment_token(id) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::DELETE, - '/v3/vault/payment-tokens/{id}', + # Creates a Payment Token from the given payment source and adds it to the + # Vault of the associated customer. + # @param [PaymentTokenRequest] body Required parameter: Payment Token + # creation with a financial instrument and an optional customer_id. + # @param [String] paypal_request_id Optional parameter: The server stores + # keys for 3 hours. + # @return [ApiResponse] Complete http response with raw body and status code. + def create_payment_token(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v3/vault/payment-tokens', Server::DEFAULT) - .template_param(new_parameter(id, key: 'id') - .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) + .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) + .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) .response(new_response_handler - .is_response_void(true) + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(PaymentTokenResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Request is not well-formed, syntactically incorrect, or'\ @@ -27,34 +35,45 @@ def delete_payment_token(id) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) + .local_error('404', + 'Request contains reference to resources that do not exist.', + ErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + ErrorException) .local_error('500', 'An internal server error has occurred.', ErrorException)) .execute end - # Creates a Setup Token from the given payment source and adds it to the - # Vault of the associated customer. - # @param [SetupTokenRequest] body Required parameter: Setup Token creation - # with a instrument type optional financial instrument details and - # customer_id. - # @param [String] paypal_request_id Optional parameter: The server stores - # keys for 3 hours. - # @return [ApiResponse] the complete http response with raw body and status code. - def create_setup_token(options = {}) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::POST, - '/v3/vault/setup-tokens', + # Returns all payment tokens for a customer. + # @param [String] customer_id Required parameter: A unique identifier + # representing a specific customer in merchant's/partner's system or + # records. + # @param [Integer] page_size Optional parameter: A non-negative, non-zero + # integer indicating the maximum number of results to return at one time. + # @param [Integer] page Optional parameter: A non-negative, non-zero integer + # representing the page of the results. + # @param [TrueClass | FalseClass] total_required Optional parameter: A + # boolean indicating total number of items (total_items) and pages + # (total_pages) are expected to be returned in the response. + # @return [ApiResponse] Complete http response with raw body and status code. + def list_customer_payment_tokens(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/v3/vault/payment-tokens', Server::DEFAULT) - .header_param(new_parameter('application/json', key: 'Content-Type')) - .body_param(new_parameter(options['body'])) - .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) + .query_param(new_parameter(options['customer_id'], key: 'customer_id')) + .query_param(new_parameter(options['page_size'], key: 'page_size')) + .query_param(new_parameter(options['page'], key: 'page')) + .query_param(new_parameter(options['total_required'], key: 'total_required')) .header_param(new_parameter('application/json', key: 'accept')) - .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(SetupTokenResponse.method(:from_hash)) + .deserialize_into(CustomerVaultPaymentTokensResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Request is not well-formed, syntactically incorrect, or'\ @@ -63,24 +82,20 @@ def create_setup_token(options = {}) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) - .local_error('422', - 'The requested action could not be performed, semantically'\ - ' incorrect, or failed business validation.', - ErrorException) .local_error('500', 'An internal server error has occurred.', ErrorException)) .execute end - # Returns a readable representation of temporarily vaulted payment source - # associated with the setup token id. - # @param [String] id Required parameter: ID of the setup token. - # @return [ApiResponse] the complete http response with raw body and status code. - def get_setup_token(id) - new_api_call_builder + # Returns a readable representation of vaulted payment source associated + # with the payment token id. + # @param [String] id Required parameter: ID of the payment token. + # @return [ApiResponse] Complete http response with raw body and status code. + def get_payment_token(id) + @api_call .request(new_request_builder(HttpMethodEnum::GET, - '/v3/vault/setup-tokens/{id}', + '/v3/vault/payment-tokens/{id}', Server::DEFAULT) .template_param(new_parameter(id, key: 'id') .should_encode(true)) @@ -88,7 +103,7 @@ def get_setup_token(id) .auth(Single.new('Oauth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(SetupTokenResponse.method(:from_hash)) + .deserialize_into(PaymentTokenResponse.method(:from_hash)) .is_api_response(true) .local_error('403', 'Authorization failed due to insufficient permissions.', @@ -106,27 +121,19 @@ def get_setup_token(id) .execute end - # Creates a Payment Token from the given payment source and adds it to the - # Vault of the associated customer. - # @param [PaymentTokenRequest] body Required parameter: Payment Token - # creation with a financial instrument and an optional customer_id. - # @param [String] paypal_request_id Optional parameter: The server stores - # keys for 3 hours. - # @return [ApiResponse] the complete http response with raw body and status code. - def create_payment_token(options = {}) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::POST, - '/v3/vault/payment-tokens', + # Delete the payment token associated with the payment token id. + # @param [String] id Required parameter: ID of the payment token. + # @return [ApiResponse] Complete http response with raw body and status code. + def delete_payment_token(id) + @api_call + .request(new_request_builder(HttpMethodEnum::DELETE, + '/v3/vault/payment-tokens/{id}', Server::DEFAULT) - .header_param(new_parameter('application/json', key: 'Content-Type')) - .body_param(new_parameter(options['body'])) - .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) - .header_param(new_parameter('application/json', key: 'accept')) - .body_serializer(proc do |param| param.to_json unless param.nil? end) + .template_param(new_parameter(id, key: 'id') + .should_encode(true)) .auth(Single.new('Oauth2'))) .response(new_response_handler - .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(PaymentTokenResponse.method(:from_hash)) + .is_response_void(true) .is_api_response(true) .local_error('400', 'Request is not well-formed, syntactically incorrect, or'\ @@ -135,45 +142,34 @@ def create_payment_token(options = {}) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) - .local_error('404', - 'Request contains reference to resources that do not exist.', - ErrorException) - .local_error('422', - 'The requested action could not be performed, semantically'\ - ' incorrect, or failed business validation.', - ErrorException) .local_error('500', 'An internal server error has occurred.', ErrorException)) .execute end - # Returns all payment tokens for a customer. - # @param [String] customer_id Required parameter: A unique identifier - # representing a specific customer in merchant's/partner's system or - # records. - # @param [Integer] page_size Optional parameter: A non-negative, non-zero - # integer indicating the maximum number of results to return at one time. - # @param [Integer] page Optional parameter: A non-negative, non-zero integer - # representing the page of the results. - # @param [TrueClass | FalseClass] total_required Optional parameter: A - # boolean indicating total number of items (total_items) and pages - # (total_pages) are expected to be returned in the response. - # @return [ApiResponse] the complete http response with raw body and status code. - def list_customer_payment_tokens(options = {}) - new_api_call_builder - .request(new_request_builder(HttpMethodEnum::GET, - '/v3/vault/payment-tokens', + # Creates a Setup Token from the given payment source and adds it to the + # Vault of the associated customer. + # @param [SetupTokenRequest] body Required parameter: Setup Token creation + # with a instrument type optional financial instrument details and + # customer_id. + # @param [String] paypal_request_id Optional parameter: The server stores + # keys for 3 hours. + # @return [ApiResponse] Complete http response with raw body and status code. + def create_setup_token(options = {}) + @api_call + .request(new_request_builder(HttpMethodEnum::POST, + '/v3/vault/setup-tokens', Server::DEFAULT) - .query_param(new_parameter(options['customer_id'], key: 'customer_id')) - .query_param(new_parameter(options['page_size'], key: 'page_size')) - .query_param(new_parameter(options['page'], key: 'page')) - .query_param(new_parameter(options['total_required'], key: 'total_required')) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(options['body'])) + .header_param(new_parameter(options['paypal_request_id'], key: 'PayPal-Request-Id')) .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('Oauth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(CustomerVaultPaymentTokensResponse.method(:from_hash)) + .deserialize_into(SetupTokenResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Request is not well-formed, syntactically incorrect, or'\ @@ -182,20 +178,24 @@ def list_customer_payment_tokens(options = {}) .local_error('403', 'Authorization failed due to insufficient permissions.', ErrorException) + .local_error('422', + 'The requested action could not be performed, semantically'\ + ' incorrect, or failed business validation.', + ErrorException) .local_error('500', 'An internal server error has occurred.', ErrorException)) .execute end - # Returns a readable representation of vaulted payment source associated - # with the payment token id. - # @param [String] id Required parameter: ID of the payment token. - # @return [ApiResponse] the complete http response with raw body and status code. - def get_payment_token(id) - new_api_call_builder + # Returns a readable representation of temporarily vaulted payment source + # associated with the setup token id. + # @param [String] id Required parameter: ID of the setup token. + # @return [ApiResponse] Complete http response with raw body and status code. + def get_setup_token(id) + @api_call .request(new_request_builder(HttpMethodEnum::GET, - '/v3/vault/payment-tokens/{id}', + '/v3/vault/setup-tokens/{id}', Server::DEFAULT) .template_param(new_parameter(id, key: 'id') .should_encode(true)) @@ -203,7 +203,7 @@ def get_payment_token(id) .auth(Single.new('Oauth2'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) - .deserialize_into(PaymentTokenResponse.method(:from_hash)) + .deserialize_into(SetupTokenResponse.method(:from_hash)) .is_api_response(true) .local_error('403', 'Authorization failed due to insufficient permissions.', diff --git a/lib/paypal_server_sdk/exceptions/api_exception.rb b/lib/paypal_server_sdk/exceptions/api_exception.rb index c9c9329..385298c 100644 --- a/lib/paypal_server_sdk/exceptions/api_exception.rb +++ b/lib/paypal_server_sdk/exceptions/api_exception.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Class for exceptions when there is a network error, status code error, etc. diff --git a/lib/paypal_server_sdk/exceptions/default_error_exception.rb b/lib/paypal_server_sdk/exceptions/default_error_exception.rb new file mode 100644 index 0000000..3ad91c0 --- /dev/null +++ b/lib/paypal_server_sdk/exceptions/default_error_exception.rb @@ -0,0 +1,95 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The error details. + class DefaultErrorException < APIException + SKIP = Object.new + private_constant :SKIP + + # The human-readable, unique name of the error. + # @return [String] + attr_accessor :name + + # The message that describes the error. + # @return [String] + attr_accessor :message + + # The PayPal internal ID. Used for correlation purposes. + # @return [String] + attr_accessor :debug_id + + # The information link, or URI, that shows detailed information about this + # error for the developer. + # @return [String] + attr_accessor :information_link + + # An array of additional details about the error. + # @return [Array[TransactionSearchErrorDetails]] + attr_accessor :details + + # An array of request-related [HATEOAS + # links](/docs/api/reference/api-responses/#hateoas-links). + # @return [Array[LinkDescription]] + attr_accessor :links + + # The constructor. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. + def initialize(reason, response) + super(reason, response) + hash = APIHelper.json_deserialize(@response.raw_body) + unbox(hash) + end + + # Populates this object by extracting properties from a hash. + # @param [Hash] hash The deserialized response sent by the server in the + # response body. + def unbox(hash) + return nil unless hash + + @name = hash.key?('name') ? hash['name'] : nil + @message = hash.key?('message') ? hash['message'] : nil + @debug_id = hash.key?('debug_id') ? hash['debug_id'] : nil + @information_link = + hash.key?('information_link') ? hash['information_link'] : SKIP + # Parameter is an array, so we need to iterate through it + @details = nil + unless hash['details'].nil? + @details = [] + hash['details'].each do |structure| + @details << (TransactionSearchErrorDetails.from_hash(structure) if structure) + end + end + + @details = SKIP unless hash.key?('details') + # Parameter is an array, so we need to iterate through it + @links = nil + unless hash['links'].nil? + @links = [] + hash['links'].each do |structure| + @links << (LinkDescription.from_hash(structure) if structure) + end + end + + @links = SKIP unless hash.key?('links') + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name}, message: #{@message}, debug_id: #{@debug_id},"\ + " information_link: #{@information_link}, details: #{@details}, links: #{@links}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name.inspect}, message: #{@message.inspect}, debug_id:"\ + " #{@debug_id.inspect}, information_link: #{@information_link.inspect}, details:"\ + " #{@details.inspect}, links: #{@links.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/exceptions/error_exception.rb b/lib/paypal_server_sdk/exceptions/error_exception.rb index 00afae8..0d610a2 100644 --- a/lib/paypal_server_sdk/exceptions/error_exception.rb +++ b/lib/paypal_server_sdk/exceptions/error_exception.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The error details. diff --git a/lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb b/lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb index 67cd1f0..de33e62 100644 --- a/lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb +++ b/lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # OAuth 2 Authorization endpoint exception. diff --git a/lib/paypal_server_sdk/exceptions/search_error_exception.rb b/lib/paypal_server_sdk/exceptions/search_error_exception.rb new file mode 100644 index 0000000..a9c38ab --- /dev/null +++ b/lib/paypal_server_sdk/exceptions/search_error_exception.rb @@ -0,0 +1,107 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The error details. + class SearchErrorException < APIException + SKIP = Object.new + private_constant :SKIP + + # The human-readable, unique name of the error. + # @return [String] + attr_accessor :name + + # The message that describes the error. + # @return [String] + attr_accessor :message + + # The PayPal internal ID. Used for correlation purposes. + # @return [String] + attr_accessor :debug_id + + # The information link, or URI, that shows detailed information about this + # error for the developer. + # @return [String] + attr_accessor :information_link + + # An array of additional details about the error. + # @return [Array[TransactionSearchErrorDetails]] + attr_accessor :details + + # An array of request-related [HATEOAS + # links](/docs/api/reference/api-responses/#hateoas-links). + # @return [Array[LinkDescription]] + attr_accessor :links + + # The total number of transactions. Valid only for `RESULTSET_TOO_LARGE`. + # @return [Integer] + attr_accessor :total_items + + # The maximum number of transactions. Valid only for `RESULTSET_TOO_LARGE`. + # @return [Integer] + attr_accessor :maximum_items + + # The constructor. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. + def initialize(reason, response) + super(reason, response) + hash = APIHelper.json_deserialize(@response.raw_body) + unbox(hash) + end + + # Populates this object by extracting properties from a hash. + # @param [Hash] hash The deserialized response sent by the server in the + # response body. + def unbox(hash) + return nil unless hash + + @name = hash.key?('name') ? hash['name'] : nil + @message = hash.key?('message') ? hash['message'] : nil + @debug_id = hash.key?('debug_id') ? hash['debug_id'] : nil + @information_link = + hash.key?('information_link') ? hash['information_link'] : SKIP + # Parameter is an array, so we need to iterate through it + @details = nil + unless hash['details'].nil? + @details = [] + hash['details'].each do |structure| + @details << (TransactionSearchErrorDetails.from_hash(structure) if structure) + end + end + + @details = SKIP unless hash.key?('details') + # Parameter is an array, so we need to iterate through it + @links = nil + unless hash['links'].nil? + @links = [] + hash['links'].each do |structure| + @links << (LinkDescription.from_hash(structure) if structure) + end + end + + @links = SKIP unless hash.key?('links') + @total_items = hash.key?('total_items') ? hash['total_items'] : SKIP + @maximum_items = hash.key?('maximum_items') ? hash['maximum_items'] : SKIP + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name}, message: #{@message}, debug_id: #{@debug_id},"\ + " information_link: #{@information_link}, details: #{@details}, links: #{@links},"\ + " total_items: #{@total_items}, maximum_items: #{@maximum_items}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name.inspect}, message: #{@message.inspect}, debug_id:"\ + " #{@debug_id.inspect}, information_link: #{@information_link.inspect}, details:"\ + " #{@details.inspect}, links: #{@links.inspect}, total_items: #{@total_items.inspect},"\ + " maximum_items: #{@maximum_items.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/exceptions/subscription_error_exception.rb b/lib/paypal_server_sdk/exceptions/subscription_error_exception.rb new file mode 100644 index 0000000..52a568c --- /dev/null +++ b/lib/paypal_server_sdk/exceptions/subscription_error_exception.rb @@ -0,0 +1,95 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The error details. + class SubscriptionErrorException < APIException + SKIP = Object.new + private_constant :SKIP + + # The human-readable, unique name of the error. + # @return [String] + attr_accessor :name + + # The message that describes the error. + # @return [String] + attr_accessor :message + + # The PayPal internal ID. Used for correlation purposes. + # @return [String] + attr_accessor :debug_id + + # The information link, or URI, that shows detailed information about this + # error for the developer. + # @return [String] + attr_accessor :information_link + + # An array of additional details about the error. + # @return [Array[ErrorDetails]] + attr_accessor :details + + # An array of request-related [HATEOAS + # links](/api/rest/responses/#hateoas-links). + # @return [Array[LinkDescription]] + attr_accessor :links + + # The constructor. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. + def initialize(reason, response) + super(reason, response) + hash = APIHelper.json_deserialize(@response.raw_body) + unbox(hash) + end + + # Populates this object by extracting properties from a hash. + # @param [Hash] hash The deserialized response sent by the server in the + # response body. + def unbox(hash) + return nil unless hash + + @name = hash.key?('name') ? hash['name'] : nil + @message = hash.key?('message') ? hash['message'] : nil + @debug_id = hash.key?('debug_id') ? hash['debug_id'] : nil + @information_link = + hash.key?('information_link') ? hash['information_link'] : SKIP + # Parameter is an array, so we need to iterate through it + @details = nil + unless hash['details'].nil? + @details = [] + hash['details'].each do |structure| + @details << (ErrorDetails.from_hash(structure) if structure) + end + end + + @details = SKIP unless hash.key?('details') + # Parameter is an array, so we need to iterate through it + @links = nil + unless hash['links'].nil? + @links = [] + hash['links'].each do |structure| + @links << (LinkDescription.from_hash(structure) if structure) + end + end + + @links = SKIP unless hash.key?('links') + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name}, message: #{@message}, debug_id: #{@debug_id},"\ + " information_link: #{@information_link}, details: #{@details}, links: #{@links}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name.inspect}, message: #{@message.inspect}, debug_id:"\ + " #{@debug_id.inspect}, information_link: #{@information_link.inspect}, details:"\ + " #{@details.inspect}, links: #{@links.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/http/api_response.rb b/lib/paypal_server_sdk/http/api_response.rb index 9c13ce1..034c233 100644 --- a/lib/paypal_server_sdk/http/api_response.rb +++ b/lib/paypal_server_sdk/http/api_response.rb @@ -1,13 +1,11 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Http response received. class ApiResponse < CoreLibrary::ApiResponse - - # The constructor # @param [HttpResponse] http_response The original, raw response from the api. # @param [Object] data The data field specified for the response. diff --git a/lib/paypal_server_sdk/http/auth/o_auth2.rb b/lib/paypal_server_sdk/http/auth/o_auth2.rb index 25128bd..9490b73 100644 --- a/lib/paypal_server_sdk/http/auth/o_auth2.rb +++ b/lib/paypal_server_sdk/http/auth/o_auth2.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Utility class for OAuth 2 authorization and token management. @@ -102,7 +102,7 @@ class ClientCredentialsAuthCredentials def initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_token: nil, o_auth_token_provider: nil, o_auth_on_token_update: nil, - o_auth_clock_skew: nil) + o_auth_clock_skew: 0) raise ArgumentError, 'o_auth_client_id cannot be nil' if o_auth_client_id.nil? raise ArgumentError, 'o_auth_client_secret cannot be nil' if o_auth_client_secret.nil? diff --git a/lib/paypal_server_sdk/http/http_call_back.rb b/lib/paypal_server_sdk/http/http_call_back.rb index ab5db32..f342552 100644 --- a/lib/paypal_server_sdk/http/http_call_back.rb +++ b/lib/paypal_server_sdk/http/http_call_back.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # HttpCallBack allows defining callables for pre and post API calls. diff --git a/lib/paypal_server_sdk/http/http_method_enum.rb b/lib/paypal_server_sdk/http/http_method_enum.rb index cf297f5..d277437 100644 --- a/lib/paypal_server_sdk/http/http_method_enum.rb +++ b/lib/paypal_server_sdk/http/http_method_enum.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # HTTP Methods Enumeration. diff --git a/lib/paypal_server_sdk/http/http_request.rb b/lib/paypal_server_sdk/http/http_request.rb index 09216fa..c855e13 100644 --- a/lib/paypal_server_sdk/http/http_request.rb +++ b/lib/paypal_server_sdk/http/http_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Represents a single Http Request. diff --git a/lib/paypal_server_sdk/http/http_response.rb b/lib/paypal_server_sdk/http/http_response.rb index 742e49b..a84dde2 100644 --- a/lib/paypal_server_sdk/http/http_response.rb +++ b/lib/paypal_server_sdk/http/http_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Http response received. diff --git a/lib/paypal_server_sdk/http/proxy_settings.rb b/lib/paypal_server_sdk/http/proxy_settings.rb new file mode 100644 index 0000000..60eb47e --- /dev/null +++ b/lib/paypal_server_sdk/http/proxy_settings.rb @@ -0,0 +1,13 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + ## + # ProxySettings encapsulates HTTP proxy configuration for Faraday, + # including optional basic authentication. + # + class ProxySettings < CoreLibrary::ProxySettings + end +end diff --git a/lib/paypal_server_sdk/logging/configuration/api_logging_configuration.rb b/lib/paypal_server_sdk/logging/configuration/api_logging_configuration.rb index d891e11..f8298d0 100644 --- a/lib/paypal_server_sdk/logging/configuration/api_logging_configuration.rb +++ b/lib/paypal_server_sdk/logging/configuration/api_logging_configuration.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Initializes a new instance of RequestLoggingConfiguration. diff --git a/lib/paypal_server_sdk/logging/sdk_logger.rb b/lib/paypal_server_sdk/logging/sdk_logger.rb index 3ada560..4ca74a1 100644 --- a/lib/paypal_server_sdk/logging/sdk_logger.rb +++ b/lib/paypal_server_sdk/logging/sdk_logger.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Represents the generic logger facade diff --git a/lib/paypal_server_sdk/models/activate_subscription_request.rb b/lib/paypal_server_sdk/models/activate_subscription_request.rb new file mode 100644 index 0000000..7ed900d --- /dev/null +++ b/lib/paypal_server_sdk/models/activate_subscription_request.rb @@ -0,0 +1,63 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The activate subscription request details. + class ActivateSubscriptionRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The reason for activation of a subscription. Required to reactivate the + # subscription. + # @return [String] + attr_accessor :reason + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['reason'] = 'reason' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + reason + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(reason: SKIP) + @reason = reason unless reason == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + reason = hash.key?('reason') ? hash['reason'] : SKIP + + # Create object from extracted values. + ActivateSubscriptionRequest.new(reason: reason) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} reason: #{@reason}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} reason: #{@reason.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/activity_timestamps.rb b/lib/paypal_server_sdk/models/activity_timestamps.rb index 922cec0..c883890 100644 --- a/lib/paypal_server_sdk/models/activity_timestamps.rb +++ b/lib/paypal_server_sdk/models/activity_timestamps.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The date and time stamps that are common to authorized payment, captured diff --git a/lib/paypal_server_sdk/models/address.rb b/lib/paypal_server_sdk/models/address.rb index f943319..d3be453 100644 --- a/lib/paypal_server_sdk/models/address.rb +++ b/lib/paypal_server_sdk/models/address.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The portable international postal address. Maps to diff --git a/lib/paypal_server_sdk/models/amount_breakdown.rb b/lib/paypal_server_sdk/models/amount_breakdown.rb index 14e0c50..e4089f6 100644 --- a/lib/paypal_server_sdk/models/amount_breakdown.rb +++ b/lib/paypal_server_sdk/models/amount_breakdown.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The breakdown of the amount. Breakdown provides details such as total item @@ -41,8 +41,8 @@ class AmountBreakdown < BaseModel # @return [Money] attr_accessor :shipping_discount - # The currency and amount for a financial transaction, such as a balance or - # payment due. + # The discount amount and currency code. For list of supported currencies + # and decimal precision, see the PayPal REST APIs Currency Codes. # @return [Money] attr_accessor :discount diff --git a/lib/paypal_server_sdk/models/amount_with_breakdown.rb b/lib/paypal_server_sdk/models/amount_with_breakdown.rb index 52e0dfc..a1b87c6 100644 --- a/lib/paypal_server_sdk/models/amount_with_breakdown.rb +++ b/lib/paypal_server_sdk/models/amount_with_breakdown.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The total order amount with an optional breakdown that provides details, diff --git a/lib/paypal_server_sdk/models/app_switch_context.rb b/lib/paypal_server_sdk/models/app_switch_context.rb new file mode 100644 index 0000000..7b3a971 --- /dev/null +++ b/lib/paypal_server_sdk/models/app_switch_context.rb @@ -0,0 +1,74 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # Merchant provided details of the native app or mobile web browser to + # facilitate buyer's app switch to the PayPal consumer app. + class AppSwitchContext < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Merchant provided, buyer's native app preferences to app switch to the + # PayPal consumer app. + # @return [NativeAppContext] + attr_accessor :native_app + + # Buyer's mobile web browser context to app switch to the PayPal consumer + # app. + # @return [MobileWebContext] + attr_accessor :mobile_web + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['native_app'] = 'native_app' + @_hash['mobile_web'] = 'mobile_web' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + native_app + mobile_web + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(native_app: SKIP, mobile_web: SKIP) + @native_app = native_app unless native_app == SKIP + @mobile_web = mobile_web unless mobile_web == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + native_app = NativeAppContext.from_hash(hash['native_app']) if hash['native_app'] + mobile_web = MobileWebContext.from_hash(hash['mobile_web']) if hash['mobile_web'] + + # Create object from extracted values. + AppSwitchContext.new(native_app: native_app, + mobile_web: mobile_web) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} native_app: #{@native_app}, mobile_web: #{@mobile_web}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} native_app: #{@native_app.inspect}, mobile_web: #{@mobile_web.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/apple_pay_attributes.rb b/lib/paypal_server_sdk/models/apple_pay_attributes.rb index eaf5c91..9651a31 100644 --- a/lib/paypal_server_sdk/models/apple_pay_attributes.rb +++ b/lib/paypal_server_sdk/models/apple_pay_attributes.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Additional attributes associated with apple pay. diff --git a/lib/paypal_server_sdk/models/apple_pay_attributes_response.rb b/lib/paypal_server_sdk/models/apple_pay_attributes_response.rb index 84fbf82..865decb 100644 --- a/lib/paypal_server_sdk/models/apple_pay_attributes_response.rb +++ b/lib/paypal_server_sdk/models/apple_pay_attributes_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Additional attributes associated with the use of Apple Pay. diff --git a/lib/paypal_server_sdk/models/apple_pay_card.rb b/lib/paypal_server_sdk/models/apple_pay_card.rb index ff77c38..1adfb76 100644 --- a/lib/paypal_server_sdk/models/apple_pay_card.rb +++ b/lib/paypal_server_sdk/models/apple_pay_card.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment card to be used to fund a payment. Can be a credit or debit diff --git a/lib/paypal_server_sdk/models/apple_pay_card_response.rb b/lib/paypal_server_sdk/models/apple_pay_card_response.rb index c51db9f..a78f8c3 100644 --- a/lib/paypal_server_sdk/models/apple_pay_card_response.rb +++ b/lib/paypal_server_sdk/models/apple_pay_card_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The Card from Apple Pay Wallet used to fund the payment. diff --git a/lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb b/lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb index 66d7534..168f84a 100644 --- a/lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb +++ b/lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information about the Payment data obtained by decrypting Apple Pay token. diff --git a/lib/paypal_server_sdk/models/apple_pay_experience_context.rb b/lib/paypal_server_sdk/models/apple_pay_experience_context.rb index 8eb30b0..b78dadd 100644 --- a/lib/paypal_server_sdk/models/apple_pay_experience_context.rb +++ b/lib/paypal_server_sdk/models/apple_pay_experience_context.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Customizes the payer experience during the approval process for the payment. diff --git a/lib/paypal_server_sdk/models/apple_pay_payment_data.rb b/lib/paypal_server_sdk/models/apple_pay_payment_data.rb index f64f6fd..142d887 100644 --- a/lib/paypal_server_sdk/models/apple_pay_payment_data.rb +++ b/lib/paypal_server_sdk/models/apple_pay_payment_data.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information about the decrypted apple pay payment data for the token like diff --git a/lib/paypal_server_sdk/models/apple_pay_payment_data_type.rb b/lib/paypal_server_sdk/models/apple_pay_payment_data_type.rb index 6a6379b..a99901b 100644 --- a/lib/paypal_server_sdk/models/apple_pay_payment_data_type.rb +++ b/lib/paypal_server_sdk/models/apple_pay_payment_data_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Indicates the type of payment data passed, in case of Non China the payment diff --git a/lib/paypal_server_sdk/models/apple_pay_payment_object.rb b/lib/paypal_server_sdk/models/apple_pay_payment_object.rb index 2b8d303..bc4152d 100644 --- a/lib/paypal_server_sdk/models/apple_pay_payment_object.rb +++ b/lib/paypal_server_sdk/models/apple_pay_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using ApplePay. diff --git a/lib/paypal_server_sdk/models/apple_pay_payment_token.rb b/lib/paypal_server_sdk/models/apple_pay_payment_token.rb index 826a80e..5b58ccd 100644 --- a/lib/paypal_server_sdk/models/apple_pay_payment_token.rb +++ b/lib/paypal_server_sdk/models/apple_pay_payment_token.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # A resource representing a response for Apple Pay. diff --git a/lib/paypal_server_sdk/models/apple_pay_request.rb b/lib/paypal_server_sdk/models/apple_pay_request.rb index 0e78ba0..e4fd3c6 100644 --- a/lib/paypal_server_sdk/models/apple_pay_request.rb +++ b/lib/paypal_server_sdk/models/apple_pay_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using ApplePay. diff --git a/lib/paypal_server_sdk/models/apple_pay_request_card.rb b/lib/paypal_server_sdk/models/apple_pay_request_card.rb new file mode 100644 index 0000000..43a28cf --- /dev/null +++ b/lib/paypal_server_sdk/models/apple_pay_request_card.rb @@ -0,0 +1,88 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The payment card to be used to fund a payment. Can be a credit or debit + # card. + class ApplePayRequestCard < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Type of card. i.e Credit, Debit and so on. + # @return [CardType] + attr_accessor :type + + # The card network or brand. Applies to credit, debit, gift, and payment + # cards. + # @return [CardBrand] + attr_accessor :brand + + # The portable international postal address. Maps to + # [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/ + # wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: + # the autocomplete + # attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-co + # ntrols-the-autocomplete-attribute). + # @return [Address] + attr_accessor :billing_address + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['type'] = 'type' + @_hash['brand'] = 'brand' + @_hash['billing_address'] = 'billing_address' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + type + brand + billing_address + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(type: SKIP, brand: SKIP, billing_address: SKIP) + @type = type unless type == SKIP + @brand = brand unless brand == SKIP + @billing_address = billing_address unless billing_address == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + type = hash.key?('type') ? hash['type'] : SKIP + brand = hash.key?('brand') ? hash['brand'] : SKIP + billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address'] + + # Create object from extracted values. + ApplePayRequestCard.new(type: type, + brand: brand, + billing_address: billing_address) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} type: #{@type}, brand: #{@brand}, billing_address: #{@billing_address}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} type: #{@type.inspect}, brand: #{@brand.inspect}, billing_address:"\ + " #{@billing_address.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb b/lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb index 073c4b8..2ae535c 100644 --- a/lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb +++ b/lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment card to use to fund a payment. Can be a credit or debit card. @@ -22,8 +22,7 @@ class ApplePayTokenizedCard < BaseModel # @return [String] attr_accessor :expiry - # The card network or brand. Applies to credit, debit, gift, and payment - # cards. + # The card brand or network. Typically used in the response. # @return [CardBrand] attr_accessor :card_type diff --git a/lib/paypal_server_sdk/models/application_context_user_action.rb b/lib/paypal_server_sdk/models/application_context_user_action.rb new file mode 100644 index 0000000..05715d6 --- /dev/null +++ b/lib/paypal_server_sdk/models/application_context_user_action.rb @@ -0,0 +1,29 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # Configures the label name to `Continue` or `Subscribe Now` for subscription + # consent experience. + class ApplicationContextUserAction + APPLICATION_CONTEXT_USER_ACTION = [ + # After you redirect the customer to the PayPal subscription consent page, + # a Continue button appears. Use this option when you want to control the + # activation of the subscription and do not want PayPal to activate the + # subscription. + CONTINUE = 'CONTINUE'.freeze, + + # After you redirect the customer to the PayPal subscription consent page, + # a Subscribe Now button appears. Use this option when you want PayPal to + # activate the subscription. + SUBSCRIBE_NOW = 'SUBSCRIBE_NOW'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/assurance_details.rb b/lib/paypal_server_sdk/models/assurance_details.rb index 300f557..f752e69 100644 --- a/lib/paypal_server_sdk/models/assurance_details.rb +++ b/lib/paypal_server_sdk/models/assurance_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information about cardholder possession validation and cardholder diff --git a/lib/paypal_server_sdk/models/auction_information.rb b/lib/paypal_server_sdk/models/auction_information.rb new file mode 100644 index 0000000..26eac29 --- /dev/null +++ b/lib/paypal_server_sdk/models/auction_information.rb @@ -0,0 +1,100 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The auction information. + class AuctionInformation < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The name of the auction site. + # @return [String] + attr_accessor :auction_site + + # The auction site URL. + # @return [String] + attr_accessor :auction_item_site + + # The ID of the buyer who makes the purchase in the auction. This ID might + # be different from the payer ID provided for the payment. + # @return [String] + attr_accessor :auction_buyer_id + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :auction_closing_date + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['auction_site'] = 'auction_site' + @_hash['auction_item_site'] = 'auction_item_site' + @_hash['auction_buyer_id'] = 'auction_buyer_id' + @_hash['auction_closing_date'] = 'auction_closing_date' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + auction_site + auction_item_site + auction_buyer_id + auction_closing_date + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(auction_site: SKIP, auction_item_site: SKIP, + auction_buyer_id: SKIP, auction_closing_date: SKIP) + @auction_site = auction_site unless auction_site == SKIP + @auction_item_site = auction_item_site unless auction_item_site == SKIP + @auction_buyer_id = auction_buyer_id unless auction_buyer_id == SKIP + @auction_closing_date = auction_closing_date unless auction_closing_date == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + auction_site = hash.key?('auction_site') ? hash['auction_site'] : SKIP + auction_item_site = + hash.key?('auction_item_site') ? hash['auction_item_site'] : SKIP + auction_buyer_id = + hash.key?('auction_buyer_id') ? hash['auction_buyer_id'] : SKIP + auction_closing_date = + hash.key?('auction_closing_date') ? hash['auction_closing_date'] : SKIP + + # Create object from extracted values. + AuctionInformation.new(auction_site: auction_site, + auction_item_site: auction_item_site, + auction_buyer_id: auction_buyer_id, + auction_closing_date: auction_closing_date) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} auction_site: #{@auction_site}, auction_item_site: #{@auction_item_site},"\ + " auction_buyer_id: #{@auction_buyer_id}, auction_closing_date: #{@auction_closing_date}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} auction_site: #{@auction_site.inspect}, auction_item_site:"\ + " #{@auction_item_site.inspect}, auction_buyer_id: #{@auction_buyer_id.inspect},"\ + " auction_closing_date: #{@auction_closing_date.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/authentication_response.rb b/lib/paypal_server_sdk/models/authentication_response.rb index 3ab212f..b3b95b6 100644 --- a/lib/paypal_server_sdk/models/authentication_response.rb +++ b/lib/paypal_server_sdk/models/authentication_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Results of Authentication such as 3D Secure. diff --git a/lib/paypal_server_sdk/models/authorization.rb b/lib/paypal_server_sdk/models/authorization.rb index bde1f81..0494ab2 100644 --- a/lib/paypal_server_sdk/models/authorization.rb +++ b/lib/paypal_server_sdk/models/authorization.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The authorized payment transaction. @@ -39,7 +39,7 @@ class Authorization < BaseModel attr_accessor :custom_id # Reference values used by the card network to identify a transaction. - # @return [NetworkTransactionReference] + # @return [NetworkTransaction] attr_accessor :network_transaction_reference # The level of protection offered as defined by [PayPal Seller Protection @@ -152,7 +152,7 @@ def self.from_hash(hash) invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP if hash['network_transaction_reference'] - network_transaction_reference = NetworkTransactionReference.from_hash(hash['network_transaction_reference']) + network_transaction_reference = NetworkTransaction.from_hash(hash['network_transaction_reference']) end seller_protection = SellerProtection.from_hash(hash['seller_protection']) if hash['seller_protection'] diff --git a/lib/paypal_server_sdk/models/authorization_incomplete_reason.rb b/lib/paypal_server_sdk/models/authorization_incomplete_reason.rb index 817b9d2..ee96c83 100644 --- a/lib/paypal_server_sdk/models/authorization_incomplete_reason.rb +++ b/lib/paypal_server_sdk/models/authorization_incomplete_reason.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The reason why the authorized status is `PENDING`. diff --git a/lib/paypal_server_sdk/models/authorization_status.rb b/lib/paypal_server_sdk/models/authorization_status.rb index 1a7b98e..d47e173 100644 --- a/lib/paypal_server_sdk/models/authorization_status.rb +++ b/lib/paypal_server_sdk/models/authorization_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The status for the authorized payment. diff --git a/lib/paypal_server_sdk/models/authorization_status_details.rb b/lib/paypal_server_sdk/models/authorization_status_details.rb index aa6490a..a5b6ee3 100644 --- a/lib/paypal_server_sdk/models/authorization_status_details.rb +++ b/lib/paypal_server_sdk/models/authorization_status_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details of the authorized payment status. diff --git a/lib/paypal_server_sdk/models/authorization_status_with_details.rb b/lib/paypal_server_sdk/models/authorization_status_with_details.rb index 258a650..7720a6f 100644 --- a/lib/paypal_server_sdk/models/authorization_status_with_details.rb +++ b/lib/paypal_server_sdk/models/authorization_status_with_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The status fields and status details for an authorized payment. diff --git a/lib/paypal_server_sdk/models/authorization_with_additional_data.rb b/lib/paypal_server_sdk/models/authorization_with_additional_data.rb index 37d9532..e6ea301 100644 --- a/lib/paypal_server_sdk/models/authorization_with_additional_data.rb +++ b/lib/paypal_server_sdk/models/authorization_with_additional_data.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The authorization with additional payment details, such as risk assessment @@ -41,7 +41,7 @@ class AuthorizationWithAdditionalData < BaseModel attr_accessor :custom_id # Reference values used by the card network to identify a transaction. - # @return [NetworkTransactionReference] + # @return [NetworkTransaction] attr_accessor :network_transaction_reference # The level of protection offered as defined by [PayPal Seller Protection @@ -162,7 +162,7 @@ def self.from_hash(hash) invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP if hash['network_transaction_reference'] - network_transaction_reference = NetworkTransactionReference.from_hash(hash['network_transaction_reference']) + network_transaction_reference = NetworkTransaction.from_hash(hash['network_transaction_reference']) end seller_protection = SellerProtection.from_hash(hash['seller_protection']) if hash['seller_protection'] diff --git a/lib/paypal_server_sdk/models/avs_code.rb b/lib/paypal_server_sdk/models/avs_code.rb index 0d1f97b..f2b5ac8 100644 --- a/lib/paypal_server_sdk/models/avs_code.rb +++ b/lib/paypal_server_sdk/models/avs_code.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The address verification code for Visa, Discover, Mastercard, or American diff --git a/lib/paypal_server_sdk/models/balance_information.rb b/lib/paypal_server_sdk/models/balance_information.rb new file mode 100644 index 0000000..433cd07 --- /dev/null +++ b/lib/paypal_server_sdk/models/balance_information.rb @@ -0,0 +1,106 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The Balance information. + class BalanceInformation < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The [three-character ISO-4217 currency + # code](/docs/integration/direct/rest/currency-codes/) that identifies the + # currency. + # @return [String] + attr_accessor :currency + + # Optional field representing if the currency is primary currency or not. + # @return [TrueClass | FalseClass] + attr_accessor :primary + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :total_balance + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :available_balance + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :withheld_balance + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['currency'] = 'currency' + @_hash['primary'] = 'primary' + @_hash['total_balance'] = 'total_balance' + @_hash['available_balance'] = 'available_balance' + @_hash['withheld_balance'] = 'withheld_balance' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + primary + available_balance + withheld_balance + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(currency:, total_balance:, primary: SKIP, + available_balance: SKIP, withheld_balance: SKIP) + @currency = currency + @primary = primary unless primary == SKIP + @total_balance = total_balance + @available_balance = available_balance unless available_balance == SKIP + @withheld_balance = withheld_balance unless withheld_balance == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + currency = hash.key?('currency') ? hash['currency'] : nil + total_balance = Money.from_hash(hash['total_balance']) if hash['total_balance'] + primary = hash.key?('primary') ? hash['primary'] : SKIP + available_balance = Money.from_hash(hash['available_balance']) if hash['available_balance'] + withheld_balance = Money.from_hash(hash['withheld_balance']) if hash['withheld_balance'] + + # Create object from extracted values. + BalanceInformation.new(currency: currency, + total_balance: total_balance, + primary: primary, + available_balance: available_balance, + withheld_balance: withheld_balance) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} currency: #{@currency}, primary: #{@primary}, total_balance:"\ + " #{@total_balance}, available_balance: #{@available_balance}, withheld_balance:"\ + " #{@withheld_balance}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} currency: #{@currency.inspect}, primary: #{@primary.inspect},"\ + " total_balance: #{@total_balance.inspect}, available_balance:"\ + " #{@available_balance.inspect}, withheld_balance: #{@withheld_balance.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/balances_response.rb b/lib/paypal_server_sdk/models/balances_response.rb new file mode 100644 index 0000000..59fb003 --- /dev/null +++ b/lib/paypal_server_sdk/models/balances_response.rb @@ -0,0 +1,111 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The balances response information. + class BalancesResponse < BaseModel + SKIP = Object.new + private_constant :SKIP + + # An array of balance detail objects. + # @return [Array[BalanceInformation]] + attr_accessor :balances + + # The PayPal payer ID, which is a masked version of the PayPal account + # number intended for use with third parties. The account number is + # reversibly encrypted and a proprietary variant of Base32 is used to encode + # the result. + # @return [String] + attr_accessor :account_id + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :as_of_time + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :last_refresh_time + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['balances'] = 'balances' + @_hash['account_id'] = 'account_id' + @_hash['as_of_time'] = 'as_of_time' + @_hash['last_refresh_time'] = 'last_refresh_time' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + balances + account_id + as_of_time + last_refresh_time + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(balances: SKIP, account_id: SKIP, as_of_time: SKIP, + last_refresh_time: SKIP) + @balances = balances unless balances == SKIP + @account_id = account_id unless account_id == SKIP + @as_of_time = as_of_time unless as_of_time == SKIP + @last_refresh_time = last_refresh_time unless last_refresh_time == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + balances = nil + unless hash['balances'].nil? + balances = [] + hash['balances'].each do |structure| + balances << (BalanceInformation.from_hash(structure) if structure) + end + end + + balances = SKIP unless hash.key?('balances') + account_id = hash.key?('account_id') ? hash['account_id'] : SKIP + as_of_time = hash.key?('as_of_time') ? hash['as_of_time'] : SKIP + last_refresh_time = + hash.key?('last_refresh_time') ? hash['last_refresh_time'] : SKIP + + # Create object from extracted values. + BalancesResponse.new(balances: balances, + account_id: account_id, + as_of_time: as_of_time, + last_refresh_time: last_refresh_time) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} balances: #{@balances}, account_id: #{@account_id}, as_of_time:"\ + " #{@as_of_time}, last_refresh_time: #{@last_refresh_time}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} balances: #{@balances.inspect}, account_id: #{@account_id.inspect},"\ + " as_of_time: #{@as_of_time.inspect}, last_refresh_time: #{@last_refresh_time.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/bancontact_payment_object.rb b/lib/paypal_server_sdk/models/bancontact_payment_object.rb index 836e9b7..683aaf0 100644 --- a/lib/paypal_server_sdk/models/bancontact_payment_object.rb +++ b/lib/paypal_server_sdk/models/bancontact_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information used to pay Bancontact. diff --git a/lib/paypal_server_sdk/models/bancontact_payment_request.rb b/lib/paypal_server_sdk/models/bancontact_payment_request.rb index 5f774ed..5ad3c94 100644 --- a/lib/paypal_server_sdk/models/bancontact_payment_request.rb +++ b/lib/paypal_server_sdk/models/bancontact_payment_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using Bancontact. diff --git a/lib/paypal_server_sdk/models/bank_request.rb b/lib/paypal_server_sdk/models/bank_request.rb new file mode 100644 index 0000000..3b2795f --- /dev/null +++ b/lib/paypal_server_sdk/models/bank_request.rb @@ -0,0 +1,71 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # A Resource representing a request to vault a Bank used for ACH Debit. + class BankRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # A Resource representing a request to vault a ACH Debit. + # @return [Object] + attr_accessor :ach_debit + + # An API resource denoting a request to securely store a SEPA Debit. + # @return [SepaDebitRequest] + attr_accessor :sepa_debit + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['ach_debit'] = 'ach_debit' + @_hash['sepa_debit'] = 'sepa_debit' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + ach_debit + sepa_debit + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(ach_debit: SKIP, sepa_debit: SKIP) + @ach_debit = ach_debit unless ach_debit == SKIP + @sepa_debit = sepa_debit unless sepa_debit == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + ach_debit = hash.key?('ach_debit') ? hash['ach_debit'] : SKIP + sepa_debit = SepaDebitRequest.from_hash(hash['sepa_debit']) if hash['sepa_debit'] + + # Create object from extracted values. + BankRequest.new(ach_debit: ach_debit, + sepa_debit: sepa_debit) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} ach_debit: #{@ach_debit}, sepa_debit: #{@sepa_debit}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} ach_debit: #{@ach_debit.inspect}, sepa_debit: #{@sepa_debit.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/base_model.rb b/lib/paypal_server_sdk/models/base_model.rb index b1759f0..94e8fa7 100644 --- a/lib/paypal_server_sdk/models/base_model.rb +++ b/lib/paypal_server_sdk/models/base_model.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Base model. diff --git a/lib/paypal_server_sdk/models/billing_cycle.rb b/lib/paypal_server_sdk/models/billing_cycle.rb index dad9635..695a716 100644 --- a/lib/paypal_server_sdk/models/billing_cycle.rb +++ b/lib/paypal_server_sdk/models/billing_cycle.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The billing cycle providing details of the billing frequency, amount, @@ -22,10 +22,6 @@ class BillingCycle < BaseModel # @return [PricingScheme] attr_accessor :pricing_scheme - # The frequency details for this billing cycle. - # @return [Object] - attr_accessor :frequency - # The number of times this billing cycle gets executed. Trial billing cycles # can only be executed a finite number of times (value between 1 and 999 for # total_cycles). Regular billing cycles can be executed infinite times @@ -55,7 +51,6 @@ def self.names @_hash = {} if @_hash.nil? @_hash['tenure_type'] = 'tenure_type' @_hash['pricing_scheme'] = 'pricing_scheme' - @_hash['frequency'] = 'frequency' @_hash['total_cycles'] = 'total_cycles' @_hash['sequence'] = 'sequence' @_hash['start_date'] = 'start_date' @@ -66,7 +61,6 @@ def self.names def self.optionals %w[ pricing_scheme - frequency total_cycles sequence start_date @@ -78,11 +72,10 @@ def self.nullables [] end - def initialize(tenure_type:, pricing_scheme: SKIP, frequency: SKIP, - total_cycles: 1, sequence: 1, start_date: SKIP) + def initialize(tenure_type:, pricing_scheme: SKIP, total_cycles: 1, + sequence: 1, start_date: SKIP) @tenure_type = tenure_type @pricing_scheme = pricing_scheme unless pricing_scheme == SKIP - @frequency = frequency unless frequency == SKIP @total_cycles = total_cycles unless total_cycles == SKIP @sequence = sequence unless sequence == SKIP @start_date = start_date unless start_date == SKIP @@ -95,7 +88,6 @@ def self.from_hash(hash) # Extract variables from the hash. tenure_type = hash.key?('tenure_type') ? hash['tenure_type'] : nil pricing_scheme = PricingScheme.from_hash(hash['pricing_scheme']) if hash['pricing_scheme'] - frequency = hash.key?('frequency') ? hash['frequency'] : SKIP total_cycles = hash['total_cycles'] ||= 1 sequence = hash['sequence'] ||= 1 start_date = hash.key?('start_date') ? hash['start_date'] : SKIP @@ -103,7 +95,6 @@ def self.from_hash(hash) # Create object from extracted values. BillingCycle.new(tenure_type: tenure_type, pricing_scheme: pricing_scheme, - frequency: frequency, total_cycles: total_cycles, sequence: sequence, start_date: start_date) @@ -113,17 +104,15 @@ def self.from_hash(hash) def to_s class_name = self.class.name.split('::').last "<#{class_name} tenure_type: #{@tenure_type}, pricing_scheme: #{@pricing_scheme},"\ - " frequency: #{@frequency}, total_cycles: #{@total_cycles}, sequence: #{@sequence},"\ - " start_date: #{@start_date}>" + " total_cycles: #{@total_cycles}, sequence: #{@sequence}, start_date: #{@start_date}>" end # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last "<#{class_name} tenure_type: #{@tenure_type.inspect}, pricing_scheme:"\ - " #{@pricing_scheme.inspect}, frequency: #{@frequency.inspect}, total_cycles:"\ - " #{@total_cycles.inspect}, sequence: #{@sequence.inspect}, start_date:"\ - " #{@start_date.inspect}>" + " #{@pricing_scheme.inspect}, total_cycles: #{@total_cycles.inspect}, sequence:"\ + " #{@sequence.inspect}, start_date: #{@start_date.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/billing_cycle_override.rb b/lib/paypal_server_sdk/models/billing_cycle_override.rb new file mode 100644 index 0000000..0f5fdbe --- /dev/null +++ b/lib/paypal_server_sdk/models/billing_cycle_override.rb @@ -0,0 +1,91 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The billing cycle details to override at subscription level. The + # subscription billing cycle definition has to adhere to the plan billing + # cycle definition. + class BillingCycleOverride < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The pricing scheme details. + # @return [SubscriptionPricingScheme] + attr_accessor :pricing_scheme + + # The order in which this cycle is to run among other billing cycles. For + # example, a trial billing cycle has a `sequence` of `1` while a regular + # billing cycle has a `sequence` of `2`, so that trial cycle runs before the + # regular cycle. + # @return [Integer] + attr_accessor :sequence + + # The number of times this billing cycle gets executed. Trial billing cycles + # can only be executed a finite number of times (value between 1 and 999 for + # total_cycles). Regular billing cycles can be executed infinite times + # (value of 0 for total_cycles) or a finite number of times (value between 1 + # and 999 for total_cycles). + # @return [Integer] + attr_accessor :total_cycles + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['pricing_scheme'] = 'pricing_scheme' + @_hash['sequence'] = 'sequence' + @_hash['total_cycles'] = 'total_cycles' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + pricing_scheme + total_cycles + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(sequence:, pricing_scheme: SKIP, total_cycles: SKIP) + @pricing_scheme = pricing_scheme unless pricing_scheme == SKIP + @sequence = sequence + @total_cycles = total_cycles unless total_cycles == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + sequence = hash.key?('sequence') ? hash['sequence'] : nil + pricing_scheme = SubscriptionPricingScheme.from_hash(hash['pricing_scheme']) if + hash['pricing_scheme'] + total_cycles = hash.key?('total_cycles') ? hash['total_cycles'] : SKIP + + # Create object from extracted values. + BillingCycleOverride.new(sequence: sequence, + pricing_scheme: pricing_scheme, + total_cycles: total_cycles) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} pricing_scheme: #{@pricing_scheme}, sequence: #{@sequence}, total_cycles:"\ + " #{@total_cycles}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} pricing_scheme: #{@pricing_scheme.inspect}, sequence: #{@sequence.inspect},"\ + " total_cycles: #{@total_cycles.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/billing_plan.rb b/lib/paypal_server_sdk/models/billing_plan.rb new file mode 100644 index 0000000..dd19f6d --- /dev/null +++ b/lib/paypal_server_sdk/models/billing_plan.rb @@ -0,0 +1,212 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The plan details. + class BillingPlan < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The unique PayPal-generated ID for the plan. + # @return [String] + attr_accessor :id + + # The ID for the product. + # @return [String] + attr_accessor :product_id + + # The plan name. + # @return [String] + attr_accessor :name + + # The plan status. + # @return [SubscriptionPlanStatus] + attr_accessor :status + + # The detailed description of the plan. + # @return [String] + attr_accessor :description + + # An array of billing cycles for trial billing and regular billing. A plan + # can have at most two trial cycles and only one regular cycle. + # @return [Array[SubscriptionBillingCycle]] + attr_accessor :billing_cycles + + # The payment preferences for a subscription. + # @return [PaymentPreferences] + attr_accessor :payment_preferences + + # The merchant preferences for a subscription. + # @return [MerchantPreferences] + attr_accessor :merchant_preferences + + # The tax details. + # @return [Taxes] + attr_accessor :taxes + + # Indicates whether you can subscribe to this plan by providing a quantity + # for the goods or service. + # @return [TrueClass | FalseClass] + attr_accessor :quantity_supported + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :create_time + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :update_time + + # An array of request-related [HATEOAS + # links](/docs/api/reference/api-responses/#hateoas-links). + # @return [Array[LinkDescription]] + attr_accessor :links + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['id'] = 'id' + @_hash['product_id'] = 'product_id' + @_hash['name'] = 'name' + @_hash['status'] = 'status' + @_hash['description'] = 'description' + @_hash['billing_cycles'] = 'billing_cycles' + @_hash['payment_preferences'] = 'payment_preferences' + @_hash['merchant_preferences'] = 'merchant_preferences' + @_hash['taxes'] = 'taxes' + @_hash['quantity_supported'] = 'quantity_supported' + @_hash['create_time'] = 'create_time' + @_hash['update_time'] = 'update_time' + @_hash['links'] = 'links' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + id + product_id + name + status + description + billing_cycles + payment_preferences + merchant_preferences + taxes + quantity_supported + create_time + update_time + links + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(id: SKIP, product_id: SKIP, name: SKIP, status: SKIP, + description: SKIP, billing_cycles: SKIP, + payment_preferences: SKIP, merchant_preferences: SKIP, + taxes: SKIP, quantity_supported: false, create_time: SKIP, + update_time: SKIP, links: SKIP) + @id = id unless id == SKIP + @product_id = product_id unless product_id == SKIP + @name = name unless name == SKIP + @status = status unless status == SKIP + @description = description unless description == SKIP + @billing_cycles = billing_cycles unless billing_cycles == SKIP + @payment_preferences = payment_preferences unless payment_preferences == SKIP + @merchant_preferences = merchant_preferences unless merchant_preferences == SKIP + @taxes = taxes unless taxes == SKIP + @quantity_supported = quantity_supported unless quantity_supported == SKIP + @create_time = create_time unless create_time == SKIP + @update_time = update_time unless update_time == SKIP + @links = links unless links == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + id = hash.key?('id') ? hash['id'] : SKIP + product_id = hash.key?('product_id') ? hash['product_id'] : SKIP + name = hash.key?('name') ? hash['name'] : SKIP + status = hash.key?('status') ? hash['status'] : SKIP + description = hash.key?('description') ? hash['description'] : SKIP + # Parameter is an array, so we need to iterate through it + billing_cycles = nil + unless hash['billing_cycles'].nil? + billing_cycles = [] + hash['billing_cycles'].each do |structure| + billing_cycles << (SubscriptionBillingCycle.from_hash(structure) if structure) + end + end + + billing_cycles = SKIP unless hash.key?('billing_cycles') + payment_preferences = PaymentPreferences.from_hash(hash['payment_preferences']) if + hash['payment_preferences'] + merchant_preferences = MerchantPreferences.from_hash(hash['merchant_preferences']) if + hash['merchant_preferences'] + taxes = Taxes.from_hash(hash['taxes']) if hash['taxes'] + quantity_supported = hash['quantity_supported'] ||= false + create_time = hash.key?('create_time') ? hash['create_time'] : SKIP + update_time = hash.key?('update_time') ? hash['update_time'] : SKIP + # Parameter is an array, so we need to iterate through it + links = nil + unless hash['links'].nil? + links = [] + hash['links'].each do |structure| + links << (LinkDescription.from_hash(structure) if structure) + end + end + + links = SKIP unless hash.key?('links') + + # Create object from extracted values. + BillingPlan.new(id: id, + product_id: product_id, + name: name, + status: status, + description: description, + billing_cycles: billing_cycles, + payment_preferences: payment_preferences, + merchant_preferences: merchant_preferences, + taxes: taxes, + quantity_supported: quantity_supported, + create_time: create_time, + update_time: update_time, + links: links) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id}, product_id: #{@product_id}, name: #{@name}, status: #{@status},"\ + " description: #{@description}, billing_cycles: #{@billing_cycles}, payment_preferences:"\ + " #{@payment_preferences}, merchant_preferences: #{@merchant_preferences}, taxes: #{@taxes},"\ + " quantity_supported: #{@quantity_supported}, create_time: #{@create_time}, update_time:"\ + " #{@update_time}, links: #{@links}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id.inspect}, product_id: #{@product_id.inspect}, name:"\ + " #{@name.inspect}, status: #{@status.inspect}, description: #{@description.inspect},"\ + " billing_cycles: #{@billing_cycles.inspect}, payment_preferences:"\ + " #{@payment_preferences.inspect}, merchant_preferences: #{@merchant_preferences.inspect},"\ + " taxes: #{@taxes.inspect}, quantity_supported: #{@quantity_supported.inspect}, create_time:"\ + " #{@create_time.inspect}, update_time: #{@update_time.inspect}, links: #{@links.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/bin_details.rb b/lib/paypal_server_sdk/models/bin_details.rb index 8271c17..ac83eef 100644 --- a/lib/paypal_server_sdk/models/bin_details.rb +++ b/lib/paypal_server_sdk/models/bin_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Bank Identification Number (BIN) details used to fund a payment. diff --git a/lib/paypal_server_sdk/models/blik_experience_context.rb b/lib/paypal_server_sdk/models/blik_experience_context.rb index c3258e4..6dff452 100644 --- a/lib/paypal_server_sdk/models/blik_experience_context.rb +++ b/lib/paypal_server_sdk/models/blik_experience_context.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Customizes the payer experience during the approval process for the BLIK @@ -28,7 +28,7 @@ class BlikExperienceContext < BaseModel attr_accessor :locale # The location from which the shipping address is derived. - # @return [ShippingPreference] + # @return [ExperienceContextShippingPreference] attr_accessor :shipping_preference # Describes the URL. @@ -81,10 +81,12 @@ def self.nullables [] end - def initialize(brand_name: SKIP, locale: SKIP, - shipping_preference: ShippingPreference::GET_FROM_FILE, - return_url: SKIP, cancel_url: SKIP, consumer_ip: SKIP, - consumer_user_agent: SKIP) + def initialize( + brand_name: SKIP, locale: SKIP, + shipping_preference: ExperienceContextShippingPreference::GET_FROM_FILE, + return_url: SKIP, cancel_url: SKIP, consumer_ip: SKIP, + consumer_user_agent: SKIP + ) @brand_name = brand_name unless brand_name == SKIP @locale = locale unless locale == SKIP @shipping_preference = shipping_preference unless shipping_preference == SKIP @@ -102,7 +104,7 @@ def self.from_hash(hash) brand_name = hash.key?('brand_name') ? hash['brand_name'] : SKIP locale = hash.key?('locale') ? hash['locale'] : SKIP shipping_preference = - hash['shipping_preference'] ||= ShippingPreference::GET_FROM_FILE + hash['shipping_preference'] ||= ExperienceContextShippingPreference::GET_FROM_FILE return_url = hash.key?('return_url') ? hash['return_url'] : SKIP cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : SKIP consumer_ip = hash.key?('consumer_ip') ? hash['consumer_ip'] : SKIP diff --git a/lib/paypal_server_sdk/models/blik_level0_payment_object.rb b/lib/paypal_server_sdk/models/blik_level0_payment_object.rb index 68f6e06..bee82af 100644 --- a/lib/paypal_server_sdk/models/blik_level0_payment_object.rb +++ b/lib/paypal_server_sdk/models/blik_level0_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information used to pay using BLIK level_0 flow. diff --git a/lib/paypal_server_sdk/models/blik_one_click_payment_object.rb b/lib/paypal_server_sdk/models/blik_one_click_payment_object.rb index 8829c66..b796eee 100644 --- a/lib/paypal_server_sdk/models/blik_one_click_payment_object.rb +++ b/lib/paypal_server_sdk/models/blik_one_click_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information used to pay using BLIK one-click flow. diff --git a/lib/paypal_server_sdk/models/blik_one_click_payment_request.rb b/lib/paypal_server_sdk/models/blik_one_click_payment_request.rb index 826774b..8f86f39 100644 --- a/lib/paypal_server_sdk/models/blik_one_click_payment_request.rb +++ b/lib/paypal_server_sdk/models/blik_one_click_payment_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information used to pay using BLIK one-click flow. diff --git a/lib/paypal_server_sdk/models/blik_payment_object.rb b/lib/paypal_server_sdk/models/blik_payment_object.rb index e195456..a67649f 100644 --- a/lib/paypal_server_sdk/models/blik_payment_object.rb +++ b/lib/paypal_server_sdk/models/blik_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information used to pay using BLIK. diff --git a/lib/paypal_server_sdk/models/blik_payment_request.rb b/lib/paypal_server_sdk/models/blik_payment_request.rb index 83a97a6..ee6b089 100644 --- a/lib/paypal_server_sdk/models/blik_payment_request.rb +++ b/lib/paypal_server_sdk/models/blik_payment_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using BLIK. diff --git a/lib/paypal_server_sdk/models/callback_configuration.rb b/lib/paypal_server_sdk/models/callback_configuration.rb index 63ecbea..ab1ac20 100644 --- a/lib/paypal_server_sdk/models/callback_configuration.rb +++ b/lib/paypal_server_sdk/models/callback_configuration.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # CallBack Configuration that the merchant can provide to PayPal/Venmo. diff --git a/lib/paypal_server_sdk/models/callback_events.rb b/lib/paypal_server_sdk/models/callback_events.rb index a3f5d8f..9b7abfa 100644 --- a/lib/paypal_server_sdk/models/callback_events.rb +++ b/lib/paypal_server_sdk/models/callback_events.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # CallBack event. diff --git a/lib/paypal_server_sdk/models/cancel_subscription_request.rb b/lib/paypal_server_sdk/models/cancel_subscription_request.rb new file mode 100644 index 0000000..161966b --- /dev/null +++ b/lib/paypal_server_sdk/models/cancel_subscription_request.rb @@ -0,0 +1,60 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The cancel subscription request details. + class CancelSubscriptionRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The reason for the cancellation of a subscription. + # @return [String] + attr_accessor :reason + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['reason'] = 'reason' + @_hash + end + + # An array for optional fields + def self.optionals + [] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(reason:) + @reason = reason + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + reason = hash.key?('reason') ? hash['reason'] : nil + + # Create object from extracted values. + CancelSubscriptionRequest.new(reason: reason) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} reason: #{@reason}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} reason: #{@reason.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/capture_incomplete_reason.rb b/lib/paypal_server_sdk/models/capture_incomplete_reason.rb index c2d19f0..95f170c 100644 --- a/lib/paypal_server_sdk/models/capture_incomplete_reason.rb +++ b/lib/paypal_server_sdk/models/capture_incomplete_reason.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The reason why the captured payment status is `PENDING` or `DENIED`. diff --git a/lib/paypal_server_sdk/models/capture_payment_instruction.rb b/lib/paypal_server_sdk/models/capture_payment_instruction.rb index 2e2e9d6..aca824c 100644 --- a/lib/paypal_server_sdk/models/capture_payment_instruction.rb +++ b/lib/paypal_server_sdk/models/capture_payment_instruction.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Any additional payment instructions to be consider during payment diff --git a/lib/paypal_server_sdk/models/capture_request.rb b/lib/paypal_server_sdk/models/capture_request.rb index 2022f0e..a1f0e61 100644 --- a/lib/paypal_server_sdk/models/capture_request.rb +++ b/lib/paypal_server_sdk/models/capture_request.rb @@ -1,30 +1,26 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk - # CaptureRequest Model. + # Captures either a portion or the full authorized amount of an authorized + # payment. class CaptureRequest < BaseModel SKIP = Object.new private_constant :SKIP + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :amount + # The API caller-provided external invoice number for this order. Appears in # both the payer's transaction history and the emails that the payer # receives. # @return [String] attr_accessor :invoice_id - # An informational note about this settlement. Appears in both the payer's - # transaction history and the emails that the payer receives. - # @return [String] - attr_accessor :note_to_payer - - # The currency and amount for a financial transaction, such as a balance or - # payment due. - # @return [Money] - attr_accessor :amount - # Indicates whether you can make additional captures against the authorized # payment. Set to `true` if you do not intend to capture additional payments # against the authorization. Set to `false` if you intend to capture @@ -38,6 +34,11 @@ class CaptureRequest < BaseModel # @return [CapturePaymentInstruction] attr_accessor :payment_instruction + # An informational note about this settlement. Appears in both the payer's + # transaction history and the emails that the payer receives. + # @return [String] + attr_accessor :note_to_payer + # The payment descriptor on the payer's account statement. # @return [String] attr_accessor :soft_descriptor @@ -45,11 +46,11 @@ class CaptureRequest < BaseModel # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? - @_hash['invoice_id'] = 'invoice_id' - @_hash['note_to_payer'] = 'note_to_payer' @_hash['amount'] = 'amount' + @_hash['invoice_id'] = 'invoice_id' @_hash['final_capture'] = 'final_capture' @_hash['payment_instruction'] = 'payment_instruction' + @_hash['note_to_payer'] = 'note_to_payer' @_hash['soft_descriptor'] = 'soft_descriptor' @_hash end @@ -57,11 +58,11 @@ def self.names # An array for optional fields def self.optionals %w[ - invoice_id - note_to_payer amount + invoice_id final_capture payment_instruction + note_to_payer soft_descriptor ] end @@ -71,14 +72,14 @@ def self.nullables [] end - def initialize(invoice_id: SKIP, note_to_payer: SKIP, amount: SKIP, - final_capture: false, payment_instruction: SKIP, + def initialize(amount: SKIP, invoice_id: SKIP, final_capture: false, + payment_instruction: SKIP, note_to_payer: SKIP, soft_descriptor: SKIP) - @invoice_id = invoice_id unless invoice_id == SKIP - @note_to_payer = note_to_payer unless note_to_payer == SKIP @amount = amount unless amount == SKIP + @invoice_id = invoice_id unless invoice_id == SKIP @final_capture = final_capture unless final_capture == SKIP @payment_instruction = payment_instruction unless payment_instruction == SKIP + @note_to_payer = note_to_payer unless note_to_payer == SKIP @soft_descriptor = soft_descriptor unless soft_descriptor == SKIP end @@ -87,38 +88,38 @@ def self.from_hash(hash) return nil unless hash # Extract variables from the hash. - invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP - note_to_payer = hash.key?('note_to_payer') ? hash['note_to_payer'] : SKIP amount = Money.from_hash(hash['amount']) if hash['amount'] + invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP final_capture = hash['final_capture'] ||= false payment_instruction = CapturePaymentInstruction.from_hash(hash['payment_instruction']) if hash['payment_instruction'] + note_to_payer = hash.key?('note_to_payer') ? hash['note_to_payer'] : SKIP soft_descriptor = hash.key?('soft_descriptor') ? hash['soft_descriptor'] : SKIP # Create object from extracted values. - CaptureRequest.new(invoice_id: invoice_id, - note_to_payer: note_to_payer, - amount: amount, + CaptureRequest.new(amount: amount, + invoice_id: invoice_id, final_capture: final_capture, payment_instruction: payment_instruction, + note_to_payer: note_to_payer, soft_descriptor: soft_descriptor) end # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last - "<#{class_name} invoice_id: #{@invoice_id}, note_to_payer: #{@note_to_payer}, amount:"\ - " #{@amount}, final_capture: #{@final_capture}, payment_instruction:"\ - " #{@payment_instruction}, soft_descriptor: #{@soft_descriptor}>" + "<#{class_name} amount: #{@amount}, invoice_id: #{@invoice_id}, final_capture:"\ + " #{@final_capture}, payment_instruction: #{@payment_instruction}, note_to_payer:"\ + " #{@note_to_payer}, soft_descriptor: #{@soft_descriptor}>" end # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last - "<#{class_name} invoice_id: #{@invoice_id.inspect}, note_to_payer:"\ - " #{@note_to_payer.inspect}, amount: #{@amount.inspect}, final_capture:"\ - " #{@final_capture.inspect}, payment_instruction: #{@payment_instruction.inspect},"\ + "<#{class_name} amount: #{@amount.inspect}, invoice_id: #{@invoice_id.inspect},"\ + " final_capture: #{@final_capture.inspect}, payment_instruction:"\ + " #{@payment_instruction.inspect}, note_to_payer: #{@note_to_payer.inspect},"\ " soft_descriptor: #{@soft_descriptor.inspect}>" end end diff --git a/lib/paypal_server_sdk/models/capture_status.rb b/lib/paypal_server_sdk/models/capture_status.rb index a40790b..842534f 100644 --- a/lib/paypal_server_sdk/models/capture_status.rb +++ b/lib/paypal_server_sdk/models/capture_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The status of the captured payment. diff --git a/lib/paypal_server_sdk/models/capture_status_details.rb b/lib/paypal_server_sdk/models/capture_status_details.rb index 2645809..83dbf08 100644 --- a/lib/paypal_server_sdk/models/capture_status_details.rb +++ b/lib/paypal_server_sdk/models/capture_status_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details of the captured payment status. diff --git a/lib/paypal_server_sdk/models/capture_status_with_details.rb b/lib/paypal_server_sdk/models/capture_status_with_details.rb index 84c1a11..b810607 100644 --- a/lib/paypal_server_sdk/models/capture_status_with_details.rb +++ b/lib/paypal_server_sdk/models/capture_status_with_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The status and status details of a captured payment. diff --git a/lib/paypal_server_sdk/models/capture_subscription_request.rb b/lib/paypal_server_sdk/models/capture_subscription_request.rb new file mode 100644 index 0000000..3c7cedf --- /dev/null +++ b/lib/paypal_server_sdk/models/capture_subscription_request.rb @@ -0,0 +1,78 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The charge amount from the subscriber. + class CaptureSubscriptionRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The reason or note for the subscription charge. + # @return [String] + attr_accessor :note + + # The type of capture. + # @return [CaptureType] + attr_accessor :capture_type + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :amount + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['note'] = 'note' + @_hash['capture_type'] = 'capture_type' + @_hash['amount'] = 'amount' + @_hash + end + + # An array for optional fields + def self.optionals + [] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(note:, capture_type:, amount:) + @note = note + @capture_type = capture_type + @amount = amount + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + note = hash.key?('note') ? hash['note'] : nil + capture_type = hash.key?('capture_type') ? hash['capture_type'] : nil + amount = Money.from_hash(hash['amount']) if hash['amount'] + + # Create object from extracted values. + CaptureSubscriptionRequest.new(note: note, + capture_type: capture_type, + amount: amount) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} note: #{@note}, capture_type: #{@capture_type}, amount: #{@amount}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} note: #{@note.inspect}, capture_type: #{@capture_type.inspect}, amount:"\ + " #{@amount.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/capture_type.rb b/lib/paypal_server_sdk/models/capture_type.rb new file mode 100644 index 0000000..7c5f88b --- /dev/null +++ b/lib/paypal_server_sdk/models/capture_type.rb @@ -0,0 +1,20 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The type of capture. + class CaptureType + CAPTURE_TYPE = [ + # The outstanding balance that the subscriber must clear. + OUTSTANDING_BALANCE = 'OUTSTANDING_BALANCE'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/captured_payment.rb b/lib/paypal_server_sdk/models/captured_payment.rb index 8930e49..2642ef4 100644 --- a/lib/paypal_server_sdk/models/captured_payment.rb +++ b/lib/paypal_server_sdk/models/captured_payment.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # A captured payment. @@ -39,7 +39,7 @@ class CapturedPayment < BaseModel attr_accessor :custom_id # Reference values used by the card network to identify a transaction. - # @return [NetworkTransactionReference] + # @return [NetworkTransaction] attr_accessor :network_transaction_reference # The level of protection offered as defined by [PayPal Seller Protection @@ -72,7 +72,7 @@ class CapturedPayment < BaseModel # The processor response information for payment requests, such as direct # credit card transactions. - # @return [PaymentsProcessorResponse] + # @return [ProcessorResponse] attr_accessor :processor_response # The date and time, in [Internet date and time @@ -195,7 +195,7 @@ def self.from_hash(hash) invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP if hash['network_transaction_reference'] - network_transaction_reference = NetworkTransactionReference.from_hash(hash['network_transaction_reference']) + network_transaction_reference = NetworkTransaction.from_hash(hash['network_transaction_reference']) end seller_protection = SellerProtection.from_hash(hash['seller_protection']) if hash['seller_protection'] @@ -215,7 +215,7 @@ def self.from_hash(hash) end links = SKIP unless hash.key?('links') - processor_response = PaymentsProcessorResponse.from_hash(hash['processor_response']) if + processor_response = ProcessorResponse.from_hash(hash['processor_response']) if hash['processor_response'] create_time = hash.key?('create_time') ? hash['create_time'] : SKIP update_time = hash.key?('update_time') ? hash['update_time'] : SKIP diff --git a/lib/paypal_server_sdk/models/card_attributes.rb b/lib/paypal_server_sdk/models/card_attributes.rb index cbd1911..58858a7 100644 --- a/lib/paypal_server_sdk/models/card_attributes.rb +++ b/lib/paypal_server_sdk/models/card_attributes.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Additional attributes associated with the use of this card. diff --git a/lib/paypal_server_sdk/models/card_attributes_response.rb b/lib/paypal_server_sdk/models/card_attributes_response.rb index 33a8d41..4dc142c 100644 --- a/lib/paypal_server_sdk/models/card_attributes_response.rb +++ b/lib/paypal_server_sdk/models/card_attributes_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Additional attributes associated with the use of this card. diff --git a/lib/paypal_server_sdk/models/card_authentication_response.rb b/lib/paypal_server_sdk/models/card_authentication_response.rb index 431a76f..917f2c3 100644 --- a/lib/paypal_server_sdk/models/card_authentication_response.rb +++ b/lib/paypal_server_sdk/models/card_authentication_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Results of Authentication such as 3D Secure. diff --git a/lib/paypal_server_sdk/models/card_brand.rb b/lib/paypal_server_sdk/models/card_brand.rb index 6ff404a..c176375 100644 --- a/lib/paypal_server_sdk/models/card_brand.rb +++ b/lib/paypal_server_sdk/models/card_brand.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The card network or brand. Applies to credit, debit, gift, and payment @@ -84,6 +84,21 @@ class CardBrand # network. EFTPOS = 'EFTPOS'.freeze, + # The Carte Bancaire payment network. + CARTE_BANCAIRE = 'CARTE_BANCAIRE'.freeze, + + # The Star Access payment network. + STAR_ACCESS = 'STAR_ACCESS'.freeze, + + # The Pulse payment network. + PULSE = 'PULSE'.freeze, + + # The NYCE payment network. + NYCE = 'NYCE'.freeze, + + # The Accel payment network. + ACCEL = 'ACCEL'.freeze, + # UNKNOWN payment network. UNKNOWN = 'UNKNOWN'.freeze ].freeze diff --git a/lib/paypal_server_sdk/models/card_customer.rb b/lib/paypal_server_sdk/models/card_customer.rb new file mode 100644 index 0000000..bbdb9f8 --- /dev/null +++ b/lib/paypal_server_sdk/models/card_customer.rb @@ -0,0 +1,98 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The details about a customer in PayPal's system of record. + class CardCustomer < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The unique ID for a customer generated by PayPal. + # @return [String] + attr_accessor :id + + # The internationalized email address. Note: Up to 64 characters are allowed + # before and 255 characters are allowed after the @ sign. However, the + # generally accepted maximum length for an email address is 254 characters. + # The pattern verifies that an unquoted @ sign exists. + # @return [String] + attr_accessor :email_address + + # The phone information. + # @return [PhoneWithType] + attr_accessor :phone + + # Merchants and partners may already have a data-store where their customer + # information is persisted. Use merchant_customer_id to associate the + # PayPal-generated customer.id to your representation of a customer. + # @return [String] + attr_accessor :merchant_customer_id + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['id'] = 'id' + @_hash['email_address'] = 'email_address' + @_hash['phone'] = 'phone' + @_hash['merchant_customer_id'] = 'merchant_customer_id' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + id + email_address + phone + merchant_customer_id + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(id: SKIP, email_address: SKIP, phone: SKIP, + merchant_customer_id: SKIP) + @id = id unless id == SKIP + @email_address = email_address unless email_address == SKIP + @phone = phone unless phone == SKIP + @merchant_customer_id = merchant_customer_id unless merchant_customer_id == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + id = hash.key?('id') ? hash['id'] : SKIP + email_address = hash.key?('email_address') ? hash['email_address'] : SKIP + phone = PhoneWithType.from_hash(hash['phone']) if hash['phone'] + merchant_customer_id = + hash.key?('merchant_customer_id') ? hash['merchant_customer_id'] : SKIP + + # Create object from extracted values. + CardCustomer.new(id: id, + email_address: email_address, + phone: phone, + merchant_customer_id: merchant_customer_id) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id}, email_address: #{@email_address}, phone: #{@phone},"\ + " merchant_customer_id: #{@merchant_customer_id}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id.inspect}, email_address: #{@email_address.inspect}, phone:"\ + " #{@phone.inspect}, merchant_customer_id: #{@merchant_customer_id.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/card_customer_information.rb b/lib/paypal_server_sdk/models/card_customer_information.rb index 7aad920..bf384e9 100644 --- a/lib/paypal_server_sdk/models/card_customer_information.rb +++ b/lib/paypal_server_sdk/models/card_customer_information.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details about a customer in PayPal's system of record. diff --git a/lib/paypal_server_sdk/models/card_experience_context.rb b/lib/paypal_server_sdk/models/card_experience_context.rb index 8dd5ecc..3caa0a6 100644 --- a/lib/paypal_server_sdk/models/card_experience_context.rb +++ b/lib/paypal_server_sdk/models/card_experience_context.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Customizes the payer experience during the 3DS Approval for payment. diff --git a/lib/paypal_server_sdk/models/card_from_request.rb b/lib/paypal_server_sdk/models/card_from_request.rb index 9554586..ec38eab 100644 --- a/lib/paypal_server_sdk/models/card_from_request.rb +++ b/lib/paypal_server_sdk/models/card_from_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Representation of card details as received in the request. diff --git a/lib/paypal_server_sdk/models/card_payment_token_entity.rb b/lib/paypal_server_sdk/models/card_payment_token_entity.rb index 7f38127..9f971e1 100644 --- a/lib/paypal_server_sdk/models/card_payment_token_entity.rb +++ b/lib/paypal_server_sdk/models/card_payment_token_entity.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Full representation of a Card Payment Token. diff --git a/lib/paypal_server_sdk/models/card_request.rb b/lib/paypal_server_sdk/models/card_request.rb index 536eccf..30e6109 100644 --- a/lib/paypal_server_sdk/models/card_request.rb +++ b/lib/paypal_server_sdk/models/card_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment card to use to fund a payment. Can be a credit or debit card. diff --git a/lib/paypal_server_sdk/models/card_response.rb b/lib/paypal_server_sdk/models/card_response.rb index 0b77889..5e9c868 100644 --- a/lib/paypal_server_sdk/models/card_response.rb +++ b/lib/paypal_server_sdk/models/card_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment card to use to fund a payment. Card can be a credit or debit diff --git a/lib/paypal_server_sdk/models/card_response_address.rb b/lib/paypal_server_sdk/models/card_response_address.rb index 5282fcf..11f223b 100644 --- a/lib/paypal_server_sdk/models/card_response_address.rb +++ b/lib/paypal_server_sdk/models/card_response_address.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Address request details. diff --git a/lib/paypal_server_sdk/models/card_response_with_billing_address.rb b/lib/paypal_server_sdk/models/card_response_with_billing_address.rb new file mode 100644 index 0000000..e603088 --- /dev/null +++ b/lib/paypal_server_sdk/models/card_response_with_billing_address.rb @@ -0,0 +1,100 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The payment card used to fund the payment. Card can be a credit or debit + # card. + class CardResponseWithBillingAddress < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The card holder's name as it appears on the card. + # @return [String] + attr_accessor :name + + # The portable international postal address. Maps to + # [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/ + # wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: + # the autocomplete + # attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-co + # ntrols-the-autocomplete-attribute). + # @return [Address] + attr_accessor :billing_address + + # The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date + # and time format](https://tools.ietf.org/html/rfc3339#section-5.6). + # @return [String] + attr_accessor :expiry + + # The [three-character ISO-4217 currency + # code](/api/rest/reference/currency-codes/) that identifies the currency. + # @return [String] + attr_accessor :currency_code + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['name'] = 'name' + @_hash['billing_address'] = 'billing_address' + @_hash['expiry'] = 'expiry' + @_hash['currency_code'] = 'currency_code' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + name + billing_address + expiry + currency_code + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(name: SKIP, billing_address: SKIP, expiry: SKIP, + currency_code: SKIP) + @name = name unless name == SKIP + @billing_address = billing_address unless billing_address == SKIP + @expiry = expiry unless expiry == SKIP + @currency_code = currency_code unless currency_code == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + name = hash.key?('name') ? hash['name'] : SKIP + billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address'] + expiry = hash.key?('expiry') ? hash['expiry'] : SKIP + currency_code = hash.key?('currency_code') ? hash['currency_code'] : SKIP + + # Create object from extracted values. + CardResponseWithBillingAddress.new(name: name, + billing_address: billing_address, + expiry: expiry, + currency_code: currency_code) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name}, billing_address: #{@billing_address}, expiry: #{@expiry},"\ + " currency_code: #{@currency_code}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name.inspect}, billing_address: #{@billing_address.inspect},"\ + " expiry: #{@expiry.inspect}, currency_code: #{@currency_code.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/card_stored_credential.rb b/lib/paypal_server_sdk/models/card_stored_credential.rb index 5c1a6ae..e7d4f74 100644 --- a/lib/paypal_server_sdk/models/card_stored_credential.rb +++ b/lib/paypal_server_sdk/models/card_stored_credential.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Provides additional details to process a payment using a `card` that has @@ -32,7 +32,7 @@ class CardStoredCredential < BaseModel attr_accessor :usage # Reference values used by the card network to identify a transaction. - # @return [NetworkTransactionReference] + # @return [NetworkTransaction] attr_accessor :previous_network_transaction_reference # A mapping from model property names to API property names. @@ -81,7 +81,7 @@ def self.from_hash(hash) payment_type = hash.key?('payment_type') ? hash['payment_type'] : nil usage = hash['usage'] ||= StoredPaymentSourceUsageType::DERIVED if hash['previous_network_transaction_reference'] - previous_network_transaction_reference = NetworkTransactionReference.from_hash(hash['previous_network_transaction_reference']) + previous_network_transaction_reference = NetworkTransaction.from_hash(hash['previous_network_transaction_reference']) end # Create object from extracted values. diff --git a/lib/paypal_server_sdk/models/card_supplementary_data.rb b/lib/paypal_server_sdk/models/card_supplementary_data.rb index dd0eba8..c340e08 100644 --- a/lib/paypal_server_sdk/models/card_supplementary_data.rb +++ b/lib/paypal_server_sdk/models/card_supplementary_data.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Merchants and partners can add Level 2 and 3 data to payments to reduce risk diff --git a/lib/paypal_server_sdk/models/card_type.rb b/lib/paypal_server_sdk/models/card_type.rb index bc4afe6..84495b9 100644 --- a/lib/paypal_server_sdk/models/card_type.rb +++ b/lib/paypal_server_sdk/models/card_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Type of card. i.e Credit, Debit and so on. diff --git a/lib/paypal_server_sdk/models/card_vault_response.rb b/lib/paypal_server_sdk/models/card_vault_response.rb index 4b456da..2686423 100644 --- a/lib/paypal_server_sdk/models/card_vault_response.rb +++ b/lib/paypal_server_sdk/models/card_vault_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details about a saved Card payment source. diff --git a/lib/paypal_server_sdk/models/card_verification.rb b/lib/paypal_server_sdk/models/card_verification.rb index 4d13f59..718f1b7 100644 --- a/lib/paypal_server_sdk/models/card_verification.rb +++ b/lib/paypal_server_sdk/models/card_verification.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The API caller can opt in to verify the card through PayPal offered diff --git a/lib/paypal_server_sdk/models/card_verification_details.rb b/lib/paypal_server_sdk/models/card_verification_details.rb index 9786694..91d6c17 100644 --- a/lib/paypal_server_sdk/models/card_verification_details.rb +++ b/lib/paypal_server_sdk/models/card_verification_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Card Verification details including the authorization details and 3D SECURE @@ -22,15 +22,15 @@ class CardVerificationDetails < BaseModel # @return [String] attr_accessor :date - # The card network or brand. Applies to credit, debit, gift, and payment - # cards. + # DEPRECATED. This field is DEPRECATED. Please find the network data in the + # 'network' field under the 'network_transaction_reference' object instead + # of the 'verification' object. # @return [CardBrand] attr_accessor :network - # The date and time, in [Internet date and time - # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are - # required while fractional seconds are optional. Note: The regular - # expression provides guidance but does not reject all invalid dates. + # DEPRECATED. This field is DEPRECATED. Please find the time data in the + # 'time' field under the 'network_transaction_reference' object instead of + # the 'verification' object. # @return [String] attr_accessor :time diff --git a/lib/paypal_server_sdk/models/card_verification_processor_response.rb b/lib/paypal_server_sdk/models/card_verification_processor_response.rb index 14969ea..9ad21ca 100644 --- a/lib/paypal_server_sdk/models/card_verification_processor_response.rb +++ b/lib/paypal_server_sdk/models/card_verification_processor_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The processor response information for payment requests, such as direct diff --git a/lib/paypal_server_sdk/models/card_verification_status.rb b/lib/paypal_server_sdk/models/card_verification_status.rb index 1cf2ccf..61a1511 100644 --- a/lib/paypal_server_sdk/models/card_verification_status.rb +++ b/lib/paypal_server_sdk/models/card_verification_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Verification status of Card. diff --git a/lib/paypal_server_sdk/models/cart_information.rb b/lib/paypal_server_sdk/models/cart_information.rb new file mode 100644 index 0000000..3f97470 --- /dev/null +++ b/lib/paypal_server_sdk/models/cart_information.rb @@ -0,0 +1,94 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The cart information. + class CartInformation < BaseModel + SKIP = Object.new + private_constant :SKIP + + # An array of item details. + # @return [Array[ItemDetails]] + attr_accessor :item_details + + # Indicates whether the item amount or the shipping amount already includes + # tax. + # @return [TrueClass | FalseClass] + attr_accessor :tax_inclusive + + # The ID of the invoice. Appears for only PayPal-generated invoices. + # @return [String] + attr_accessor :paypal_invoice_id + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['item_details'] = 'item_details' + @_hash['tax_inclusive'] = 'tax_inclusive' + @_hash['paypal_invoice_id'] = 'paypal_invoice_id' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + item_details + tax_inclusive + paypal_invoice_id + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(item_details: SKIP, tax_inclusive: false, + paypal_invoice_id: SKIP) + @item_details = item_details unless item_details == SKIP + @tax_inclusive = tax_inclusive unless tax_inclusive == SKIP + @paypal_invoice_id = paypal_invoice_id unless paypal_invoice_id == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + item_details = nil + unless hash['item_details'].nil? + item_details = [] + hash['item_details'].each do |structure| + item_details << (ItemDetails.from_hash(structure) if structure) + end + end + + item_details = SKIP unless hash.key?('item_details') + tax_inclusive = hash['tax_inclusive'] ||= false + paypal_invoice_id = + hash.key?('paypal_invoice_id') ? hash['paypal_invoice_id'] : SKIP + + # Create object from extracted values. + CartInformation.new(item_details: item_details, + tax_inclusive: tax_inclusive, + paypal_invoice_id: paypal_invoice_id) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} item_details: #{@item_details}, tax_inclusive: #{@tax_inclusive},"\ + " paypal_invoice_id: #{@paypal_invoice_id}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} item_details: #{@item_details.inspect}, tax_inclusive:"\ + " #{@tax_inclusive.inspect}, paypal_invoice_id: #{@paypal_invoice_id.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/checkout_option.rb b/lib/paypal_server_sdk/models/checkout_option.rb new file mode 100644 index 0000000..1f39ff1 --- /dev/null +++ b/lib/paypal_server_sdk/models/checkout_option.rb @@ -0,0 +1,77 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # A checkout option as a name-and-value pair. + class CheckoutOption < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The checkout option name, such as `color` or `texture`. + # @return [String] + attr_accessor :checkout_option_name + + # The checkout option value. For example, the checkout option `color` might + # be `blue` or `red` while the checkout option `texture` might be `smooth` + # or `rippled`. + # @return [String] + attr_accessor :checkout_option_value + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['checkout_option_name'] = 'checkout_option_name' + @_hash['checkout_option_value'] = 'checkout_option_value' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + checkout_option_name + checkout_option_value + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(checkout_option_name: SKIP, checkout_option_value: SKIP) + @checkout_option_name = checkout_option_name unless checkout_option_name == SKIP + @checkout_option_value = checkout_option_value unless checkout_option_value == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + checkout_option_name = + hash.key?('checkout_option_name') ? hash['checkout_option_name'] : SKIP + checkout_option_value = + hash.key?('checkout_option_value') ? hash['checkout_option_value'] : SKIP + + # Create object from extracted values. + CheckoutOption.new(checkout_option_name: checkout_option_name, + checkout_option_value: checkout_option_value) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} checkout_option_name: #{@checkout_option_name}, checkout_option_value:"\ + " #{@checkout_option_value}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} checkout_option_name: #{@checkout_option_name.inspect},"\ + " checkout_option_value: #{@checkout_option_value.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/checkout_payment_intent.rb b/lib/paypal_server_sdk/models/checkout_payment_intent.rb index dd8c33b..91b894f 100644 --- a/lib/paypal_server_sdk/models/checkout_payment_intent.rb +++ b/lib/paypal_server_sdk/models/checkout_payment_intent.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The intent to either capture payment immediately or authorize a payment for diff --git a/lib/paypal_server_sdk/models/cobranded_card.rb b/lib/paypal_server_sdk/models/cobranded_card.rb index 60eb90c..b8a7f4b 100644 --- a/lib/paypal_server_sdk/models/cobranded_card.rb +++ b/lib/paypal_server_sdk/models/cobranded_card.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Details about the merchant cobranded card used for order purchase. diff --git a/lib/paypal_server_sdk/models/confirm_order_request.rb b/lib/paypal_server_sdk/models/confirm_order_request.rb index 6980966..18a4aea 100644 --- a/lib/paypal_server_sdk/models/confirm_order_request.rb +++ b/lib/paypal_server_sdk/models/confirm_order_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Payer confirms the intent to pay for the Order using the provided payment diff --git a/lib/paypal_server_sdk/models/create_subscription_request.rb b/lib/paypal_server_sdk/models/create_subscription_request.rb new file mode 100644 index 0000000..60f4432 --- /dev/null +++ b/lib/paypal_server_sdk/models/create_subscription_request.rb @@ -0,0 +1,151 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The create subscription request details. + class CreateSubscriptionRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The ID of the plan. + # @return [String] + attr_accessor :plan_id + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :start_time + + # The quantity of the product in the subscription. + # @return [String] + attr_accessor :quantity + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :shipping_amount + + # The subscriber request information . + # @return [SubscriberRequest] + attr_accessor :subscriber + + # DEPRECATED. Indicates whether the subscription auto-renews after the + # billing cycles complete. + # @return [TrueClass | FalseClass] + attr_accessor :auto_renewal + + # DEPRECATED. The application context, which customizes the payer experience + # during the subscription approval process with PayPal. + # @return [SubscriptionApplicationContext] + attr_accessor :application_context + + # The custom id for the subscription. Can be invoice id. + # @return [String] + attr_accessor :custom_id + + # An inline plan object to customise the subscription. You can override plan + # level default attributes by providing customised values for the + # subscription in this object. + # @return [PlanOverride] + attr_accessor :plan + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['plan_id'] = 'plan_id' + @_hash['start_time'] = 'start_time' + @_hash['quantity'] = 'quantity' + @_hash['shipping_amount'] = 'shipping_amount' + @_hash['subscriber'] = 'subscriber' + @_hash['auto_renewal'] = 'auto_renewal' + @_hash['application_context'] = 'application_context' + @_hash['custom_id'] = 'custom_id' + @_hash['plan'] = 'plan' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + start_time + quantity + shipping_amount + subscriber + auto_renewal + application_context + custom_id + plan + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(plan_id:, start_time: SKIP, quantity: SKIP, + shipping_amount: SKIP, subscriber: SKIP, auto_renewal: false, + application_context: SKIP, custom_id: SKIP, plan: SKIP) + @plan_id = plan_id + @start_time = start_time unless start_time == SKIP + @quantity = quantity unless quantity == SKIP + @shipping_amount = shipping_amount unless shipping_amount == SKIP + @subscriber = subscriber unless subscriber == SKIP + @auto_renewal = auto_renewal unless auto_renewal == SKIP + @application_context = application_context unless application_context == SKIP + @custom_id = custom_id unless custom_id == SKIP + @plan = plan unless plan == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + plan_id = hash.key?('plan_id') ? hash['plan_id'] : nil + start_time = hash.key?('start_time') ? hash['start_time'] : SKIP + quantity = hash.key?('quantity') ? hash['quantity'] : SKIP + shipping_amount = Money.from_hash(hash['shipping_amount']) if hash['shipping_amount'] + subscriber = SubscriberRequest.from_hash(hash['subscriber']) if hash['subscriber'] + auto_renewal = hash['auto_renewal'] ||= false + application_context = SubscriptionApplicationContext.from_hash(hash['application_context']) if + hash['application_context'] + custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP + plan = PlanOverride.from_hash(hash['plan']) if hash['plan'] + + # Create object from extracted values. + CreateSubscriptionRequest.new(plan_id: plan_id, + start_time: start_time, + quantity: quantity, + shipping_amount: shipping_amount, + subscriber: subscriber, + auto_renewal: auto_renewal, + application_context: application_context, + custom_id: custom_id, + plan: plan) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} plan_id: #{@plan_id}, start_time: #{@start_time}, quantity: #{@quantity},"\ + " shipping_amount: #{@shipping_amount}, subscriber: #{@subscriber}, auto_renewal:"\ + " #{@auto_renewal}, application_context: #{@application_context}, custom_id: #{@custom_id},"\ + " plan: #{@plan}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} plan_id: #{@plan_id.inspect}, start_time: #{@start_time.inspect}, quantity:"\ + " #{@quantity.inspect}, shipping_amount: #{@shipping_amount.inspect}, subscriber:"\ + " #{@subscriber.inspect}, auto_renewal: #{@auto_renewal.inspect}, application_context:"\ + " #{@application_context.inspect}, custom_id: #{@custom_id.inspect}, plan:"\ + " #{@plan.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/customer.rb b/lib/paypal_server_sdk/models/customer.rb index 13ad548..fabd3aa 100644 --- a/lib/paypal_server_sdk/models/customer.rb +++ b/lib/paypal_server_sdk/models/customer.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # This object defines a customer in your system. Use it to manage customer diff --git a/lib/paypal_server_sdk/models/customer_information.rb b/lib/paypal_server_sdk/models/customer_information.rb index 10472ef..e92a726 100644 --- a/lib/paypal_server_sdk/models/customer_information.rb +++ b/lib/paypal_server_sdk/models/customer_information.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # This object represents a merchant’s customer, allowing them to store contact diff --git a/lib/paypal_server_sdk/models/customer_response.rb b/lib/paypal_server_sdk/models/customer_response.rb index 988b1da..30deb69 100644 --- a/lib/paypal_server_sdk/models/customer_response.rb +++ b/lib/paypal_server_sdk/models/customer_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Customer in merchant's or partner's system of records. diff --git a/lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb b/lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb index 43125c7..42cd481 100644 --- a/lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb +++ b/lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Collection of payment tokens saved for a given customer. diff --git a/lib/paypal_server_sdk/models/cvv_code.rb b/lib/paypal_server_sdk/models/cvv_code.rb index 8089af7..607d59e 100644 --- a/lib/paypal_server_sdk/models/cvv_code.rb +++ b/lib/paypal_server_sdk/models/cvv_code.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The card verification value code for for Visa, Discover, Mastercard, or diff --git a/lib/paypal_server_sdk/models/cycle_execution.rb b/lib/paypal_server_sdk/models/cycle_execution.rb new file mode 100644 index 0000000..c9ea55d --- /dev/null +++ b/lib/paypal_server_sdk/models/cycle_execution.rb @@ -0,0 +1,124 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The regular and trial execution details for a billing cycle. + class CycleExecution < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The type of the billing cycle. + # @return [TenureType] + attr_accessor :tenure_type + + # The order in which to run this cycle among other billing cycles. + # @return [Integer] + attr_accessor :sequence + + # The number of billing cycles that have completed. + # @return [Integer] + attr_accessor :cycles_completed + + # For a finite billing cycle, cycles_remaining is the number of remaining + # cycles. For an infinite billing cycle, cycles_remaining is set as 0. + # @return [Integer] + attr_accessor :cycles_remaining + + # The active pricing scheme version for the billing cycle. + # @return [Integer] + attr_accessor :current_pricing_scheme_version + + # The number of times this billing cycle gets executed. Trial billing cycles + # can only be executed a finite number of times (value between 1 and 999 for + # total_cycles). Regular billing cycles can be executed infinite times + # (value of 0 for total_cycles) or a finite number of times (value between 1 + # and 999 for total_cycles). + # @return [Integer] + attr_accessor :total_cycles + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['tenure_type'] = 'tenure_type' + @_hash['sequence'] = 'sequence' + @_hash['cycles_completed'] = 'cycles_completed' + @_hash['cycles_remaining'] = 'cycles_remaining' + @_hash['current_pricing_scheme_version'] = + 'current_pricing_scheme_version' + @_hash['total_cycles'] = 'total_cycles' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + cycles_remaining + current_pricing_scheme_version + total_cycles + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(tenure_type:, sequence:, cycles_completed:, + cycles_remaining: SKIP, current_pricing_scheme_version: SKIP, + total_cycles: SKIP) + @tenure_type = tenure_type + @sequence = sequence + @cycles_completed = cycles_completed + @cycles_remaining = cycles_remaining unless cycles_remaining == SKIP + unless current_pricing_scheme_version == SKIP + @current_pricing_scheme_version = + current_pricing_scheme_version + end + @total_cycles = total_cycles unless total_cycles == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + tenure_type = hash.key?('tenure_type') ? hash['tenure_type'] : nil + sequence = hash.key?('sequence') ? hash['sequence'] : nil + cycles_completed = + hash.key?('cycles_completed') ? hash['cycles_completed'] : nil + cycles_remaining = + hash.key?('cycles_remaining') ? hash['cycles_remaining'] : SKIP + current_pricing_scheme_version = + hash.key?('current_pricing_scheme_version') ? hash['current_pricing_scheme_version'] : SKIP + total_cycles = hash.key?('total_cycles') ? hash['total_cycles'] : SKIP + + # Create object from extracted values. + CycleExecution.new(tenure_type: tenure_type, + sequence: sequence, + cycles_completed: cycles_completed, + cycles_remaining: cycles_remaining, + current_pricing_scheme_version: current_pricing_scheme_version, + total_cycles: total_cycles) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} tenure_type: #{@tenure_type}, sequence: #{@sequence}, cycles_completed:"\ + " #{@cycles_completed}, cycles_remaining: #{@cycles_remaining},"\ + " current_pricing_scheme_version: #{@current_pricing_scheme_version}, total_cycles:"\ + " #{@total_cycles}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} tenure_type: #{@tenure_type.inspect}, sequence: #{@sequence.inspect},"\ + " cycles_completed: #{@cycles_completed.inspect}, cycles_remaining:"\ + " #{@cycles_remaining.inspect}, current_pricing_scheme_version:"\ + " #{@current_pricing_scheme_version.inspect}, total_cycles: #{@total_cycles.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/disbursement_mode.rb b/lib/paypal_server_sdk/models/disbursement_mode.rb index e47f2d7..5d7cc71 100644 --- a/lib/paypal_server_sdk/models/disbursement_mode.rb +++ b/lib/paypal_server_sdk/models/disbursement_mode.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The funds that are held on behalf of the merchant. diff --git a/lib/paypal_server_sdk/models/dispute_category.rb b/lib/paypal_server_sdk/models/dispute_category.rb index 6d65eac..964874e 100644 --- a/lib/paypal_server_sdk/models/dispute_category.rb +++ b/lib/paypal_server_sdk/models/dispute_category.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The condition that is covered for the transaction. diff --git a/lib/paypal_server_sdk/models/eci_flag.rb b/lib/paypal_server_sdk/models/eci_flag.rb index d42c3eb..9f0b7b9 100644 --- a/lib/paypal_server_sdk/models/eci_flag.rb +++ b/lib/paypal_server_sdk/models/eci_flag.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Electronic Commerce Indicator (ECI). The ECI value is part of the 2 data diff --git a/lib/paypal_server_sdk/models/enrollment_status.rb b/lib/paypal_server_sdk/models/enrollment_status.rb index 30b711e..4038b4f 100644 --- a/lib/paypal_server_sdk/models/enrollment_status.rb +++ b/lib/paypal_server_sdk/models/enrollment_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Status of Authentication eligibility. diff --git a/lib/paypal_server_sdk/models/eps_payment_object.rb b/lib/paypal_server_sdk/models/eps_payment_object.rb index 718fa92..36947af 100644 --- a/lib/paypal_server_sdk/models/eps_payment_object.rb +++ b/lib/paypal_server_sdk/models/eps_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information used to pay using eps. diff --git a/lib/paypal_server_sdk/models/eps_payment_request.rb b/lib/paypal_server_sdk/models/eps_payment_request.rb index 7a3549e..27a16b4 100644 --- a/lib/paypal_server_sdk/models/eps_payment_request.rb +++ b/lib/paypal_server_sdk/models/eps_payment_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using eps. diff --git a/lib/paypal_server_sdk/models/error_details.rb b/lib/paypal_server_sdk/models/error_details.rb index 91de36d..3d7177a 100644 --- a/lib/paypal_server_sdk/models/error_details.rb +++ b/lib/paypal_server_sdk/models/error_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The error details. Required for client-side `4XX` errors. diff --git a/lib/paypal_server_sdk/models/exchange_rate.rb b/lib/paypal_server_sdk/models/exchange_rate.rb index 58d5f0c..5db5d16 100644 --- a/lib/paypal_server_sdk/models/exchange_rate.rb +++ b/lib/paypal_server_sdk/models/exchange_rate.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The exchange rate that determines the amount to convert from one currency to diff --git a/lib/paypal_server_sdk/models/experience_context.rb b/lib/paypal_server_sdk/models/experience_context.rb index f2bb7ea..0c5e685 100644 --- a/lib/paypal_server_sdk/models/experience_context.rb +++ b/lib/paypal_server_sdk/models/experience_context.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Customizes the payer experience during the approval process for the payment. @@ -27,7 +27,7 @@ class ExperienceContext < BaseModel attr_accessor :locale # The location from which the shipping address is derived. - # @return [ShippingPreference] + # @return [ExperienceContextShippingPreference] attr_accessor :shipping_preference # Describes the URL. @@ -65,9 +65,11 @@ def self.nullables [] end - def initialize(brand_name: SKIP, locale: SKIP, - shipping_preference: ShippingPreference::GET_FROM_FILE, - return_url: SKIP, cancel_url: SKIP) + def initialize( + brand_name: SKIP, locale: SKIP, + shipping_preference: ExperienceContextShippingPreference::GET_FROM_FILE, + return_url: SKIP, cancel_url: SKIP + ) @brand_name = brand_name unless brand_name == SKIP @locale = locale unless locale == SKIP @shipping_preference = shipping_preference unless shipping_preference == SKIP @@ -83,7 +85,7 @@ def self.from_hash(hash) brand_name = hash.key?('brand_name') ? hash['brand_name'] : SKIP locale = hash.key?('locale') ? hash['locale'] : SKIP shipping_preference = - hash['shipping_preference'] ||= ShippingPreference::GET_FROM_FILE + hash['shipping_preference'] ||= ExperienceContextShippingPreference::GET_FROM_FILE return_url = hash.key?('return_url') ? hash['return_url'] : SKIP cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : SKIP diff --git a/lib/paypal_server_sdk/models/experience_context_shipping_preference.rb b/lib/paypal_server_sdk/models/experience_context_shipping_preference.rb new file mode 100644 index 0000000..9a12fef --- /dev/null +++ b/lib/paypal_server_sdk/models/experience_context_shipping_preference.rb @@ -0,0 +1,32 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The location from which the shipping address is derived., The shipping + # preference. This only applies to PayPal payment source., The shipping + # preference. This only applies to PayPal payment source., The location from + # which the shipping address is derived. + class ExperienceContextShippingPreference + EXPERIENCE_CONTEXT_SHIPPING_PREFERENCE = [ + # Get the customer-provided shipping address on the PayPal site. + GET_FROM_FILE = 'GET_FROM_FILE'.freeze, + + # Redacts the shipping address from the PayPal site. Recommended for + # digital goods. + NO_SHIPPING = 'NO_SHIPPING'.freeze, + + # Merchant sends the shipping address using + # purchase_units.shipping.address. The customer cannot change this address + # on the PayPal site. + SET_PROVIDED_ADDRESS = 'SET_PROVIDED_ADDRESS'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/experience_status.rb b/lib/paypal_server_sdk/models/experience_status.rb new file mode 100644 index 0000000..d1341e1 --- /dev/null +++ b/lib/paypal_server_sdk/models/experience_status.rb @@ -0,0 +1,33 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # This field indicates the status of PayPal's Checkout experience throughout + # the order lifecycle. The values reflect the current stage of the checkout + # process. + class ExperienceStatus + EXPERIENCE_STATUS = [ + # PayPal checkout process has not yet begun. + NOT_STARTED = 'NOT_STARTED'.freeze, + + # PayPal checkout initiated. User is on the checkout page for order review + # before approval. + IN_PROGRESS = 'IN_PROGRESS'.freeze, + + # PayPal checkout is canceled (by closing the checkout window or clicking + # cancel) before the order approval. + CANCELED = 'CANCELED'.freeze, + + # Order is approved. User has completed the checkout process. + APPROVED = 'APPROVED'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/failed_payment_details.rb b/lib/paypal_server_sdk/models/failed_payment_details.rb new file mode 100644 index 0000000..a429d77 --- /dev/null +++ b/lib/paypal_server_sdk/models/failed_payment_details.rb @@ -0,0 +1,98 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The details for the failed payment of the subscription. + class FailedPaymentDetails < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :amount + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :time + + # The reason code for the payment failure. + # @return [ReasonCode] + attr_accessor :reason_code + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :next_payment_retry_time + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['amount'] = 'amount' + @_hash['time'] = 'time' + @_hash['reason_code'] = 'reason_code' + @_hash['next_payment_retry_time'] = 'next_payment_retry_time' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + reason_code + next_payment_retry_time + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(amount:, time:, reason_code: SKIP, + next_payment_retry_time: SKIP) + @amount = amount + @time = time + @reason_code = reason_code unless reason_code == SKIP + @next_payment_retry_time = next_payment_retry_time unless next_payment_retry_time == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + amount = Money.from_hash(hash['amount']) if hash['amount'] + time = hash.key?('time') ? hash['time'] : nil + reason_code = hash.key?('reason_code') ? hash['reason_code'] : SKIP + next_payment_retry_time = + hash.key?('next_payment_retry_time') ? hash['next_payment_retry_time'] : SKIP + + # Create object from extracted values. + FailedPaymentDetails.new(amount: amount, + time: time, + reason_code: reason_code, + next_payment_retry_time: next_payment_retry_time) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} amount: #{@amount}, time: #{@time}, reason_code: #{@reason_code},"\ + " next_payment_retry_time: #{@next_payment_retry_time}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} amount: #{@amount.inspect}, time: #{@time.inspect}, reason_code:"\ + " #{@reason_code.inspect}, next_payment_retry_time: #{@next_payment_retry_time.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/frequency.rb b/lib/paypal_server_sdk/models/frequency.rb new file mode 100644 index 0000000..17e7206 --- /dev/null +++ b/lib/paypal_server_sdk/models/frequency.rb @@ -0,0 +1,75 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The frequency of the billing cycle. + class Frequency < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The interval at which the subscription is charged or billed. + # @return [IntervalUnit] + attr_accessor :interval_unit + + # The number of intervals after which a subscriber is billed. For example, + # if the `interval_unit` is `DAY` with an `interval_count` of `2`, the + # subscription is billed once every two days. The following table lists the + # maximum allowed values for the `interval_count` for each `interval_unit`: + # Interval unit Maximum interval count DAY 365 WEEK 52 MONTH 12 YEAR 1 + # @return [Integer] + attr_accessor :interval_count + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['interval_unit'] = 'interval_unit' + @_hash['interval_count'] = 'interval_count' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + interval_count + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(interval_unit:, interval_count: 1) + @interval_unit = interval_unit + @interval_count = interval_count unless interval_count == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : nil + interval_count = hash['interval_count'] ||= 1 + + # Create object from extracted values. + Frequency.new(interval_unit: interval_unit, + interval_count: interval_count) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} interval_unit: #{@interval_unit}, interval_count: #{@interval_count}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} interval_unit: #{@interval_unit.inspect}, interval_count:"\ + " #{@interval_count.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/fulfillment_type.rb b/lib/paypal_server_sdk/models/fulfillment_type.rb index 9344601..9e6ab6e 100644 --- a/lib/paypal_server_sdk/models/fulfillment_type.rb +++ b/lib/paypal_server_sdk/models/fulfillment_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # A classification for the method of purchase fulfillment (e.g shipping, diff --git a/lib/paypal_server_sdk/models/giropay_payment_object.rb b/lib/paypal_server_sdk/models/giropay_payment_object.rb index fb58057..6dfb776 100644 --- a/lib/paypal_server_sdk/models/giropay_payment_object.rb +++ b/lib/paypal_server_sdk/models/giropay_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using giropay. diff --git a/lib/paypal_server_sdk/models/giropay_payment_request.rb b/lib/paypal_server_sdk/models/giropay_payment_request.rb index 2c11458..12e503e 100644 --- a/lib/paypal_server_sdk/models/giropay_payment_request.rb +++ b/lib/paypal_server_sdk/models/giropay_payment_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using giropay. diff --git a/lib/paypal_server_sdk/models/google_pay_authentication_method.rb b/lib/paypal_server_sdk/models/google_pay_authentication_method.rb index b11d71a..8a40c0f 100644 --- a/lib/paypal_server_sdk/models/google_pay_authentication_method.rb +++ b/lib/paypal_server_sdk/models/google_pay_authentication_method.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Authentication Method which is used for the card transaction. diff --git a/lib/paypal_server_sdk/models/google_pay_card.rb b/lib/paypal_server_sdk/models/google_pay_card.rb index 34ec682..0159bd3 100644 --- a/lib/paypal_server_sdk/models/google_pay_card.rb +++ b/lib/paypal_server_sdk/models/google_pay_card.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment card used to fund a Google Pay payment. Can be a credit or debit diff --git a/lib/paypal_server_sdk/models/google_pay_card_response.rb b/lib/paypal_server_sdk/models/google_pay_card_response.rb index b810cb3..a7050d1 100644 --- a/lib/paypal_server_sdk/models/google_pay_card_response.rb +++ b/lib/paypal_server_sdk/models/google_pay_card_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment card to use to fund a Google Pay payment response. Can be a diff --git a/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb b/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb index 013097f..ced36c7 100644 --- a/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb +++ b/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Details shared by Google for the merchant to be shared with PayPal. This is diff --git a/lib/paypal_server_sdk/models/google_pay_experience_context.rb b/lib/paypal_server_sdk/models/google_pay_experience_context.rb index 3158069..5392de4 100644 --- a/lib/paypal_server_sdk/models/google_pay_experience_context.rb +++ b/lib/paypal_server_sdk/models/google_pay_experience_context.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Customizes the payer experience during the approval process for the payment. diff --git a/lib/paypal_server_sdk/models/google_pay_payment_method.rb b/lib/paypal_server_sdk/models/google_pay_payment_method.rb index d04b7dd..4e0d828 100644 --- a/lib/paypal_server_sdk/models/google_pay_payment_method.rb +++ b/lib/paypal_server_sdk/models/google_pay_payment_method.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The type of the payment credential. Currently, only CARD is supported. diff --git a/lib/paypal_server_sdk/models/google_pay_request.rb b/lib/paypal_server_sdk/models/google_pay_request.rb index 9126d85..3fad7e0 100644 --- a/lib/paypal_server_sdk/models/google_pay_request.rb +++ b/lib/paypal_server_sdk/models/google_pay_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using Google Pay. diff --git a/lib/paypal_server_sdk/models/google_pay_request_card.rb b/lib/paypal_server_sdk/models/google_pay_request_card.rb index 3a90ea7..f4a6d19 100644 --- a/lib/paypal_server_sdk/models/google_pay_request_card.rb +++ b/lib/paypal_server_sdk/models/google_pay_request_card.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment card used to fund a Google Pay payment. Can be a credit or debit diff --git a/lib/paypal_server_sdk/models/google_pay_wallet_response.rb b/lib/paypal_server_sdk/models/google_pay_wallet_response.rb index 556bb39..1f9fd6e 100644 --- a/lib/paypal_server_sdk/models/google_pay_wallet_response.rb +++ b/lib/paypal_server_sdk/models/google_pay_wallet_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Google Pay Wallet payment data. diff --git a/lib/paypal_server_sdk/models/ideal_payment_object.rb b/lib/paypal_server_sdk/models/ideal_payment_object.rb index 0de9289..63bd4e4 100644 --- a/lib/paypal_server_sdk/models/ideal_payment_object.rb +++ b/lib/paypal_server_sdk/models/ideal_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information used to pay using iDEAL. diff --git a/lib/paypal_server_sdk/models/ideal_payment_request.rb b/lib/paypal_server_sdk/models/ideal_payment_request.rb index a2d341a..c9e2785 100644 --- a/lib/paypal_server_sdk/models/ideal_payment_request.rb +++ b/lib/paypal_server_sdk/models/ideal_payment_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using iDEAL. diff --git a/lib/paypal_server_sdk/models/incentive_details.rb b/lib/paypal_server_sdk/models/incentive_details.rb new file mode 100644 index 0000000..dccadc6 --- /dev/null +++ b/lib/paypal_server_sdk/models/incentive_details.rb @@ -0,0 +1,99 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The incentive details. + class IncentiveDetails < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The type of incentive, such as a special offer or coupon. + # @return [String] + attr_accessor :incentive_type + + # The code that identifies an incentive, such as a coupon. + # @return [String] + attr_accessor :incentive_code + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :incentive_amount + + # The incentive program code that identifies a merchant loyalty or incentive + # program. + # @return [String] + attr_accessor :incentive_program_code + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['incentive_type'] = 'incentive_type' + @_hash['incentive_code'] = 'incentive_code' + @_hash['incentive_amount'] = 'incentive_amount' + @_hash['incentive_program_code'] = 'incentive_program_code' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + incentive_type + incentive_code + incentive_amount + incentive_program_code + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(incentive_type: SKIP, incentive_code: SKIP, + incentive_amount: SKIP, incentive_program_code: SKIP) + @incentive_type = incentive_type unless incentive_type == SKIP + @incentive_code = incentive_code unless incentive_code == SKIP + @incentive_amount = incentive_amount unless incentive_amount == SKIP + @incentive_program_code = incentive_program_code unless incentive_program_code == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + incentive_type = + hash.key?('incentive_type') ? hash['incentive_type'] : SKIP + incentive_code = + hash.key?('incentive_code') ? hash['incentive_code'] : SKIP + incentive_amount = Money.from_hash(hash['incentive_amount']) if hash['incentive_amount'] + incentive_program_code = + hash.key?('incentive_program_code') ? hash['incentive_program_code'] : SKIP + + # Create object from extracted values. + IncentiveDetails.new(incentive_type: incentive_type, + incentive_code: incentive_code, + incentive_amount: incentive_amount, + incentive_program_code: incentive_program_code) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} incentive_type: #{@incentive_type}, incentive_code: #{@incentive_code},"\ + " incentive_amount: #{@incentive_amount}, incentive_program_code:"\ + " #{@incentive_program_code}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} incentive_type: #{@incentive_type.inspect}, incentive_code:"\ + " #{@incentive_code.inspect}, incentive_amount: #{@incentive_amount.inspect},"\ + " incentive_program_code: #{@incentive_program_code.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/incentive_information.rb b/lib/paypal_server_sdk/models/incentive_information.rb new file mode 100644 index 0000000..5f570b4 --- /dev/null +++ b/lib/paypal_server_sdk/models/incentive_information.rb @@ -0,0 +1,71 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The incentive details. + class IncentiveInformation < BaseModel + SKIP = Object.new + private_constant :SKIP + + # An array of incentive details. + # @return [Array[IncentiveDetails]] + attr_accessor :incentive_details + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['incentive_details'] = 'incentive_details' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + incentive_details + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(incentive_details: SKIP) + @incentive_details = incentive_details unless incentive_details == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + incentive_details = nil + unless hash['incentive_details'].nil? + incentive_details = [] + hash['incentive_details'].each do |structure| + incentive_details << (IncentiveDetails.from_hash(structure) if structure) + end + end + + incentive_details = SKIP unless hash.key?('incentive_details') + + # Create object from extracted values. + IncentiveInformation.new(incentive_details: incentive_details) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} incentive_details: #{@incentive_details}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} incentive_details: #{@incentive_details.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/interval_unit.rb b/lib/paypal_server_sdk/models/interval_unit.rb new file mode 100644 index 0000000..f9a21ec --- /dev/null +++ b/lib/paypal_server_sdk/models/interval_unit.rb @@ -0,0 +1,29 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The interval at which the subscription is charged or billed. + class IntervalUnit + INTERVAL_UNIT = [ + # A daily billing cycle. + DAY = 'DAY'.freeze, + + # A weekly billing cycle. + WEEK = 'WEEK'.freeze, + + # A monthly billing cycle. + MONTH = 'MONTH'.freeze, + + # A yearly billing cycle. + YEAR = 'YEAR'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/item.rb b/lib/paypal_server_sdk/models/item.rb index 71dae13..3ee7438 100644 --- a/lib/paypal_server_sdk/models/item.rb +++ b/lib/paypal_server_sdk/models/item.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details for the items to be purchased. diff --git a/lib/paypal_server_sdk/models/item_category.rb b/lib/paypal_server_sdk/models/item_category.rb index 56d07fc..ed624b6 100644 --- a/lib/paypal_server_sdk/models/item_category.rb +++ b/lib/paypal_server_sdk/models/item_category.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The item category type. diff --git a/lib/paypal_server_sdk/models/item_details.rb b/lib/paypal_server_sdk/models/item_details.rb new file mode 100644 index 0000000..57b7b73 --- /dev/null +++ b/lib/paypal_server_sdk/models/item_details.rb @@ -0,0 +1,287 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The item details. + class ItemDetails < BaseModel + SKIP = Object.new + private_constant :SKIP + + # An item code that identifies a merchant's goods or service. + # @return [String] + attr_accessor :item_code + + # The item name. + # @return [String] + attr_accessor :item_name + + # The item description. + # @return [String] + attr_accessor :item_description + + # The item options. Describes option choices on the purchase of the item in + # some detail. + # @return [String] + attr_accessor :item_options + + # The number of purchased units of goods or a service. + # @return [String] + attr_accessor :item_quantity + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :item_unit_price + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :item_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :discount_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :adjustment_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :gift_wrap_amount + + # The percentage, as a fixed-point, signed decimal number. For example, + # define a 19.99% interest rate as `19.99`. + # @return [String] + attr_accessor :tax_percentage + + # An array of tax amounts levied by a government on the purchase of goods or + # services. + # @return [Array[TaxAmount]] + attr_accessor :tax_amounts + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :basic_shipping_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :extra_shipping_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :handling_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :insurance_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :total_item_amount + + # The invoice number. An alphanumeric string that identifies a billing for a + # merchant. + # @return [String] + attr_accessor :invoice_number + + # An array of checkout options. Each option has a name and value. + # @return [Array[CheckoutOption]] + attr_accessor :checkout_options + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['item_code'] = 'item_code' + @_hash['item_name'] = 'item_name' + @_hash['item_description'] = 'item_description' + @_hash['item_options'] = 'item_options' + @_hash['item_quantity'] = 'item_quantity' + @_hash['item_unit_price'] = 'item_unit_price' + @_hash['item_amount'] = 'item_amount' + @_hash['discount_amount'] = 'discount_amount' + @_hash['adjustment_amount'] = 'adjustment_amount' + @_hash['gift_wrap_amount'] = 'gift_wrap_amount' + @_hash['tax_percentage'] = 'tax_percentage' + @_hash['tax_amounts'] = 'tax_amounts' + @_hash['basic_shipping_amount'] = 'basic_shipping_amount' + @_hash['extra_shipping_amount'] = 'extra_shipping_amount' + @_hash['handling_amount'] = 'handling_amount' + @_hash['insurance_amount'] = 'insurance_amount' + @_hash['total_item_amount'] = 'total_item_amount' + @_hash['invoice_number'] = 'invoice_number' + @_hash['checkout_options'] = 'checkout_options' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + item_code + item_name + item_description + item_options + item_quantity + item_unit_price + item_amount + discount_amount + adjustment_amount + gift_wrap_amount + tax_percentage + tax_amounts + basic_shipping_amount + extra_shipping_amount + handling_amount + insurance_amount + total_item_amount + invoice_number + checkout_options + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(item_code: SKIP, item_name: SKIP, item_description: SKIP, + item_options: SKIP, item_quantity: SKIP, + item_unit_price: SKIP, item_amount: SKIP, + discount_amount: SKIP, adjustment_amount: SKIP, + gift_wrap_amount: SKIP, tax_percentage: SKIP, + tax_amounts: SKIP, basic_shipping_amount: SKIP, + extra_shipping_amount: SKIP, handling_amount: SKIP, + insurance_amount: SKIP, total_item_amount: SKIP, + invoice_number: SKIP, checkout_options: SKIP) + @item_code = item_code unless item_code == SKIP + @item_name = item_name unless item_name == SKIP + @item_description = item_description unless item_description == SKIP + @item_options = item_options unless item_options == SKIP + @item_quantity = item_quantity unless item_quantity == SKIP + @item_unit_price = item_unit_price unless item_unit_price == SKIP + @item_amount = item_amount unless item_amount == SKIP + @discount_amount = discount_amount unless discount_amount == SKIP + @adjustment_amount = adjustment_amount unless adjustment_amount == SKIP + @gift_wrap_amount = gift_wrap_amount unless gift_wrap_amount == SKIP + @tax_percentage = tax_percentage unless tax_percentage == SKIP + @tax_amounts = tax_amounts unless tax_amounts == SKIP + @basic_shipping_amount = basic_shipping_amount unless basic_shipping_amount == SKIP + @extra_shipping_amount = extra_shipping_amount unless extra_shipping_amount == SKIP + @handling_amount = handling_amount unless handling_amount == SKIP + @insurance_amount = insurance_amount unless insurance_amount == SKIP + @total_item_amount = total_item_amount unless total_item_amount == SKIP + @invoice_number = invoice_number unless invoice_number == SKIP + @checkout_options = checkout_options unless checkout_options == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + item_code = hash.key?('item_code') ? hash['item_code'] : SKIP + item_name = hash.key?('item_name') ? hash['item_name'] : SKIP + item_description = + hash.key?('item_description') ? hash['item_description'] : SKIP + item_options = hash.key?('item_options') ? hash['item_options'] : SKIP + item_quantity = hash.key?('item_quantity') ? hash['item_quantity'] : SKIP + item_unit_price = Money.from_hash(hash['item_unit_price']) if hash['item_unit_price'] + item_amount = Money.from_hash(hash['item_amount']) if hash['item_amount'] + discount_amount = Money.from_hash(hash['discount_amount']) if hash['discount_amount'] + adjustment_amount = Money.from_hash(hash['adjustment_amount']) if hash['adjustment_amount'] + gift_wrap_amount = Money.from_hash(hash['gift_wrap_amount']) if hash['gift_wrap_amount'] + tax_percentage = + hash.key?('tax_percentage') ? hash['tax_percentage'] : SKIP + # Parameter is an array, so we need to iterate through it + tax_amounts = nil + unless hash['tax_amounts'].nil? + tax_amounts = [] + hash['tax_amounts'].each do |structure| + tax_amounts << (TaxAmount.from_hash(structure) if structure) + end + end + + tax_amounts = SKIP unless hash.key?('tax_amounts') + basic_shipping_amount = Money.from_hash(hash['basic_shipping_amount']) if + hash['basic_shipping_amount'] + extra_shipping_amount = Money.from_hash(hash['extra_shipping_amount']) if + hash['extra_shipping_amount'] + handling_amount = Money.from_hash(hash['handling_amount']) if hash['handling_amount'] + insurance_amount = Money.from_hash(hash['insurance_amount']) if hash['insurance_amount'] + total_item_amount = Money.from_hash(hash['total_item_amount']) if hash['total_item_amount'] + invoice_number = + hash.key?('invoice_number') ? hash['invoice_number'] : SKIP + # Parameter is an array, so we need to iterate through it + checkout_options = nil + unless hash['checkout_options'].nil? + checkout_options = [] + hash['checkout_options'].each do |structure| + checkout_options << (CheckoutOption.from_hash(structure) if structure) + end + end + + checkout_options = SKIP unless hash.key?('checkout_options') + + # Create object from extracted values. + ItemDetails.new(item_code: item_code, + item_name: item_name, + item_description: item_description, + item_options: item_options, + item_quantity: item_quantity, + item_unit_price: item_unit_price, + item_amount: item_amount, + discount_amount: discount_amount, + adjustment_amount: adjustment_amount, + gift_wrap_amount: gift_wrap_amount, + tax_percentage: tax_percentage, + tax_amounts: tax_amounts, + basic_shipping_amount: basic_shipping_amount, + extra_shipping_amount: extra_shipping_amount, + handling_amount: handling_amount, + insurance_amount: insurance_amount, + total_item_amount: total_item_amount, + invoice_number: invoice_number, + checkout_options: checkout_options) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} item_code: #{@item_code}, item_name: #{@item_name}, item_description:"\ + " #{@item_description}, item_options: #{@item_options}, item_quantity: #{@item_quantity},"\ + " item_unit_price: #{@item_unit_price}, item_amount: #{@item_amount}, discount_amount:"\ + " #{@discount_amount}, adjustment_amount: #{@adjustment_amount}, gift_wrap_amount:"\ + " #{@gift_wrap_amount}, tax_percentage: #{@tax_percentage}, tax_amounts: #{@tax_amounts},"\ + " basic_shipping_amount: #{@basic_shipping_amount}, extra_shipping_amount:"\ + " #{@extra_shipping_amount}, handling_amount: #{@handling_amount}, insurance_amount:"\ + " #{@insurance_amount}, total_item_amount: #{@total_item_amount}, invoice_number:"\ + " #{@invoice_number}, checkout_options: #{@checkout_options}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} item_code: #{@item_code.inspect}, item_name: #{@item_name.inspect},"\ + " item_description: #{@item_description.inspect}, item_options: #{@item_options.inspect},"\ + " item_quantity: #{@item_quantity.inspect}, item_unit_price: #{@item_unit_price.inspect},"\ + " item_amount: #{@item_amount.inspect}, discount_amount: #{@discount_amount.inspect},"\ + " adjustment_amount: #{@adjustment_amount.inspect}, gift_wrap_amount:"\ + " #{@gift_wrap_amount.inspect}, tax_percentage: #{@tax_percentage.inspect}, tax_amounts:"\ + " #{@tax_amounts.inspect}, basic_shipping_amount: #{@basic_shipping_amount.inspect},"\ + " extra_shipping_amount: #{@extra_shipping_amount.inspect}, handling_amount:"\ + " #{@handling_amount.inspect}, insurance_amount: #{@insurance_amount.inspect},"\ + " total_item_amount: #{@total_item_amount.inspect}, invoice_number:"\ + " #{@invoice_number.inspect}, checkout_options: #{@checkout_options.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/item_request.rb b/lib/paypal_server_sdk/models/item_request.rb new file mode 100644 index 0000000..54c6780 --- /dev/null +++ b/lib/paypal_server_sdk/models/item_request.rb @@ -0,0 +1,163 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The details for the items to be purchased. + class ItemRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The item name or title. + # @return [String] + attr_accessor :name + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :unit_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :tax + + # The item quantity. Must be a whole number. + # @return [String] + attr_accessor :quantity + + # This field supports up to 4000 characters, but any content beyond 2048 + # characters (including spaces) will be truncated. The 2048 character limit + # is reflected in the response representation of this field. + # @return [String] + attr_accessor :description + + # The stock keeping unit (SKU) for the item. + # @return [String] + attr_accessor :sku + + # The URL to the item being purchased. Visible to buyer and used in buyer + # experiences. + # @return [String] + attr_accessor :url + + # The item category type. + # @return [ItemCategory] + attr_accessor :category + + # The URL of the item's image. File type and size restrictions apply. An + # image that violates these restrictions will not be honored. + # @return [String] + attr_accessor :image_url + + # The Universal Product Code of the item. + # @return [UniversalProductCode] + attr_accessor :upc + + # Metadata for merchant-managed recurring billing plans. Valid only during + # the saved payment method token or billing agreement creation. + # @return [OrderBillingPlan] + attr_accessor :billing_plan + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['name'] = 'name' + @_hash['unit_amount'] = 'unit_amount' + @_hash['tax'] = 'tax' + @_hash['quantity'] = 'quantity' + @_hash['description'] = 'description' + @_hash['sku'] = 'sku' + @_hash['url'] = 'url' + @_hash['category'] = 'category' + @_hash['image_url'] = 'image_url' + @_hash['upc'] = 'upc' + @_hash['billing_plan'] = 'billing_plan' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + tax + description + sku + url + category + image_url + upc + billing_plan + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(name:, unit_amount:, quantity:, tax: SKIP, description: SKIP, + sku: SKIP, url: SKIP, category: SKIP, image_url: SKIP, + upc: SKIP, billing_plan: SKIP) + @name = name + @unit_amount = unit_amount + @tax = tax unless tax == SKIP + @quantity = quantity + @description = description unless description == SKIP + @sku = sku unless sku == SKIP + @url = url unless url == SKIP + @category = category unless category == SKIP + @image_url = image_url unless image_url == SKIP + @upc = upc unless upc == SKIP + @billing_plan = billing_plan unless billing_plan == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + name = hash.key?('name') ? hash['name'] : nil + unit_amount = Money.from_hash(hash['unit_amount']) if hash['unit_amount'] + quantity = hash.key?('quantity') ? hash['quantity'] : nil + tax = Money.from_hash(hash['tax']) if hash['tax'] + description = hash.key?('description') ? hash['description'] : SKIP + sku = hash.key?('sku') ? hash['sku'] : SKIP + url = hash.key?('url') ? hash['url'] : SKIP + category = hash.key?('category') ? hash['category'] : SKIP + image_url = hash.key?('image_url') ? hash['image_url'] : SKIP + upc = UniversalProductCode.from_hash(hash['upc']) if hash['upc'] + billing_plan = OrderBillingPlan.from_hash(hash['billing_plan']) if hash['billing_plan'] + + # Create object from extracted values. + ItemRequest.new(name: name, + unit_amount: unit_amount, + quantity: quantity, + tax: tax, + description: description, + sku: sku, + url: url, + category: category, + image_url: image_url, + upc: upc, + billing_plan: billing_plan) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name}, unit_amount: #{@unit_amount}, tax: #{@tax}, quantity:"\ + " #{@quantity}, description: #{@description}, sku: #{@sku}, url: #{@url}, category:"\ + " #{@category}, image_url: #{@image_url}, upc: #{@upc}, billing_plan: #{@billing_plan}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name.inspect}, unit_amount: #{@unit_amount.inspect}, tax:"\ + " #{@tax.inspect}, quantity: #{@quantity.inspect}, description: #{@description.inspect},"\ + " sku: #{@sku.inspect}, url: #{@url.inspect}, category: #{@category.inspect}, image_url:"\ + " #{@image_url.inspect}, upc: #{@upc.inspect}, billing_plan: #{@billing_plan.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/last_payment_details.rb b/lib/paypal_server_sdk/models/last_payment_details.rb new file mode 100644 index 0000000..8336e9b --- /dev/null +++ b/lib/paypal_server_sdk/models/last_payment_details.rb @@ -0,0 +1,75 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # LastPaymentDetails Model. + class LastPaymentDetails < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :amount + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :time + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['amount'] = 'amount' + @_hash['time'] = 'time' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + amount + time + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(amount: SKIP, time: SKIP) + @amount = amount unless amount == SKIP + @time = time unless time == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + amount = Money.from_hash(hash['amount']) if hash['amount'] + time = hash.key?('time') ? hash['time'] : SKIP + + # Create object from extracted values. + LastPaymentDetails.new(amount: amount, + time: time) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} amount: #{@amount}, time: #{@time}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} amount: #{@amount.inspect}, time: #{@time.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/level2_card_processing_data.rb b/lib/paypal_server_sdk/models/level2_card_processing_data.rb index 1e187e7..8186e58 100644 --- a/lib/paypal_server_sdk/models/level2_card_processing_data.rb +++ b/lib/paypal_server_sdk/models/level2_card_processing_data.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The level 2 card processing data collections. If your merchant account has diff --git a/lib/paypal_server_sdk/models/level3_card_processing_data.rb b/lib/paypal_server_sdk/models/level3_card_processing_data.rb index 8fdd58d..a73c162 100644 --- a/lib/paypal_server_sdk/models/level3_card_processing_data.rb +++ b/lib/paypal_server_sdk/models/level3_card_processing_data.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The level 3 card processing data collections, If your merchant account has diff --git a/lib/paypal_server_sdk/models/liability_shift_indicator.rb b/lib/paypal_server_sdk/models/liability_shift_indicator.rb index 2b54ab5..98e81d9 100644 --- a/lib/paypal_server_sdk/models/liability_shift_indicator.rb +++ b/lib/paypal_server_sdk/models/liability_shift_indicator.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Liability shift indicator. The outcome of the issuer's authentication. diff --git a/lib/paypal_server_sdk/models/line_item.rb b/lib/paypal_server_sdk/models/line_item.rb index 60512c9..fe6c023 100644 --- a/lib/paypal_server_sdk/models/line_item.rb +++ b/lib/paypal_server_sdk/models/line_item.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The line items for this purchase. If your merchant account has been diff --git a/lib/paypal_server_sdk/models/link_description.rb b/lib/paypal_server_sdk/models/link_description.rb index 7a1cb02..48b508e 100644 --- a/lib/paypal_server_sdk/models/link_description.rb +++ b/lib/paypal_server_sdk/models/link_description.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The request-related [HATEOAS link](/api/rest/responses/#hateoas-links) diff --git a/lib/paypal_server_sdk/models/link_http_method.rb b/lib/paypal_server_sdk/models/link_http_method.rb index 0bc02e1..facb9bf 100644 --- a/lib/paypal_server_sdk/models/link_http_method.rb +++ b/lib/paypal_server_sdk/models/link_http_method.rb @@ -1,34 +1,34 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The HTTP method required to make the related call. class LinkHttpMethod LINK_HTTP_METHOD = [ - # TODO: Write general description for GET + # The HTTP GET method. GET = 'GET'.freeze, - # TODO: Write general description for POST + # The HTTP POST method. POST = 'POST'.freeze, - # TODO: Write general description for PUT + # The HTTP PUT method. PUT = 'PUT'.freeze, - # TODO: Write general description for DELETE + # The HTTP DELETE method. DELETE = 'DELETE'.freeze, - # TODO: Write general description for HEAD + # The HTTP HEAD method. HEAD = 'HEAD'.freeze, - # TODO: Write general description for CONNECT + # The HTTP CONNECT method. CONNECT = 'CONNECT'.freeze, - # TODO: Write general description for OPTIONS + # The HTTP OPTIONS method. OPTIONS = 'OPTIONS'.freeze, - # TODO: Write general description for PATCH + # The HTTP PATCH method. PATCH = 'PATCH'.freeze ].freeze diff --git a/lib/paypal_server_sdk/models/merchant_preferences.rb b/lib/paypal_server_sdk/models/merchant_preferences.rb new file mode 100644 index 0000000..0ab3c7b --- /dev/null +++ b/lib/paypal_server_sdk/models/merchant_preferences.rb @@ -0,0 +1,73 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The merchant preferences for a subscription. + class MerchantPreferences < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The URL where the customer is redirected after the customer approves the + # payment. + # @return [String] + attr_accessor :return_url + + # The URL where the customer is redirected after the customer cancels the + # payment. + # @return [String] + attr_accessor :cancel_url + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['return_url'] = 'return_url' + @_hash['cancel_url'] = 'cancel_url' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + return_url + cancel_url + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(return_url: SKIP, cancel_url: SKIP) + @return_url = return_url unless return_url == SKIP + @cancel_url = cancel_url unless cancel_url == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + return_url = hash.key?('return_url') ? hash['return_url'] : SKIP + cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : SKIP + + # Create object from extracted values. + MerchantPreferences.new(return_url: return_url, + cancel_url: cancel_url) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} return_url: #{@return_url}, cancel_url: #{@cancel_url}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} return_url: #{@return_url.inspect}, cancel_url: #{@cancel_url.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/mobile_return_flow.rb b/lib/paypal_server_sdk/models/mobile_return_flow.rb new file mode 100644 index 0000000..f168091 --- /dev/null +++ b/lib/paypal_server_sdk/models/mobile_return_flow.rb @@ -0,0 +1,28 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # Merchant preference on how the buyer can navigate back to merchant website + # post approving the transaction on the PayPal App. + class MobileReturnFlow + MOBILE_RETURN_FLOW = [ + # After payment approval in the PayPal App, buyer will automatically be + # redirected to the merchant website. + AUTO = 'AUTO'.freeze, + + # After payment approval in the PayPal App, buyer will be asked to + # manually navigate back to the merchant website where they started the + # transaction from. The buyer is shown a message like 'Return to Merchant' + # to return to the source where the transaction actually started. + MANUAL = 'MANUAL'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/mobile_web_context.rb b/lib/paypal_server_sdk/models/mobile_web_context.rb new file mode 100644 index 0000000..af53fd6 --- /dev/null +++ b/lib/paypal_server_sdk/models/mobile_web_context.rb @@ -0,0 +1,76 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # Buyer's mobile web browser context to app switch to the PayPal consumer app. + class MobileWebContext < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Merchant preference on how the buyer can navigate back to merchant website + # post approving the transaction on the PayPal App. + # @return [MobileReturnFlow] + attr_accessor :return_flow + + # User agent from the request originating from the buyer's device. This will + # be used to identify the buyer's operating system and browser versions. + # NOTE: Merchants must not alter or modify the buyer's device user agent. + # @return [String] + attr_accessor :buyer_user_agent + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['return_flow'] = 'return_flow' + @_hash['buyer_user_agent'] = 'buyer_user_agent' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + return_flow + buyer_user_agent + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(return_flow: MobileReturnFlow::AUTO, buyer_user_agent: SKIP) + @return_flow = return_flow unless return_flow == SKIP + @buyer_user_agent = buyer_user_agent unless buyer_user_agent == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + return_flow = hash['return_flow'] ||= MobileReturnFlow::AUTO + buyer_user_agent = + hash.key?('buyer_user_agent') ? hash['buyer_user_agent'] : SKIP + + # Create object from extracted values. + MobileWebContext.new(return_flow: return_flow, + buyer_user_agent: buyer_user_agent) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} return_flow: #{@return_flow}, buyer_user_agent: #{@buyer_user_agent}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} return_flow: #{@return_flow.inspect}, buyer_user_agent:"\ + " #{@buyer_user_agent.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/modify_subscription_request.rb b/lib/paypal_server_sdk/models/modify_subscription_request.rb new file mode 100644 index 0000000..c267aea --- /dev/null +++ b/lib/paypal_server_sdk/models/modify_subscription_request.rb @@ -0,0 +1,124 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The request to update the quantity of the product or service in a + # subscription. You can also use this method to switch the plan and update the + # `shipping_amount` and `shipping_address` values for the subscription. This + # type of update requires the buyer's consent. + class ModifySubscriptionRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The unique PayPal-generated ID for the plan. + # @return [String] + attr_accessor :plan_id + + # The quantity of the product or service in the subscription. + # @return [String] + attr_accessor :quantity + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :shipping_amount + + # The shipping details. + # @return [ShippingDetails] + attr_accessor :shipping_address + + # The application context, which customizes the payer experience during the + # subscription approval process with PayPal. + # @return [SubscriptionPatchApplicationContext] + attr_accessor :application_context + + # An inline plan object to customise the subscription. You can override plan + # level default attributes by providing customised values for the + # subscription in this object. + # @return [PlanOverride] + attr_accessor :plan + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['plan_id'] = 'plan_id' + @_hash['quantity'] = 'quantity' + @_hash['shipping_amount'] = 'shipping_amount' + @_hash['shipping_address'] = 'shipping_address' + @_hash['application_context'] = 'application_context' + @_hash['plan'] = 'plan' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + plan_id + quantity + shipping_amount + shipping_address + application_context + plan + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(plan_id: SKIP, quantity: SKIP, shipping_amount: SKIP, + shipping_address: SKIP, application_context: SKIP, + plan: SKIP) + @plan_id = plan_id unless plan_id == SKIP + @quantity = quantity unless quantity == SKIP + @shipping_amount = shipping_amount unless shipping_amount == SKIP + @shipping_address = shipping_address unless shipping_address == SKIP + @application_context = application_context unless application_context == SKIP + @plan = plan unless plan == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + plan_id = hash.key?('plan_id') ? hash['plan_id'] : SKIP + quantity = hash.key?('quantity') ? hash['quantity'] : SKIP + shipping_amount = Money.from_hash(hash['shipping_amount']) if hash['shipping_amount'] + shipping_address = ShippingDetails.from_hash(hash['shipping_address']) if + hash['shipping_address'] + if hash['application_context'] + application_context = SubscriptionPatchApplicationContext.from_hash(hash['application_context']) + end + plan = PlanOverride.from_hash(hash['plan']) if hash['plan'] + + # Create object from extracted values. + ModifySubscriptionRequest.new(plan_id: plan_id, + quantity: quantity, + shipping_amount: shipping_amount, + shipping_address: shipping_address, + application_context: application_context, + plan: plan) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} plan_id: #{@plan_id}, quantity: #{@quantity}, shipping_amount:"\ + " #{@shipping_amount}, shipping_address: #{@shipping_address}, application_context:"\ + " #{@application_context}, plan: #{@plan}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} plan_id: #{@plan_id.inspect}, quantity: #{@quantity.inspect},"\ + " shipping_amount: #{@shipping_amount.inspect}, shipping_address:"\ + " #{@shipping_address.inspect}, application_context: #{@application_context.inspect}, plan:"\ + " #{@plan.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/modify_subscription_response.rb b/lib/paypal_server_sdk/models/modify_subscription_response.rb new file mode 100644 index 0000000..b65d4ec --- /dev/null +++ b/lib/paypal_server_sdk/models/modify_subscription_response.rb @@ -0,0 +1,141 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The response to a request to update the quantity of the product or service + # in a subscription. You can also use this method to switch the plan and + # update the `shipping_amount` and `shipping_address` values for the + # subscription. This type of update requires the buyer's consent. + class ModifySubscriptionResponse < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The unique PayPal-generated ID for the plan. + # @return [String] + attr_accessor :plan_id + + # The quantity of the product or service in the subscription. + # @return [String] + attr_accessor :quantity + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :shipping_amount + + # The shipping details. + # @return [ShippingDetails] + attr_accessor :shipping_address + + # An inline plan object to customise the subscription. You can override plan + # level default attributes by providing customised values for the + # subscription in this object. + # @return [PlanOverride] + attr_accessor :plan + + # Indicates whether the subscription has overridden any plan attributes. + # @return [TrueClass | FalseClass] + attr_accessor :plan_overridden + + # An array of request-related [HATEOAS + # links](/docs/api/reference/api-responses/#hateoas-links). + # @return [Array[LinkDescription]] + attr_accessor :links + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['plan_id'] = 'plan_id' + @_hash['quantity'] = 'quantity' + @_hash['shipping_amount'] = 'shipping_amount' + @_hash['shipping_address'] = 'shipping_address' + @_hash['plan'] = 'plan' + @_hash['plan_overridden'] = 'plan_overridden' + @_hash['links'] = 'links' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + plan_id + quantity + shipping_amount + shipping_address + plan + plan_overridden + links + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(plan_id: SKIP, quantity: SKIP, shipping_amount: SKIP, + shipping_address: SKIP, plan: SKIP, plan_overridden: SKIP, + links: SKIP) + @plan_id = plan_id unless plan_id == SKIP + @quantity = quantity unless quantity == SKIP + @shipping_amount = shipping_amount unless shipping_amount == SKIP + @shipping_address = shipping_address unless shipping_address == SKIP + @plan = plan unless plan == SKIP + @plan_overridden = plan_overridden unless plan_overridden == SKIP + @links = links unless links == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + plan_id = hash.key?('plan_id') ? hash['plan_id'] : SKIP + quantity = hash.key?('quantity') ? hash['quantity'] : SKIP + shipping_amount = Money.from_hash(hash['shipping_amount']) if hash['shipping_amount'] + shipping_address = ShippingDetails.from_hash(hash['shipping_address']) if + hash['shipping_address'] + plan = PlanOverride.from_hash(hash['plan']) if hash['plan'] + plan_overridden = + hash.key?('plan_overridden') ? hash['plan_overridden'] : SKIP + # Parameter is an array, so we need to iterate through it + links = nil + unless hash['links'].nil? + links = [] + hash['links'].each do |structure| + links << (LinkDescription.from_hash(structure) if structure) + end + end + + links = SKIP unless hash.key?('links') + + # Create object from extracted values. + ModifySubscriptionResponse.new(plan_id: plan_id, + quantity: quantity, + shipping_amount: shipping_amount, + shipping_address: shipping_address, + plan: plan, + plan_overridden: plan_overridden, + links: links) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} plan_id: #{@plan_id}, quantity: #{@quantity}, shipping_amount:"\ + " #{@shipping_amount}, shipping_address: #{@shipping_address}, plan: #{@plan},"\ + " plan_overridden: #{@plan_overridden}, links: #{@links}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} plan_id: #{@plan_id.inspect}, quantity: #{@quantity.inspect},"\ + " shipping_amount: #{@shipping_amount.inspect}, shipping_address:"\ + " #{@shipping_address.inspect}, plan: #{@plan.inspect}, plan_overridden:"\ + " #{@plan_overridden.inspect}, links: #{@links.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/money.rb b/lib/paypal_server_sdk/models/money.rb index 2fdb061..b0328f8 100644 --- a/lib/paypal_server_sdk/models/money.rb +++ b/lib/paypal_server_sdk/models/money.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The currency and amount for a financial transaction, such as a balance or diff --git a/lib/paypal_server_sdk/models/mybank_payment_object.rb b/lib/paypal_server_sdk/models/mybank_payment_object.rb index 8f645ba..8201b3e 100644 --- a/lib/paypal_server_sdk/models/mybank_payment_object.rb +++ b/lib/paypal_server_sdk/models/mybank_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information used to pay using MyBank. diff --git a/lib/paypal_server_sdk/models/mybank_payment_request.rb b/lib/paypal_server_sdk/models/mybank_payment_request.rb index 51c4159..0e516bc 100644 --- a/lib/paypal_server_sdk/models/mybank_payment_request.rb +++ b/lib/paypal_server_sdk/models/mybank_payment_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using MyBank. diff --git a/lib/paypal_server_sdk/models/name.rb b/lib/paypal_server_sdk/models/name.rb index 6e4e237..702c985 100644 --- a/lib/paypal_server_sdk/models/name.rb +++ b/lib/paypal_server_sdk/models/name.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The name of the party. diff --git a/lib/paypal_server_sdk/models/native_app_context.rb b/lib/paypal_server_sdk/models/native_app_context.rb new file mode 100644 index 0000000..4e66ef8 --- /dev/null +++ b/lib/paypal_server_sdk/models/native_app_context.rb @@ -0,0 +1,72 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # Merchant provided, buyer's native app preferences to app switch to the + # PayPal consumer app. + class NativeAppContext < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Operating System type of the device that the buyer is using. + # @return [OsType] + attr_accessor :os_type + + # Operating System version of the device that the buyer is using. + # @return [String] + attr_accessor :os_version + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['os_type'] = 'os_type' + @_hash['os_version'] = 'os_version' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + os_type + os_version + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(os_type: SKIP, os_version: SKIP) + @os_type = os_type unless os_type == SKIP + @os_version = os_version unless os_version == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + os_type = hash.key?('os_type') ? hash['os_type'] : SKIP + os_version = hash.key?('os_version') ? hash['os_version'] : SKIP + + # Create object from extracted values. + NativeAppContext.new(os_type: os_type, + os_version: os_version) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} os_type: #{@os_type}, os_version: #{@os_version}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} os_type: #{@os_type.inspect}, os_version: #{@os_version.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/net_amount_breakdown_item.rb b/lib/paypal_server_sdk/models/net_amount_breakdown_item.rb index c3418c3..351f9f4 100644 --- a/lib/paypal_server_sdk/models/net_amount_breakdown_item.rb +++ b/lib/paypal_server_sdk/models/net_amount_breakdown_item.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The net amount. Returned when the currency of the refund is different from diff --git a/lib/paypal_server_sdk/models/network_token.rb b/lib/paypal_server_sdk/models/network_token.rb index 0e51719..4add3bb 100644 --- a/lib/paypal_server_sdk/models/network_token.rb +++ b/lib/paypal_server_sdk/models/network_token.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The Third Party Network token used to fund a payment. diff --git a/lib/paypal_server_sdk/models/network_transaction_reference.rb b/lib/paypal_server_sdk/models/network_transaction.rb similarity index 81% rename from lib/paypal_server_sdk/models/network_transaction_reference.rb rename to lib/paypal_server_sdk/models/network_transaction.rb index 1654c2c..f9b5c2f 100644 --- a/lib/paypal_server_sdk/models/network_transaction_reference.rb +++ b/lib/paypal_server_sdk/models/network_transaction.rb @@ -1,11 +1,11 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Reference values used by the card network to identify a transaction. - class NetworkTransactionReference < BaseModel + class NetworkTransaction < BaseModel SKIP = Object.new private_constant :SKIP @@ -20,7 +20,9 @@ class NetworkTransactionReference < BaseModel # The date that the transaction was authorized by the scheme. This field may # not be returned for all networks. MasterCard refers to this field as - # "BankNet reference date. + # "BankNet reference date". For some specific networks, such as MasterCard + # and Discover, this date field is mandatory when the + # `previous_network_transaction_reference_id` is passed. # @return [String] attr_accessor :date @@ -47,6 +49,7 @@ def self.names # An array for optional fields def self.optionals %w[ + id date network acquirer_reference_number @@ -58,9 +61,9 @@ def self.nullables [] end - def initialize(id:, date: SKIP, network: SKIP, + def initialize(id: SKIP, date: SKIP, network: SKIP, acquirer_reference_number: SKIP) - @id = id + @id = id unless id == SKIP @date = date unless date == SKIP @network = network unless network == SKIP unless acquirer_reference_number == SKIP @@ -74,17 +77,17 @@ def self.from_hash(hash) return nil unless hash # Extract variables from the hash. - id = hash.key?('id') ? hash['id'] : nil + id = hash.key?('id') ? hash['id'] : SKIP date = hash.key?('date') ? hash['date'] : SKIP network = hash.key?('network') ? hash['network'] : SKIP acquirer_reference_number = hash.key?('acquirer_reference_number') ? hash['acquirer_reference_number'] : SKIP # Create object from extracted values. - NetworkTransactionReference.new(id: id, - date: date, - network: network, - acquirer_reference_number: acquirer_reference_number) + NetworkTransaction.new(id: id, + date: date, + network: network, + acquirer_reference_number: acquirer_reference_number) end # Provides a human-readable string representation of the object. diff --git a/lib/paypal_server_sdk/models/network_transaction_reference_entity.rb b/lib/paypal_server_sdk/models/network_transaction_reference_entity.rb index f311f36..b34fe0a 100644 --- a/lib/paypal_server_sdk/models/network_transaction_reference_entity.rb +++ b/lib/paypal_server_sdk/models/network_transaction_reference_entity.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Previous network transaction reference including id and network. diff --git a/lib/paypal_server_sdk/models/o_auth_provider_error.rb b/lib/paypal_server_sdk/models/o_auth_provider_error.rb index 1acff9a..7d7bf9b 100644 --- a/lib/paypal_server_sdk/models/o_auth_provider_error.rb +++ b/lib/paypal_server_sdk/models/o_auth_provider_error.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # OAuth 2 Authorization error codes diff --git a/lib/paypal_server_sdk/models/o_auth_token.rb b/lib/paypal_server_sdk/models/o_auth_token.rb index 63289a6..0f5497b 100644 --- a/lib/paypal_server_sdk/models/o_auth_token.rb +++ b/lib/paypal_server_sdk/models/o_auth_token.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # OAuth 2 Authorization endpoint response diff --git a/lib/paypal_server_sdk/models/one_time_charge.rb b/lib/paypal_server_sdk/models/one_time_charge.rb index e80f87e..4583844 100644 --- a/lib/paypal_server_sdk/models/one_time_charge.rb +++ b/lib/paypal_server_sdk/models/one_time_charge.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The one-time charge info at the time of checkout. diff --git a/lib/paypal_server_sdk/models/order.rb b/lib/paypal_server_sdk/models/order.rb index 4da9c42..cef588b 100644 --- a/lib/paypal_server_sdk/models/order.rb +++ b/lib/paypal_server_sdk/models/order.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The order details. @@ -36,8 +36,11 @@ class Order < BaseModel # @return [CheckoutPaymentIntent] attr_accessor :intent - # The intent to either capture payment immediately or authorize a payment - # for an order after order creation. + # DEPRECATED. The customer is also known as the payer. The Payer object was + # intended to only be used with the `payment_source.paypal` object. In order + # to make this design more clear, the details in the `payer` object are now + # available under `payment_source.paypal`. Please use + # `payment_source.paypal`. # @return [Payer] attr_accessor :payer diff --git a/lib/paypal_server_sdk/models/order_application_context.rb b/lib/paypal_server_sdk/models/order_application_context.rb index 9a0f401..977ec70 100644 --- a/lib/paypal_server_sdk/models/order_application_context.rb +++ b/lib/paypal_server_sdk/models/order_application_context.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Customizes the payer experience during the approval process for the payment @@ -22,14 +22,15 @@ class OrderApplicationContext < BaseModel # @return [String] attr_accessor :brand_name - # The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the - # language in which to localize the error-related strings, such as messages, - # issues, and suggested actions. The tag is made up of the [ISO 639-2 - # language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), - # the optional [ISO-15924 script - # tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 - # alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region - # code](https://unstats.un.org/unsd/methodology/m49/). + # DEPRECATED. The BCP 47-formatted locale of pages that the PayPal payment + # experience shows. PayPal supports a five-character code. For example, + # `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, + # `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. The fields in + # `application_context` are now available in the `experience_context` object + # under the `payment_source` which supports them (eg. + # `payment_source.paypal.experience_context.locale`). Please specify this + # field in the `experience_context` object instead of the + # `application_context` object. # @return [String] attr_accessor :locale @@ -64,7 +65,12 @@ class OrderApplicationContext < BaseModel # @return [OrderApplicationContextUserAction] attr_accessor :user_action - # The customer and merchant payment preferences. + # DEPRECATED. The customer and merchant payment preferences. The fields in + # `application_context` are now available in the `experience_context` object + # under the `payment_source` which supports them (eg. + # `payment_source.paypal.experience_context.payment_method_selected`). + # Please specify this field in the `experience_context` object instead of + # the `application_context` object.. # @return [PaymentMethodPreference] attr_accessor :payment_method @@ -87,16 +93,21 @@ class OrderApplicationContext < BaseModel # @return [String] attr_accessor :cancel_url - # Provides additional details to process a payment using a `payment_source` - # that has been stored or is intended to be stored (also referred to as - # stored_credential or card-on-file). Parameter compatibility: - # `payment_type=ONE_TIME` is compatible only with + # DEPRECATED. Provides additional details to process a payment using a + # `payment_source` that has been stored or is intended to be stored (also + # referred to as stored_credential or card-on-file). Parameter + # compatibility: `payment_type=ONE_TIME` is compatible only with # `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with # `payment_initiator=CUSTOMER`. `previous_transaction_reference` or # `previous_network_transaction_reference` is compatible only with # `payment_initiator=MERCHANT`. Only one of the parameters - # `previous_transaction_reference` and # `previous_network_transaction_reference` - can be present in the request. + # . The fields in `stored_payment_source` are now available in the + # `stored_credential` object under the `payment_source` which supports them + # (eg. `payment_source.card.stored_credential.payment_initiator`). Please + # specify this field in the `payment_source` object instead of the + # `application_context` object. # @return [StoredPaymentSource] attr_accessor :stored_payment_source diff --git a/lib/paypal_server_sdk/models/order_application_context_landing_page.rb b/lib/paypal_server_sdk/models/order_application_context_landing_page.rb index 13d1e33..9f50e22 100644 --- a/lib/paypal_server_sdk/models/order_application_context_landing_page.rb +++ b/lib/paypal_server_sdk/models/order_application_context_landing_page.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # DEPRECATED. DEPRECATED. The type of landing page to show on the PayPal site diff --git a/lib/paypal_server_sdk/models/order_application_context_shipping_preference.rb b/lib/paypal_server_sdk/models/order_application_context_shipping_preference.rb index a064543..e2802ab 100644 --- a/lib/paypal_server_sdk/models/order_application_context_shipping_preference.rb +++ b/lib/paypal_server_sdk/models/order_application_context_shipping_preference.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping @@ -12,9 +12,7 @@ module PaypalServerSdk # which supports them (eg. # `payment_source.paypal.experience_context.shipping_preference`). Please # specify this field in the `experience_context` object instead of the - # `application_context` object., The shipping preference. This only applies to - # PayPal payment source., The shipping preference. This only applies to PayPal - # payment source. + # `application_context` object. class OrderApplicationContextShippingPreference ORDER_APPLICATION_CONTEXT_SHIPPING_PREFERENCE = [ # Use the customer-provided shipping address on the PayPal site. diff --git a/lib/paypal_server_sdk/models/order_application_context_user_action.rb b/lib/paypal_server_sdk/models/order_application_context_user_action.rb index cb49a77..286d7a6 100644 --- a/lib/paypal_server_sdk/models/order_application_context_user_action.rb +++ b/lib/paypal_server_sdk/models/order_application_context_user_action.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # DEPRECATED. Configures a Continue or Pay Now checkout flow. The fields in diff --git a/lib/paypal_server_sdk/models/order_authorize_request.rb b/lib/paypal_server_sdk/models/order_authorize_request.rb index 3cb34f6..987d6b4 100644 --- a/lib/paypal_server_sdk/models/order_authorize_request.rb +++ b/lib/paypal_server_sdk/models/order_authorize_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The authorization of an order request. diff --git a/lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb b/lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb index a2da0d8..74039c6 100644 --- a/lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb +++ b/lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment source definition. diff --git a/lib/paypal_server_sdk/models/order_authorize_response.rb b/lib/paypal_server_sdk/models/order_authorize_response.rb index 06f1f6c..86d266d 100644 --- a/lib/paypal_server_sdk/models/order_authorize_response.rb +++ b/lib/paypal_server_sdk/models/order_authorize_response.rb @@ -1,10 +1,10 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk - # OrderAuthorizeResponse Model. + # The order authorize response. class OrderAuthorizeResponse < BaseModel SKIP = Object.new private_constant :SKIP @@ -36,8 +36,8 @@ class OrderAuthorizeResponse < BaseModel # @return [CheckoutPaymentIntent] attr_accessor :intent - # The intent to either capture payment immediately or authorize a payment - # for an order after order creation. + # The customer who approves and pays for the order. The customer is also + # known as the payer. # @return [Payer] attr_accessor :payer @@ -52,10 +52,17 @@ class OrderAuthorizeResponse < BaseModel # @return [OrderStatus] attr_accessor :status - # An array of request-related [HATEOAS - # links](/api/rest/responses/#hateoas-links) that are either relevant to the - # issue by providing additional information or offering potential - # resolutions. + # An array of request-related HATEOAS links. To complete payer approval, use + # the `approve` link to redirect the payer. The API caller has 6 hours + # (default setting, this which can be changed by your account manager to + # 24/48/72 hours to accommodate your use case) from the time the order is + # created, to redirect your payer. Once redirected, the API caller has 6 + # hours for the payer to approve the order and either authorize or capture + # the order. If you are not using the PayPal JavaScript SDK to initiate + # PayPal Checkout (in context) ensure that you include + # `application_context.return_url` is specified or you will get "We're + # sorry, Things don't appear to be working at the moment" after the payer + # approves the payment. # @return [Array[LinkDescription]] attr_accessor :links diff --git a/lib/paypal_server_sdk/models/order_authorize_response_payment_source.rb b/lib/paypal_server_sdk/models/order_authorize_response_payment_source.rb index abccd9d..4f0be1d 100644 --- a/lib/paypal_server_sdk/models/order_authorize_response_payment_source.rb +++ b/lib/paypal_server_sdk/models/order_authorize_response_payment_source.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment source used to fund the payment. diff --git a/lib/paypal_server_sdk/models/order_billing_plan.rb b/lib/paypal_server_sdk/models/order_billing_plan.rb index 03d07b6..31bcafd 100644 --- a/lib/paypal_server_sdk/models/order_billing_plan.rb +++ b/lib/paypal_server_sdk/models/order_billing_plan.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Metadata for merchant-managed recurring billing plans. Valid only during the diff --git a/lib/paypal_server_sdk/models/order_capture_request.rb b/lib/paypal_server_sdk/models/order_capture_request.rb index c071fa4..03792b0 100644 --- a/lib/paypal_server_sdk/models/order_capture_request.rb +++ b/lib/paypal_server_sdk/models/order_capture_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Completes an capture payment for an order. diff --git a/lib/paypal_server_sdk/models/order_capture_request_payment_source.rb b/lib/paypal_server_sdk/models/order_capture_request_payment_source.rb index 63bfd28..479ae75 100644 --- a/lib/paypal_server_sdk/models/order_capture_request_payment_source.rb +++ b/lib/paypal_server_sdk/models/order_capture_request_payment_source.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment source definition. diff --git a/lib/paypal_server_sdk/models/order_confirm_application_context.rb b/lib/paypal_server_sdk/models/order_confirm_application_context.rb index e4ca969..c55c7b2 100644 --- a/lib/paypal_server_sdk/models/order_confirm_application_context.rb +++ b/lib/paypal_server_sdk/models/order_confirm_application_context.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Customizes the payer confirmation experience. diff --git a/lib/paypal_server_sdk/models/order_request.rb b/lib/paypal_server_sdk/models/order_request.rb index 22a6aa9..42c27f9 100644 --- a/lib/paypal_server_sdk/models/order_request.rb +++ b/lib/paypal_server_sdk/models/order_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The order request details. @@ -14,8 +14,11 @@ class OrderRequest < BaseModel # @return [CheckoutPaymentIntent] attr_accessor :intent - # The intent to either capture payment immediately or authorize a payment - # for an order after order creation. + # DEPRECATED. The customer is also known as the payer. The Payer object was + # intended to only be used with the `payment_source.paypal` object. In order + # to make this design more clear, the details in the `payer` object are now + # available under `payment_source.paypal`. Please use + # `payment_source.paypal`. # @return [Payer] attr_accessor :payer diff --git a/lib/paypal_server_sdk/models/order_status.rb b/lib/paypal_server_sdk/models/order_status.rb index fddd923..83b6433 100644 --- a/lib/paypal_server_sdk/models/order_status.rb +++ b/lib/paypal_server_sdk/models/order_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The order status. diff --git a/lib/paypal_server_sdk/models/order_tracker_item.rb b/lib/paypal_server_sdk/models/order_tracker_item.rb index 2b1219f..4762039 100644 --- a/lib/paypal_server_sdk/models/order_tracker_item.rb +++ b/lib/paypal_server_sdk/models/order_tracker_item.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details of the items in the shipment. diff --git a/lib/paypal_server_sdk/models/order_tracker_request.rb b/lib/paypal_server_sdk/models/order_tracker_request.rb index 55738f1..4a847aa 100644 --- a/lib/paypal_server_sdk/models/order_tracker_request.rb +++ b/lib/paypal_server_sdk/models/order_tracker_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The tracking details of an order. diff --git a/lib/paypal_server_sdk/models/order_tracker_response.rb b/lib/paypal_server_sdk/models/order_tracker_response.rb index 4afd30a..6e26ef0 100644 --- a/lib/paypal_server_sdk/models/order_tracker_response.rb +++ b/lib/paypal_server_sdk/models/order_tracker_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The tracking response on creation of tracker. diff --git a/lib/paypal_server_sdk/models/order_tracker_status.rb b/lib/paypal_server_sdk/models/order_tracker_status.rb index c5b3a7c..bba24fc 100644 --- a/lib/paypal_server_sdk/models/order_tracker_status.rb +++ b/lib/paypal_server_sdk/models/order_tracker_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The status of the item shipment. diff --git a/lib/paypal_server_sdk/models/order_update_callback_error_response.rb b/lib/paypal_server_sdk/models/order_update_callback_error_response.rb deleted file mode 100644 index d173860..0000000 --- a/lib/paypal_server_sdk/models/order_update_callback_error_response.rb +++ /dev/null @@ -1,89 +0,0 @@ -# paypal_server_sdk -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module PaypalServerSdk - # The error details. - class OrderUpdateCallbackErrorResponse < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The human-readable, unique name of the error. - # @return [String] - attr_accessor :name - - # The message that describes the error. - # @return [String] - attr_accessor :message - - # An array of additional details about the error. - # @return [Array[OrderUpdateCallbackErrorResponseDetails]] - attr_accessor :details - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['name'] = 'name' - @_hash['message'] = 'message' - @_hash['details'] = 'details' - @_hash - end - - # An array for optional fields - def self.optionals - %w[ - message - details - ] - end - - # An array for nullable fields - def self.nullables - [] - end - - def initialize(name:, message: SKIP, details: SKIP) - @name = name - @message = message unless message == SKIP - @details = details unless details == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - name = hash.key?('name') ? hash['name'] : nil - message = hash.key?('message') ? hash['message'] : SKIP - # Parameter is an array, so we need to iterate through it - details = nil - unless hash['details'].nil? - details = [] - hash['details'].each do |structure| - details << (OrderUpdateCallbackErrorResponseDetails.from_hash(structure) if structure) - end - end - - details = SKIP unless hash.key?('details') - - # Create object from extracted values. - OrderUpdateCallbackErrorResponse.new(name: name, - message: message, - details: details) - end - - # Provides a human-readable string representation of the object. - def to_s - class_name = self.class.name.split('::').last - "<#{class_name} name: #{@name}, message: #{@message}, details: #{@details}>" - end - - # Provides a debugging-friendly string with detailed object information. - def inspect - class_name = self.class.name.split('::').last - "<#{class_name} name: #{@name.inspect}, message: #{@message.inspect}, details:"\ - " #{@details.inspect}>" - end - end -end diff --git a/lib/paypal_server_sdk/models/order_update_callback_request.rb b/lib/paypal_server_sdk/models/order_update_callback_request.rb deleted file mode 100644 index ec32fca..0000000 --- a/lib/paypal_server_sdk/models/order_update_callback_request.rb +++ /dev/null @@ -1,111 +0,0 @@ -# paypal_server_sdk -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module PaypalServerSdk - # Shipping Options Callback request. This will be implemented by the - # merchants. - class OrderUpdateCallbackRequest < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The ID of the order. - # @return [String] - attr_accessor :id - - # The portable international postal address. Maps to - # [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/ - # wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: - # the autocomplete - # attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-co - # ntrols-the-autocomplete-attribute). - # @return [OrderUpdateCallbackShippingAddress] - attr_accessor :shipping_address - - # The options that the payee or merchant offers to the payer to ship or pick - # up their items. - # @return [OrderUpdateCallbackShippingOption] - attr_accessor :shipping_option - - # An array of purchase units. At present only 1 purchase_unit is supported. - # Each purchase unit establishes a contract between a payer and the payee. - # Each purchase unit represents either a full or partial order that the - # payer intends to purchase from the payee. - # @return [Array[PurchaseUnitRequest]] - attr_accessor :purchase_units - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['id'] = 'id' - @_hash['shipping_address'] = 'shipping_address' - @_hash['shipping_option'] = 'shipping_option' - @_hash['purchase_units'] = 'purchase_units' - @_hash - end - - # An array for optional fields - def self.optionals - %w[ - id - shipping_option - ] - end - - # An array for nullable fields - def self.nullables - [] - end - - def initialize(shipping_address:, purchase_units:, id: SKIP, - shipping_option: SKIP) - @id = id unless id == SKIP - @shipping_address = shipping_address - @shipping_option = shipping_option unless shipping_option == SKIP - @purchase_units = purchase_units - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - shipping_address = OrderUpdateCallbackShippingAddress.from_hash(hash['shipping_address']) if - hash['shipping_address'] - # Parameter is an array, so we need to iterate through it - purchase_units = nil - unless hash['purchase_units'].nil? - purchase_units = [] - hash['purchase_units'].each do |structure| - purchase_units << (PurchaseUnitRequest.from_hash(structure) if structure) - end - end - - purchase_units = nil unless hash.key?('purchase_units') - id = hash.key?('id') ? hash['id'] : SKIP - shipping_option = OrderUpdateCallbackShippingOption.from_hash(hash['shipping_option']) if - hash['shipping_option'] - - # Create object from extracted values. - OrderUpdateCallbackRequest.new(shipping_address: shipping_address, - purchase_units: purchase_units, - id: id, - shipping_option: shipping_option) - end - - # Provides a human-readable string representation of the object. - def to_s - class_name = self.class.name.split('::').last - "<#{class_name} id: #{@id}, shipping_address: #{@shipping_address}, shipping_option:"\ - " #{@shipping_option}, purchase_units: #{@purchase_units}>" - end - - # Provides a debugging-friendly string with detailed object information. - def inspect - class_name = self.class.name.split('::').last - "<#{class_name} id: #{@id.inspect}, shipping_address: #{@shipping_address.inspect},"\ - " shipping_option: #{@shipping_option.inspect}, purchase_units: #{@purchase_units.inspect}>" - end - end -end diff --git a/lib/paypal_server_sdk/models/order_update_callback_response.rb b/lib/paypal_server_sdk/models/order_update_callback_response.rb deleted file mode 100644 index 1dde15a..0000000 --- a/lib/paypal_server_sdk/models/order_update_callback_response.rb +++ /dev/null @@ -1,72 +0,0 @@ -# paypal_server_sdk -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module PaypalServerSdk - # Returns the updated shipping options for an order. - class OrderUpdateCallbackResponse < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The ID of the order. - # @return [String] - attr_accessor :id - - # This would contain shipping option and amount data at purchase unit level. - # @return [ShippingOptionsPurchaseUnit] - attr_accessor :purchase_units - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['id'] = 'id' - @_hash['purchase_units'] = 'purchase_units' - @_hash - end - - # An array for optional fields - def self.optionals - %w[ - id - purchase_units - ] - end - - # An array for nullable fields - def self.nullables - [] - end - - def initialize(id: SKIP, purchase_units: SKIP) - @id = id unless id == SKIP - @purchase_units = purchase_units unless purchase_units == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - id = hash.key?('id') ? hash['id'] : SKIP - purchase_units = ShippingOptionsPurchaseUnit.from_hash(hash['purchase_units']) if - hash['purchase_units'] - - # Create object from extracted values. - OrderUpdateCallbackResponse.new(id: id, - purchase_units: purchase_units) - end - - # Provides a human-readable string representation of the object. - def to_s - class_name = self.class.name.split('::').last - "<#{class_name} id: #{@id}, purchase_units: #{@purchase_units}>" - end - - # Provides a debugging-friendly string with detailed object information. - def inspect - class_name = self.class.name.split('::').last - "<#{class_name} id: #{@id.inspect}, purchase_units: #{@purchase_units.inspect}>" - end - end -end diff --git a/lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb b/lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb deleted file mode 100644 index e391192..0000000 --- a/lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb +++ /dev/null @@ -1,107 +0,0 @@ -# paypal_server_sdk -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module PaypalServerSdk - # The portable international postal address. Maps to - # [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wi - # ki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the - # autocomplete - # attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-cont - # rols-the-autocomplete-attribute). - class OrderUpdateCallbackShippingAddress < BaseModel - SKIP = Object.new - private_constant :SKIP - - # A city, town, or village. Smaller than `admin_area_level_1`. - # @return [String] - attr_accessor :admin_area_2 - - # The highest-level sub-division in a country, which is usually a province, - # state, or ISO-3166-2 subdivision. This data is formatted for postal - # delivery, for example, `CA` and not `California`. Value, by country, is: - # UK. A county. US. A state. Canada. A province. Japan. A prefecture. - # Switzerland. A *kanton*. - # @return [String] - attr_accessor :admin_area_1 - - # The postal code, which is the ZIP code or equivalent. Typically required - # for countries with a postal code or an equivalent. See [postal - # code](https://en.wikipedia.org/wiki/Postal_code). - # @return [String] - attr_accessor :postal_code - - # The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that - # identifies the country or region. Note: The country code for Great Britain - # is GB and not UK as used in the top-level domain names for that country. - # Use the `C2` country code for China worldwide for comparable uncontrolled - # price (CUP) method, bank card, and cross-border transactions. - # @return [String] - attr_accessor :country_code - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['admin_area_2'] = 'admin_area_2' - @_hash['admin_area_1'] = 'admin_area_1' - @_hash['postal_code'] = 'postal_code' - @_hash['country_code'] = 'country_code' - @_hash - end - - # An array for optional fields - def self.optionals - %w[ - admin_area_2 - admin_area_1 - postal_code - ] - end - - # An array for nullable fields - def self.nullables - [] - end - - def initialize(country_code:, admin_area_2: SKIP, admin_area_1: SKIP, - postal_code: SKIP) - @admin_area_2 = admin_area_2 unless admin_area_2 == SKIP - @admin_area_1 = admin_area_1 unless admin_area_1 == SKIP - @postal_code = postal_code unless postal_code == SKIP - @country_code = country_code - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - country_code = hash.key?('country_code') ? hash['country_code'] : nil - admin_area_2 = hash.key?('admin_area_2') ? hash['admin_area_2'] : SKIP - admin_area_1 = hash.key?('admin_area_1') ? hash['admin_area_1'] : SKIP - postal_code = hash.key?('postal_code') ? hash['postal_code'] : SKIP - - # Create object from extracted values. - OrderUpdateCallbackShippingAddress.new(country_code: country_code, - admin_area_2: admin_area_2, - admin_area_1: admin_area_1, - postal_code: postal_code) - end - - # Provides a human-readable string representation of the object. - def to_s - class_name = self.class.name.split('::').last - "<#{class_name} admin_area_2: #{@admin_area_2}, admin_area_1: #{@admin_area_1},"\ - " postal_code: #{@postal_code}, country_code: #{@country_code}>" - end - - # Provides a debugging-friendly string with detailed object information. - def inspect - class_name = self.class.name.split('::').last - "<#{class_name} admin_area_2: #{@admin_area_2.inspect}, admin_area_1:"\ - " #{@admin_area_1.inspect}, postal_code: #{@postal_code.inspect}, country_code:"\ - " #{@country_code.inspect}>" - end - end -end diff --git a/lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb b/lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb deleted file mode 100644 index 12316a2..0000000 --- a/lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb +++ /dev/null @@ -1,93 +0,0 @@ -# paypal_server_sdk -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module PaypalServerSdk - # The options that the payee or merchant offers to the payer to ship or pick - # up their items. - class OrderUpdateCallbackShippingOption < BaseModel - SKIP = Object.new - private_constant :SKIP - - # A unique ID that identifies a payer-selected shipping option. - # @return [String] - attr_accessor :id - - # A description that the payer sees, which helps them choose an appropriate - # shipping option. For example, `Free Shipping`, `USPS Priority Shipping`, - # `Expédition prioritaire USPS`, or `USPS yōuxiān fā huò`. Localize this - # description to the payer's locale. - # @return [String] - attr_accessor :label - - # A classification for the method of purchase fulfillment. - # @return [ShippingType] - attr_accessor :type - - # The currency and amount for a financial transaction, such as a balance or - # payment due. - # @return [Money] - attr_accessor :amount - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['id'] = 'id' - @_hash['label'] = 'label' - @_hash['type'] = 'type' - @_hash['amount'] = 'amount' - @_hash - end - - # An array for optional fields - def self.optionals - %w[ - type - amount - ] - end - - # An array for nullable fields - def self.nullables - [] - end - - def initialize(id:, label:, type: SKIP, amount: SKIP) - @id = id - @label = label - @type = type unless type == SKIP - @amount = amount unless amount == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - id = hash.key?('id') ? hash['id'] : nil - label = hash.key?('label') ? hash['label'] : nil - type = hash.key?('type') ? hash['type'] : SKIP - amount = Money.from_hash(hash['amount']) if hash['amount'] - - # Create object from extracted values. - OrderUpdateCallbackShippingOption.new(id: id, - label: label, - type: type, - amount: amount) - end - - # Provides a human-readable string representation of the object. - def to_s - class_name = self.class.name.split('::').last - "<#{class_name} id: #{@id}, label: #{@label}, type: #{@type}, amount: #{@amount}>" - end - - # Provides a debugging-friendly string with detailed object information. - def inspect - class_name = self.class.name.split('::').last - "<#{class_name} id: #{@id.inspect}, label: #{@label.inspect}, type: #{@type.inspect},"\ - " amount: #{@amount.inspect}>" - end - end -end diff --git a/lib/paypal_server_sdk/models/orders_capture.rb b/lib/paypal_server_sdk/models/orders_capture.rb index f311a88..b80c744 100644 --- a/lib/paypal_server_sdk/models/orders_capture.rb +++ b/lib/paypal_server_sdk/models/orders_capture.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # A captured payment. @@ -39,7 +39,7 @@ class OrdersCapture < BaseModel attr_accessor :custom_id # Reference values used by the card network to identify a transaction. - # @return [NetworkTransactionReference] + # @return [NetworkTransaction] attr_accessor :network_transaction_reference # The level of protection offered as defined by [PayPal Seller Protection @@ -180,7 +180,7 @@ def self.from_hash(hash) invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP if hash['network_transaction_reference'] - network_transaction_reference = NetworkTransactionReference.from_hash(hash['network_transaction_reference']) + network_transaction_reference = NetworkTransaction.from_hash(hash['network_transaction_reference']) end seller_protection = SellerProtection.from_hash(hash['seller_protection']) if hash['seller_protection'] diff --git a/lib/paypal_server_sdk/models/orders_card_verification_method.rb b/lib/paypal_server_sdk/models/orders_card_verification_method.rb index 66581ae..14a28c0 100644 --- a/lib/paypal_server_sdk/models/orders_card_verification_method.rb +++ b/lib/paypal_server_sdk/models/orders_card_verification_method.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The method used for card verification. diff --git a/lib/paypal_server_sdk/models/os_type.rb b/lib/paypal_server_sdk/models/os_type.rb new file mode 100644 index 0000000..79f3acb --- /dev/null +++ b/lib/paypal_server_sdk/models/os_type.rb @@ -0,0 +1,26 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # Operating System type of the device that the buyer is using. + class OsType + OS_TYPE = [ + # Google Android OS. + ANDROID = 'ANDROID'.freeze, + + # Apple OS typically found in Apple mobile devices. + IOS = 'IOS'.freeze, + + # Any other OS type. + OTHER = 'OTHER'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/p24_payment_object.rb b/lib/paypal_server_sdk/models/p24_payment_object.rb index dff2b47..b69ae4b 100644 --- a/lib/paypal_server_sdk/models/p24_payment_object.rb +++ b/lib/paypal_server_sdk/models/p24_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information used to pay using P24(Przelewy24). diff --git a/lib/paypal_server_sdk/models/p24_payment_request.rb b/lib/paypal_server_sdk/models/p24_payment_request.rb index 3356c15..0b13432 100644 --- a/lib/paypal_server_sdk/models/p24_payment_request.rb +++ b/lib/paypal_server_sdk/models/p24_payment_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using P24 (Przelewy24). diff --git a/lib/paypal_server_sdk/models/pa_res_status.rb b/lib/paypal_server_sdk/models/pa_res_status.rb index 7b51664..6f23a9c 100644 --- a/lib/paypal_server_sdk/models/pa_res_status.rb +++ b/lib/paypal_server_sdk/models/pa_res_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Transactions status result identifier. The outcome of the issuer's diff --git a/lib/paypal_server_sdk/models/participant_metadata.rb b/lib/paypal_server_sdk/models/participant_metadata.rb index c0d62ea..d00d8f7 100644 --- a/lib/paypal_server_sdk/models/participant_metadata.rb +++ b/lib/paypal_server_sdk/models/participant_metadata.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Profile information of the sender or receiver. diff --git a/lib/paypal_server_sdk/models/patch.rb b/lib/paypal_server_sdk/models/patch.rb index e6802a4..d866067 100644 --- a/lib/paypal_server_sdk/models/patch.rb +++ b/lib/paypal_server_sdk/models/patch.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The JSON patch object to apply partial updates to resources. diff --git a/lib/paypal_server_sdk/models/patch_op.rb b/lib/paypal_server_sdk/models/patch_op.rb index d16cf27..18ef171 100644 --- a/lib/paypal_server_sdk/models/patch_op.rb +++ b/lib/paypal_server_sdk/models/patch_op.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The operation. diff --git a/lib/paypal_server_sdk/models/payee_base.rb b/lib/paypal_server_sdk/models/payee_base.rb index b12f70a..6e8e7ab 100644 --- a/lib/paypal_server_sdk/models/payee_base.rb +++ b/lib/paypal_server_sdk/models/payee_base.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details for the merchant who receives the funds and fulfills the order. diff --git a/lib/paypal_server_sdk/models/payee_payment_method_preference.rb b/lib/paypal_server_sdk/models/payee_payment_method_preference.rb index 00f9a68..3845727 100644 --- a/lib/paypal_server_sdk/models/payee_payment_method_preference.rb +++ b/lib/paypal_server_sdk/models/payee_payment_method_preference.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The merchant-preferred payment methods. diff --git a/lib/paypal_server_sdk/models/payer.rb b/lib/paypal_server_sdk/models/payer.rb index 9b66890..069d8f3 100644 --- a/lib/paypal_server_sdk/models/payer.rb +++ b/lib/paypal_server_sdk/models/payer.rb @@ -1,10 +1,11 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk - # Payer Model. + # The customer who approves and pays for the order. The customer is also known + # as the payer. class Payer < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/paypal_server_sdk/models/payer_base.rb b/lib/paypal_server_sdk/models/payer_base.rb index b7e7753..abe38aa 100644 --- a/lib/paypal_server_sdk/models/payer_base.rb +++ b/lib/paypal_server_sdk/models/payer_base.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The customer who approves and pays for the order. The customer is also known diff --git a/lib/paypal_server_sdk/models/payer_information.rb b/lib/paypal_server_sdk/models/payer_information.rb new file mode 100644 index 0000000..a6f2898 --- /dev/null +++ b/lib/paypal_server_sdk/models/payer_information.rb @@ -0,0 +1,146 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The payer information. + class PayerInformation < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The PayPal` customer account ID. + # @return [String] + attr_accessor :account_id + + # The internationalized email address. Note: Up to 64 characters are allowed + # before and 255 characters are allowed after the @ sign. However, the + # generally accepted maximum length for an email address is 254 characters. + # The pattern verifies that an unquoted @ sign exists. + # @return [String] + attr_accessor :email_address + + # The phone number, in its canonical international [E.164 numbering plan + # format](https://www.itu.int/rec/T-REC-E.164/en). + # @return [Phone] + attr_accessor :phone_number + + # The address status of the payer. Value is either: Y. Verified. N. Not + # verified. + # @return [String] + attr_accessor :address_status + + # The status of the payer. Value is `Y` or `N`. + # @return [String] + attr_accessor :payer_status + + # The name of the party. + # @return [PayerName] + attr_accessor :payer_name + + # The [two-character ISO 3166-1 + # code](/docs/integration/direct/rest/country-codes/) that identifies the + # country or region. Note: The country code for Great Britain is GB and not + # UK as used in the top-level domain names for that country. Use the `C2` + # country code for China worldwide for comparable uncontrolled price (CUP) + # method, bank card, and cross-border transactions. + # @return [String] + attr_accessor :country_code + + # A simple postal address with coarse-grained fields. Do not use for an + # international address. Use for backward compatibility only. Does not + # contain phone. + # @return [SimplePostalAddressCoarseGrained] + attr_accessor :address + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['account_id'] = 'account_id' + @_hash['email_address'] = 'email_address' + @_hash['phone_number'] = 'phone_number' + @_hash['address_status'] = 'address_status' + @_hash['payer_status'] = 'payer_status' + @_hash['payer_name'] = 'payer_name' + @_hash['country_code'] = 'country_code' + @_hash['address'] = 'address' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + account_id + email_address + phone_number + address_status + payer_status + payer_name + country_code + address + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(account_id: SKIP, email_address: SKIP, phone_number: SKIP, + address_status: SKIP, payer_status: SKIP, payer_name: SKIP, + country_code: SKIP, address: SKIP) + @account_id = account_id unless account_id == SKIP + @email_address = email_address unless email_address == SKIP + @phone_number = phone_number unless phone_number == SKIP + @address_status = address_status unless address_status == SKIP + @payer_status = payer_status unless payer_status == SKIP + @payer_name = payer_name unless payer_name == SKIP + @country_code = country_code unless country_code == SKIP + @address = address unless address == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + account_id = hash.key?('account_id') ? hash['account_id'] : SKIP + email_address = hash.key?('email_address') ? hash['email_address'] : SKIP + phone_number = Phone.from_hash(hash['phone_number']) if hash['phone_number'] + address_status = + hash.key?('address_status') ? hash['address_status'] : SKIP + payer_status = hash.key?('payer_status') ? hash['payer_status'] : SKIP + payer_name = PayerName.from_hash(hash['payer_name']) if hash['payer_name'] + country_code = hash.key?('country_code') ? hash['country_code'] : SKIP + address = SimplePostalAddressCoarseGrained.from_hash(hash['address']) if hash['address'] + + # Create object from extracted values. + PayerInformation.new(account_id: account_id, + email_address: email_address, + phone_number: phone_number, + address_status: address_status, + payer_status: payer_status, + payer_name: payer_name, + country_code: country_code, + address: address) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} account_id: #{@account_id}, email_address: #{@email_address}, phone_number:"\ + " #{@phone_number}, address_status: #{@address_status}, payer_status: #{@payer_status},"\ + " payer_name: #{@payer_name}, country_code: #{@country_code}, address: #{@address}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} account_id: #{@account_id.inspect}, email_address:"\ + " #{@email_address.inspect}, phone_number: #{@phone_number.inspect}, address_status:"\ + " #{@address_status.inspect}, payer_status: #{@payer_status.inspect}, payer_name:"\ + " #{@payer_name.inspect}, country_code: #{@country_code.inspect}, address:"\ + " #{@address.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/payer_name.rb b/lib/paypal_server_sdk/models/payer_name.rb new file mode 100644 index 0000000..428ebcc --- /dev/null +++ b/lib/paypal_server_sdk/models/payer_name.rb @@ -0,0 +1,128 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The name of the party. + class PayerName < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The prefix, or title, to the party's name. + # @return [String] + attr_accessor :prefix + + # When the party is a person, the party's given, or first, name. + # @return [String] + attr_accessor :given_name + + # When the party is a person, the party's surname or family name. Also known + # as the last name. Required when the party is a person. Use also to store + # multiple surnames including the matronymic, or mother's, surname. + # @return [String] + attr_accessor :surname + + # When the party is a person, the party's middle name. Use also to store + # multiple middle names including the patronymic, or father's, middle name. + # @return [String] + attr_accessor :middle_name + + # The suffix for the party's name. + # @return [String] + attr_accessor :suffix + + # DEPRECATED. The party's alternate name. Can be a business name, nickname, + # or any other name that cannot be split into first, last name. Required + # when the party is a business. + # @return [String] + attr_accessor :alternate_full_name + + # When the party is a person, the party's full name. + # @return [String] + attr_accessor :full_name + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['prefix'] = 'prefix' + @_hash['given_name'] = 'given_name' + @_hash['surname'] = 'surname' + @_hash['middle_name'] = 'middle_name' + @_hash['suffix'] = 'suffix' + @_hash['alternate_full_name'] = 'alternate_full_name' + @_hash['full_name'] = 'full_name' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + prefix + given_name + surname + middle_name + suffix + alternate_full_name + full_name + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(prefix: SKIP, given_name: SKIP, surname: SKIP, + middle_name: SKIP, suffix: SKIP, alternate_full_name: SKIP, + full_name: SKIP) + @prefix = prefix unless prefix == SKIP + @given_name = given_name unless given_name == SKIP + @surname = surname unless surname == SKIP + @middle_name = middle_name unless middle_name == SKIP + @suffix = suffix unless suffix == SKIP + @alternate_full_name = alternate_full_name unless alternate_full_name == SKIP + @full_name = full_name unless full_name == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + prefix = hash.key?('prefix') ? hash['prefix'] : SKIP + given_name = hash.key?('given_name') ? hash['given_name'] : SKIP + surname = hash.key?('surname') ? hash['surname'] : SKIP + middle_name = hash.key?('middle_name') ? hash['middle_name'] : SKIP + suffix = hash.key?('suffix') ? hash['suffix'] : SKIP + alternate_full_name = + hash.key?('alternate_full_name') ? hash['alternate_full_name'] : SKIP + full_name = hash.key?('full_name') ? hash['full_name'] : SKIP + + # Create object from extracted values. + PayerName.new(prefix: prefix, + given_name: given_name, + surname: surname, + middle_name: middle_name, + suffix: suffix, + alternate_full_name: alternate_full_name, + full_name: full_name) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} prefix: #{@prefix}, given_name: #{@given_name}, surname: #{@surname},"\ + " middle_name: #{@middle_name}, suffix: #{@suffix}, alternate_full_name:"\ + " #{@alternate_full_name}, full_name: #{@full_name}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} prefix: #{@prefix.inspect}, given_name: #{@given_name.inspect}, surname:"\ + " #{@surname.inspect}, middle_name: #{@middle_name.inspect}, suffix: #{@suffix.inspect},"\ + " alternate_full_name: #{@alternate_full_name.inspect}, full_name: #{@full_name.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/payment_advice_code.rb b/lib/paypal_server_sdk/models/payment_advice_code.rb index a32eba7..9cb1163 100644 --- a/lib/paypal_server_sdk/models/payment_advice_code.rb +++ b/lib/paypal_server_sdk/models/payment_advice_code.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The declined payment transactions might have payment advice codes. The card diff --git a/lib/paypal_server_sdk/models/payment_authorization.rb b/lib/paypal_server_sdk/models/payment_authorization.rb index 52dd876..176e82c 100644 --- a/lib/paypal_server_sdk/models/payment_authorization.rb +++ b/lib/paypal_server_sdk/models/payment_authorization.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The authorized payment transaction. @@ -39,7 +39,7 @@ class PaymentAuthorization < BaseModel attr_accessor :custom_id # Reference values used by the card network to identify a transaction. - # @return [NetworkTransactionReference] + # @return [NetworkTransaction] attr_accessor :network_transaction_reference # The level of protection offered as defined by [PayPal Seller Protection @@ -167,7 +167,7 @@ def self.from_hash(hash) invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP if hash['network_transaction_reference'] - network_transaction_reference = NetworkTransactionReference.from_hash(hash['network_transaction_reference']) + network_transaction_reference = NetworkTransaction.from_hash(hash['network_transaction_reference']) end seller_protection = SellerProtection.from_hash(hash['seller_protection']) if hash['seller_protection'] diff --git a/lib/paypal_server_sdk/models/payment_collection.rb b/lib/paypal_server_sdk/models/payment_collection.rb index 6ae020c..5d79b0b 100644 --- a/lib/paypal_server_sdk/models/payment_collection.rb +++ b/lib/paypal_server_sdk/models/payment_collection.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The collection of payments, or transactions, for a purchase unit in an diff --git a/lib/paypal_server_sdk/models/payment_initiator.rb b/lib/paypal_server_sdk/models/payment_initiator.rb index cd1f98a..22f9e7e 100644 --- a/lib/paypal_server_sdk/models/payment_initiator.rb +++ b/lib/paypal_server_sdk/models/payment_initiator.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The person or party who initiated or triggered the payment. diff --git a/lib/paypal_server_sdk/models/payment_instruction.rb b/lib/paypal_server_sdk/models/payment_instruction.rb index 3ba12b4..cf65469 100644 --- a/lib/paypal_server_sdk/models/payment_instruction.rb +++ b/lib/paypal_server_sdk/models/payment_instruction.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Any additional payment instructions to be consider during payment diff --git a/lib/paypal_server_sdk/models/payment_method.rb b/lib/paypal_server_sdk/models/payment_method.rb new file mode 100644 index 0000000..12a3d29 --- /dev/null +++ b/lib/paypal_server_sdk/models/payment_method.rb @@ -0,0 +1,63 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The customer and merchant payment preferences. + class PaymentMethod < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The merchant-preferred payment methods. + # @return [PayeePaymentMethodPreference] + attr_accessor :payee_preferred + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['payee_preferred'] = 'payee_preferred' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + payee_preferred + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(payee_preferred: PayeePaymentMethodPreference::UNRESTRICTED) + @payee_preferred = payee_preferred unless payee_preferred == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + payee_preferred = + hash['payee_preferred'] ||= PayeePaymentMethodPreference::UNRESTRICTED + + # Create object from extracted values. + PaymentMethod.new(payee_preferred: payee_preferred) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} payee_preferred: #{@payee_preferred}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} payee_preferred: #{@payee_preferred.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/payment_method_preference.rb b/lib/paypal_server_sdk/models/payment_method_preference.rb index 2ae8042..26dd562 100644 --- a/lib/paypal_server_sdk/models/payment_method_preference.rb +++ b/lib/paypal_server_sdk/models/payment_method_preference.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The customer and merchant payment preferences. diff --git a/lib/paypal_server_sdk/models/payment_preferences.rb b/lib/paypal_server_sdk/models/payment_preferences.rb new file mode 100644 index 0000000..4181f0f --- /dev/null +++ b/lib/paypal_server_sdk/models/payment_preferences.rb @@ -0,0 +1,105 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The payment preferences for a subscription. + class PaymentPreferences < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Indicates whether to automatically bill the outstanding amount in the next + # billing cycle. + # @return [TrueClass | FalseClass] + attr_accessor :auto_bill_outstanding + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :setup_fee + + # The action to take on the subscription if the initial payment for the + # setup fails. + # @return [SetupFeeFailureAction] + attr_accessor :setup_fee_failure_action + + # The maximum number of payment failures before a subscription is suspended. + # For example, if `payment_failure_threshold` is `2`, the subscription + # automatically updates to the `SUSPEND` state if two consecutive payments + # fail. + # @return [Integer] + attr_accessor :payment_failure_threshold + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['auto_bill_outstanding'] = 'auto_bill_outstanding' + @_hash['setup_fee'] = 'setup_fee' + @_hash['setup_fee_failure_action'] = 'setup_fee_failure_action' + @_hash['payment_failure_threshold'] = 'payment_failure_threshold' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + auto_bill_outstanding + setup_fee + setup_fee_failure_action + payment_failure_threshold + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(auto_bill_outstanding: true, setup_fee: SKIP, + setup_fee_failure_action: SetupFeeFailureAction::CANCEL, + payment_failure_threshold: 0) + @auto_bill_outstanding = auto_bill_outstanding unless auto_bill_outstanding == SKIP + @setup_fee = setup_fee unless setup_fee == SKIP + @setup_fee_failure_action = setup_fee_failure_action unless setup_fee_failure_action == SKIP + unless payment_failure_threshold == SKIP + @payment_failure_threshold = + payment_failure_threshold + end + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + auto_bill_outstanding = hash['auto_bill_outstanding'] ||= true + setup_fee = Money.from_hash(hash['setup_fee']) if hash['setup_fee'] + setup_fee_failure_action = + hash['setup_fee_failure_action'] ||= SetupFeeFailureAction::CANCEL + payment_failure_threshold = hash['payment_failure_threshold'] ||= 0 + + # Create object from extracted values. + PaymentPreferences.new(auto_bill_outstanding: auto_bill_outstanding, + setup_fee: setup_fee, + setup_fee_failure_action: setup_fee_failure_action, + payment_failure_threshold: payment_failure_threshold) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} auto_bill_outstanding: #{@auto_bill_outstanding}, setup_fee: #{@setup_fee},"\ + " setup_fee_failure_action: #{@setup_fee_failure_action}, payment_failure_threshold:"\ + " #{@payment_failure_threshold}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} auto_bill_outstanding: #{@auto_bill_outstanding.inspect}, setup_fee:"\ + " #{@setup_fee.inspect}, setup_fee_failure_action: #{@setup_fee_failure_action.inspect},"\ + " payment_failure_threshold: #{@payment_failure_threshold.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/payment_preferences_override.rb b/lib/paypal_server_sdk/models/payment_preferences_override.rb new file mode 100644 index 0000000..291c6f0 --- /dev/null +++ b/lib/paypal_server_sdk/models/payment_preferences_override.rb @@ -0,0 +1,107 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The payment preferences to override at subscription level. + class PaymentPreferencesOverride < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Indicates whether to automatically bill the outstanding amount in the next + # billing cycle. + # @return [TrueClass | FalseClass] + attr_accessor :auto_bill_outstanding + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :setup_fee + + # The action to take on the subscription if the initial payment for the + # setup fails. + # @return [SetupFeeFailureAction] + attr_accessor :setup_fee_failure_action + + # The maximum number of payment failures before a subscription is suspended. + # For example, if `payment_failure_threshold` is `2`, the subscription + # automatically updates to the `SUSPEND` state if two consecutive payments + # fail. + # @return [Integer] + attr_accessor :payment_failure_threshold + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['auto_bill_outstanding'] = 'auto_bill_outstanding' + @_hash['setup_fee'] = 'setup_fee' + @_hash['setup_fee_failure_action'] = 'setup_fee_failure_action' + @_hash['payment_failure_threshold'] = 'payment_failure_threshold' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + auto_bill_outstanding + setup_fee + setup_fee_failure_action + payment_failure_threshold + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(auto_bill_outstanding: SKIP, setup_fee: SKIP, + setup_fee_failure_action: SKIP, + payment_failure_threshold: SKIP) + @auto_bill_outstanding = auto_bill_outstanding unless auto_bill_outstanding == SKIP + @setup_fee = setup_fee unless setup_fee == SKIP + @setup_fee_failure_action = setup_fee_failure_action unless setup_fee_failure_action == SKIP + unless payment_failure_threshold == SKIP + @payment_failure_threshold = + payment_failure_threshold + end + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + auto_bill_outstanding = + hash.key?('auto_bill_outstanding') ? hash['auto_bill_outstanding'] : SKIP + setup_fee = Money.from_hash(hash['setup_fee']) if hash['setup_fee'] + setup_fee_failure_action = + hash.key?('setup_fee_failure_action') ? hash['setup_fee_failure_action'] : SKIP + payment_failure_threshold = + hash.key?('payment_failure_threshold') ? hash['payment_failure_threshold'] : SKIP + + # Create object from extracted values. + PaymentPreferencesOverride.new(auto_bill_outstanding: auto_bill_outstanding, + setup_fee: setup_fee, + setup_fee_failure_action: setup_fee_failure_action, + payment_failure_threshold: payment_failure_threshold) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} auto_bill_outstanding: #{@auto_bill_outstanding}, setup_fee: #{@setup_fee},"\ + " setup_fee_failure_action: #{@setup_fee_failure_action}, payment_failure_threshold:"\ + " #{@payment_failure_threshold}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} auto_bill_outstanding: #{@auto_bill_outstanding.inspect}, setup_fee:"\ + " #{@setup_fee.inspect}, setup_fee_failure_action: #{@setup_fee_failure_action.inspect},"\ + " payment_failure_threshold: #{@payment_failure_threshold.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/payment_source.rb b/lib/paypal_server_sdk/models/payment_source.rb index 45006b6..b3b30dc 100644 --- a/lib/paypal_server_sdk/models/payment_source.rb +++ b/lib/paypal_server_sdk/models/payment_source.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment source definition. diff --git a/lib/paypal_server_sdk/models/payment_source_response.rb b/lib/paypal_server_sdk/models/payment_source_response.rb index e9163dd..e9977c1 100644 --- a/lib/paypal_server_sdk/models/payment_source_response.rb +++ b/lib/paypal_server_sdk/models/payment_source_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment source used to fund the payment. diff --git a/lib/paypal_server_sdk/models/payment_supplementary_data.rb b/lib/paypal_server_sdk/models/payment_supplementary_data.rb index 25b7ad9..cc177e3 100644 --- a/lib/paypal_server_sdk/models/payment_supplementary_data.rb +++ b/lib/paypal_server_sdk/models/payment_supplementary_data.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The supplementary data. diff --git a/lib/paypal_server_sdk/models/payment_token_request.rb b/lib/paypal_server_sdk/models/payment_token_request.rb index 108a41e..058506e 100644 --- a/lib/paypal_server_sdk/models/payment_token_request.rb +++ b/lib/paypal_server_sdk/models/payment_token_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Payment Token Request where the `source` defines the type of instrument to diff --git a/lib/paypal_server_sdk/models/payment_token_request_card.rb b/lib/paypal_server_sdk/models/payment_token_request_card.rb index 0d7e96d..bd4f66d 100644 --- a/lib/paypal_server_sdk/models/payment_token_request_card.rb +++ b/lib/paypal_server_sdk/models/payment_token_request_card.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # A Resource representing a request to vault a Card. diff --git a/lib/paypal_server_sdk/models/payment_token_request_payment_source.rb b/lib/paypal_server_sdk/models/payment_token_request_payment_source.rb index 24d6ad3..08e41d6 100644 --- a/lib/paypal_server_sdk/models/payment_token_request_payment_source.rb +++ b/lib/paypal_server_sdk/models/payment_token_request_payment_source.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment method to vault with the instrument details. diff --git a/lib/paypal_server_sdk/models/payment_token_response.rb b/lib/paypal_server_sdk/models/payment_token_response.rb index ec46c23..c3784f5 100644 --- a/lib/paypal_server_sdk/models/payment_token_response.rb +++ b/lib/paypal_server_sdk/models/payment_token_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Full representation of a saved payment token. @@ -9,7 +9,9 @@ class PaymentTokenResponse < BaseModel SKIP = Object.new private_constant :SKIP - # The PayPal-generated ID for the vault token. + # The PayPal-generated ID for the vaulted payment source. This ID should be + # stored on the merchant's server so the saved payment source can be used + # for future transactions. # @return [String] attr_accessor :id diff --git a/lib/paypal_server_sdk/models/payment_token_response_payment_source.rb b/lib/paypal_server_sdk/models/payment_token_response_payment_source.rb index 89be943..896731f 100644 --- a/lib/paypal_server_sdk/models/payment_token_response_payment_source.rb +++ b/lib/paypal_server_sdk/models/payment_token_response_payment_source.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The vaulted payment method details. @@ -13,11 +13,11 @@ class PaymentTokenResponsePaymentSource < BaseModel # @return [CardPaymentTokenEntity] attr_accessor :card - # Full representation of a Card Payment Token including network token. + # Full representation of a PayPal Payment Token. # @return [PaypalPaymentToken] attr_accessor :paypal - # Full representation of a Card Payment Token including network token. + # Full representation of a Venmo Payment Token. # @return [VenmoPaymentToken] attr_accessor :venmo diff --git a/lib/paypal_server_sdk/models/payment_token_status.rb b/lib/paypal_server_sdk/models/payment_token_status.rb index 527e2e7..d5f294a 100644 --- a/lib/paypal_server_sdk/models/payment_token_status.rb +++ b/lib/paypal_server_sdk/models/payment_token_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The status of the payment token. @@ -11,8 +11,8 @@ class PaymentTokenStatus # added to the setup-token to be vaulted CREATED = 'CREATED'.freeze, - # A contingecy on payer approval is required before the payment method can - # be saved. + # A contingency on payer approval is required before the payment method + # can be saved. PAYER_ACTION_REQUIRED = 'PAYER_ACTION_REQUIRED'.freeze, # Setup token is ready to be vaulted. If a buyer approval contigency was diff --git a/lib/paypal_server_sdk/models/payments_capture.rb b/lib/paypal_server_sdk/models/payments_capture.rb index 2b396dd..5b60670 100644 --- a/lib/paypal_server_sdk/models/payments_capture.rb +++ b/lib/paypal_server_sdk/models/payments_capture.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # A captured payment. @@ -39,7 +39,7 @@ class PaymentsCapture < BaseModel attr_accessor :custom_id # Reference values used by the card network to identify a transaction. - # @return [NetworkTransactionReference] + # @return [NetworkTransaction] attr_accessor :network_transaction_reference # The level of protection offered as defined by [PayPal Seller Protection @@ -72,7 +72,7 @@ class PaymentsCapture < BaseModel # The processor response information for payment requests, such as direct # credit card transactions. - # @return [PaymentsProcessorResponse] + # @return [ProcessorResponse] attr_accessor :processor_response # The date and time, in [Internet date and time @@ -180,7 +180,7 @@ def self.from_hash(hash) invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP if hash['network_transaction_reference'] - network_transaction_reference = NetworkTransactionReference.from_hash(hash['network_transaction_reference']) + network_transaction_reference = NetworkTransaction.from_hash(hash['network_transaction_reference']) end seller_protection = SellerProtection.from_hash(hash['seller_protection']) if hash['seller_protection'] @@ -200,7 +200,7 @@ def self.from_hash(hash) end links = SKIP unless hash.key?('links') - processor_response = PaymentsProcessorResponse.from_hash(hash['processor_response']) if + processor_response = ProcessorResponse.from_hash(hash['processor_response']) if hash['processor_response'] create_time = hash.key?('create_time') ? hash['create_time'] : SKIP update_time = hash.key?('update_time') ? hash['update_time'] : SKIP diff --git a/lib/paypal_server_sdk/models/payments_payment_advice_code.rb b/lib/paypal_server_sdk/models/payments_payment_advice_code.rb deleted file mode 100644 index da3824e..0000000 --- a/lib/paypal_server_sdk/models/payments_payment_advice_code.rb +++ /dev/null @@ -1,42 +0,0 @@ -# paypal_server_sdk -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module PaypalServerSdk - # The declined payment transactions might have payment advice codes. The card - # networks, like Visa and Mastercard, return payment advice codes. - class PaymentsPaymentAdviceCode - PAYMENTS_PAYMENT_ADVICE_CODE = [ - # For Mastercard, expired card account upgrade or portfolio sale - # conversion. Obtain new account information before next billing cycle. - PAYMENTADVICE_01 = '01'.freeze, - - # For Mastercard, over credit limit or insufficient funds. Retry the - # transaction 72 hours later. For Visa, the card holder wants to stop only - # one specific payment in the recurring payment relationship. The merchant - # must NOT resubmit the same transaction. The merchant can continue the - # billing process in the subsequent billing period. - PAYMENTADVICE_02 = '02'.freeze, - - # For Mastercard, account closed as fraudulent. Obtain another type of - # payment from customer due to account being closed or fraud. Possible - # reason: Account closed as fraudulent. For Visa, the card holder wants to - # stop all recurring payment transactions for a specific merchant. Stop - # recurring payment requests. - PAYMENTADVICE_03 = '03'.freeze, - - # For Mastercard, the card holder has been unsuccessful at canceling - # recurring payment through merchant. Stop recurring payment requests. For - # Visa, all recurring payments were canceled for the card number - # requested. Stop recurring payment requests. - PAYMENTADVICE_21 = '21'.freeze - ].freeze - - def self.validate(value) - return false if value.nil? - - true - end - end -end diff --git a/lib/paypal_server_sdk/models/payments_processor_response.rb b/lib/paypal_server_sdk/models/payments_processor_response.rb deleted file mode 100644 index 06f51cb..0000000 --- a/lib/paypal_server_sdk/models/payments_processor_response.rb +++ /dev/null @@ -1,98 +0,0 @@ -# paypal_server_sdk -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module PaypalServerSdk - # The processor response information for payment requests, such as direct - # credit card transactions. - class PaymentsProcessorResponse < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The address verification code for Visa, Discover, Mastercard, or American - # Express transactions. - # @return [AvsCode] - attr_accessor :avs_code - - # The card verification value code for for Visa, Discover, Mastercard, or - # American Express. - # @return [CvvCode] - attr_accessor :cvv_code - - # Processor response code for the non-PayPal payment processor errors. - # @return [ProcessorResponseCode] - attr_accessor :response_code - - # The declined payment transactions might have payment advice codes. The - # card networks, like Visa and Mastercard, return payment advice codes. - # @return [PaymentsPaymentAdviceCode] - attr_accessor :payment_advice_code - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['avs_code'] = 'avs_code' - @_hash['cvv_code'] = 'cvv_code' - @_hash['response_code'] = 'response_code' - @_hash['payment_advice_code'] = 'payment_advice_code' - @_hash - end - - # An array for optional fields - def self.optionals - %w[ - avs_code - cvv_code - response_code - payment_advice_code - ] - end - - # An array for nullable fields - def self.nullables - [] - end - - def initialize(avs_code: SKIP, cvv_code: SKIP, response_code: SKIP, - payment_advice_code: SKIP) - @avs_code = avs_code unless avs_code == SKIP - @cvv_code = cvv_code unless cvv_code == SKIP - @response_code = response_code unless response_code == SKIP - @payment_advice_code = payment_advice_code unless payment_advice_code == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - avs_code = hash.key?('avs_code') ? hash['avs_code'] : SKIP - cvv_code = hash.key?('cvv_code') ? hash['cvv_code'] : SKIP - response_code = hash.key?('response_code') ? hash['response_code'] : SKIP - payment_advice_code = - hash.key?('payment_advice_code') ? hash['payment_advice_code'] : SKIP - - # Create object from extracted values. - PaymentsProcessorResponse.new(avs_code: avs_code, - cvv_code: cvv_code, - response_code: response_code, - payment_advice_code: payment_advice_code) - end - - # Provides a human-readable string representation of the object. - def to_s - class_name = self.class.name.split('::').last - "<#{class_name} avs_code: #{@avs_code}, cvv_code: #{@cvv_code}, response_code:"\ - " #{@response_code}, payment_advice_code: #{@payment_advice_code}>" - end - - # Provides a debugging-friendly string with detailed object information. - def inspect - class_name = self.class.name.split('::').last - "<#{class_name} avs_code: #{@avs_code.inspect}, cvv_code: #{@cvv_code.inspect},"\ - " response_code: #{@response_code.inspect}, payment_advice_code:"\ - " #{@payment_advice_code.inspect}>" - end - end -end diff --git a/lib/paypal_server_sdk/models/paypal_experience_landing_page.rb b/lib/paypal_server_sdk/models/paypal_experience_landing_page.rb index fdbc37e..2bef2a6 100644 --- a/lib/paypal_server_sdk/models/paypal_experience_landing_page.rb +++ b/lib/paypal_server_sdk/models/paypal_experience_landing_page.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The type of landing page to show on the PayPal site for customer checkout. @@ -22,7 +22,14 @@ class PaypalExperienceLandingPage # to enter credit or debit card and other relevant billing information # required to complete the purchase, depending on their previous # interaction with PayPal. - NO_PREFERENCE = 'NO_PREFERENCE'.freeze + NO_PREFERENCE = 'NO_PREFERENCE'.freeze, + + # DEPRECATED - please use GUEST_CHECKOUT. All implementations of 'BILLING' + # will be routed to 'GUEST_CHECKOUT'. When the customer clicks PayPal + # Checkout, the customer is redirected to a page to enter credit or debit + # card and other relevant billing information required to complete the + # purchase. + BILLING = 'BILLING'.freeze ].freeze def self.validate(value) diff --git a/lib/paypal_server_sdk/models/paypal_experience_user_action.rb b/lib/paypal_server_sdk/models/paypal_experience_user_action.rb index bbc52f9..aa9a948 100644 --- a/lib/paypal_server_sdk/models/paypal_experience_user_action.rb +++ b/lib/paypal_server_sdk/models/paypal_experience_user_action.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Configures a Continue or Pay Now checkout flow. diff --git a/lib/paypal_server_sdk/models/paypal_payment_token.rb b/lib/paypal_server_sdk/models/paypal_payment_token.rb index 5febea8..9e3f18b 100644 --- a/lib/paypal_server_sdk/models/paypal_payment_token.rb +++ b/lib/paypal_server_sdk/models/paypal_payment_token.rb @@ -1,10 +1,10 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk - # PaypalPaymentToken Model. + # Full representation of a PayPal Payment Token. class PaypalPaymentToken < BaseModel SKIP = Object.new private_constant :SKIP @@ -44,10 +44,11 @@ class PaypalPaymentToken < BaseModel # @return [PaypalPaymentTokenCustomerType] attr_accessor :customer_type - # The internationalized email address. Note: Up to 64 characters are allowed - # before and 255 characters are allowed after the @ sign. However, the - # generally accepted maximum length for an email address is 254 characters. - # The pattern verifies that an unquoted @ sign exists. + # The internationalized email address.
Note: Up + # to 64 characters are allowed before and 255 characters are allowed after + # the @ sign. However, the generally accepted maximum length + # for an email address is 254 characters. The pattern verifies that an + # unquoted @ sign exists.
# @return [String] attr_accessor :email_address diff --git a/lib/paypal_server_sdk/models/paypal_payment_token_customer_type.rb b/lib/paypal_server_sdk/models/paypal_payment_token_customer_type.rb index 5a84c43..8c75fc6 100644 --- a/lib/paypal_server_sdk/models/paypal_payment_token_customer_type.rb +++ b/lib/paypal_server_sdk/models/paypal_payment_token_customer_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The customer type associated with the PayPal payment token. This is to diff --git a/lib/paypal_server_sdk/models/paypal_payment_token_usage_type.rb b/lib/paypal_server_sdk/models/paypal_payment_token_usage_type.rb index 5317587..c9596fa 100644 --- a/lib/paypal_server_sdk/models/paypal_payment_token_usage_type.rb +++ b/lib/paypal_server_sdk/models/paypal_payment_token_usage_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The usage type associated with the PayPal payment token., The usage type diff --git a/lib/paypal_server_sdk/models/paypal_reference_id_type.rb b/lib/paypal_server_sdk/models/paypal_reference_id_type.rb new file mode 100644 index 0000000..7569069 --- /dev/null +++ b/lib/paypal_server_sdk/models/paypal_reference_id_type.rb @@ -0,0 +1,29 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The PayPal reference ID type. + class PaypalReferenceIdType + PAYPAL_REFERENCE_ID_TYPE = [ + # An order ID. + ODR = 'ODR'.freeze, + + # A transaction ID. + TXN = 'TXN'.freeze, + + # A subscription ID. + SUB = 'SUB'.freeze, + + # A pre-approved payment ID. + PAP = 'PAP'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/paypal_wallet.rb b/lib/paypal_server_sdk/models/paypal_wallet.rb index 6a59bbe..71f6847 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # A resource that identifies a PayPal Wallet is used for payment. diff --git a/lib/paypal_server_sdk/models/paypal_wallet_account_verification_status.rb b/lib/paypal_server_sdk/models/paypal_wallet_account_verification_status.rb index e0c6d77..60d20c6 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_account_verification_status.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_account_verification_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The account status indicates whether the buyer has verified the financial diff --git a/lib/paypal_server_sdk/models/paypal_wallet_attributes.rb b/lib/paypal_server_sdk/models/paypal_wallet_attributes.rb index 577172c..7796789 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_attributes.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_attributes.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Additional attributes associated with the use of this PayPal Wallet. @@ -13,7 +13,8 @@ class PaypalWalletAttributes < BaseModel # @return [PaypalWalletCustomerRequest] attr_accessor :customer - # TODO: Write general description for this method + # Resource consolidating common request and response attributes for vaulting + # PayPal Wallet. # @return [PaypalWalletVaultInstruction] attr_accessor :vault diff --git a/lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb b/lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb index 197c9ac..45ca323 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Additional attributes associated with the use of a PayPal Wallet. diff --git a/lib/paypal_server_sdk/models/paypal_wallet_contact_preference.rb b/lib/paypal_server_sdk/models/paypal_wallet_contact_preference.rb index 6b93f6f..2bd3cff 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_contact_preference.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_contact_preference.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The preference to display the contact information (buyer’s shipping email & diff --git a/lib/paypal_server_sdk/models/paypal_wallet_context_shipping_preference.rb b/lib/paypal_server_sdk/models/paypal_wallet_context_shipping_preference.rb index 7cc0be3..3e33bd9 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_context_shipping_preference.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_context_shipping_preference.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The location from which the shipping address is derived. diff --git a/lib/paypal_server_sdk/models/paypal_wallet_customer.rb b/lib/paypal_server_sdk/models/paypal_wallet_customer.rb index d26a6f1..83af7f9 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_customer.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_customer.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details about a customer in PayPal's system of record. diff --git a/lib/paypal_server_sdk/models/paypal_wallet_customer_request.rb b/lib/paypal_server_sdk/models/paypal_wallet_customer_request.rb index c65362c..49c48b0 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_customer_request.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_customer_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # PaypalWalletCustomerRequest Model. diff --git a/lib/paypal_server_sdk/models/paypal_wallet_experience_context.rb b/lib/paypal_server_sdk/models/paypal_wallet_experience_context.rb index 492513a..214484e 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_experience_context.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_experience_context.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Customizes the payer experience during the approval process for payment with @@ -47,6 +47,11 @@ class PaypalWalletExperienceContext < BaseModel # @return [String] attr_accessor :cancel_url + # Merchant provided details of the native app or mobile web browser to + # facilitate buyer's app switch to the PayPal consumer app. + # @return [AppSwitchContext] + attr_accessor :app_switch_context + # The type of landing page to show on the PayPal site for customer checkout. # @return [PaypalExperienceLandingPage] attr_accessor :landing_page @@ -72,6 +77,7 @@ def self.names @_hash['contact_preference'] = 'contact_preference' @_hash['return_url'] = 'return_url' @_hash['cancel_url'] = 'cancel_url' + @_hash['app_switch_context'] = 'app_switch_context' @_hash['landing_page'] = 'landing_page' @_hash['user_action'] = 'user_action' @_hash['payment_method_preference'] = 'payment_method_preference' @@ -88,6 +94,7 @@ def self.optionals contact_preference return_url cancel_url + app_switch_context landing_page user_action payment_method_preference @@ -104,7 +111,7 @@ def initialize( brand_name: SKIP, locale: SKIP, shipping_preference: PaypalWalletContextShippingPreference::GET_FROM_FILE, contact_preference: PaypalWalletContactPreference::NO_CONTACT_INFO, - return_url: SKIP, cancel_url: SKIP, + return_url: SKIP, cancel_url: SKIP, app_switch_context: SKIP, landing_page: PaypalExperienceLandingPage::NO_PREFERENCE, user_action: PaypalExperienceUserAction::CONTINUE, payment_method_preference: PayeePaymentMethodPreference::UNRESTRICTED, @@ -116,6 +123,7 @@ def initialize( @contact_preference = contact_preference unless contact_preference == SKIP @return_url = return_url unless return_url == SKIP @cancel_url = cancel_url unless cancel_url == SKIP + @app_switch_context = app_switch_context unless app_switch_context == SKIP @landing_page = landing_page unless landing_page == SKIP @user_action = user_action unless user_action == SKIP unless payment_method_preference == SKIP @@ -141,6 +149,8 @@ def self.from_hash(hash) hash['contact_preference'] ||= PaypalWalletContactPreference::NO_CONTACT_INFO return_url = hash.key?('return_url') ? hash['return_url'] : SKIP cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : SKIP + app_switch_context = AppSwitchContext.from_hash(hash['app_switch_context']) if + hash['app_switch_context'] landing_page = hash['landing_page'] ||= PaypalExperienceLandingPage::NO_PREFERENCE user_action = hash['user_action'] ||= PaypalExperienceUserAction::CONTINUE @@ -157,6 +167,7 @@ def self.from_hash(hash) contact_preference: contact_preference, return_url: return_url, cancel_url: cancel_url, + app_switch_context: app_switch_context, landing_page: landing_page, user_action: user_action, payment_method_preference: payment_method_preference, @@ -168,9 +179,10 @@ def to_s class_name = self.class.name.split('::').last "<#{class_name} brand_name: #{@brand_name}, locale: #{@locale}, shipping_preference:"\ " #{@shipping_preference}, contact_preference: #{@contact_preference}, return_url:"\ - " #{@return_url}, cancel_url: #{@cancel_url}, landing_page: #{@landing_page}, user_action:"\ - " #{@user_action}, payment_method_preference: #{@payment_method_preference},"\ - " order_update_callback_config: #{@order_update_callback_config}>" + " #{@return_url}, cancel_url: #{@cancel_url}, app_switch_context: #{@app_switch_context},"\ + " landing_page: #{@landing_page}, user_action: #{@user_action}, payment_method_preference:"\ + " #{@payment_method_preference}, order_update_callback_config:"\ + " #{@order_update_callback_config}>" end # Provides a debugging-friendly string with detailed object information. @@ -179,9 +191,10 @@ def inspect "<#{class_name} brand_name: #{@brand_name.inspect}, locale: #{@locale.inspect},"\ " shipping_preference: #{@shipping_preference.inspect}, contact_preference:"\ " #{@contact_preference.inspect}, return_url: #{@return_url.inspect}, cancel_url:"\ - " #{@cancel_url.inspect}, landing_page: #{@landing_page.inspect}, user_action:"\ - " #{@user_action.inspect}, payment_method_preference: #{@payment_method_preference.inspect},"\ - " order_update_callback_config: #{@order_update_callback_config.inspect}>" + " #{@cancel_url.inspect}, app_switch_context: #{@app_switch_context.inspect}, landing_page:"\ + " #{@landing_page.inspect}, user_action: #{@user_action.inspect}, payment_method_preference:"\ + " #{@payment_method_preference.inspect}, order_update_callback_config:"\ + " #{@order_update_callback_config.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/paypal_wallet_response.rb b/lib/paypal_server_sdk/models/paypal_wallet_response.rb index 875b7a9..319fced 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_response.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The PayPal Wallet response. @@ -79,6 +79,12 @@ class PaypalWalletResponse < BaseModel # @return [PaypalWalletStoredCredential] attr_accessor :stored_credential + # This field indicates the status of PayPal's Checkout experience throughout + # the order lifecycle. The values reflect the current stage of the checkout + # process. + # @return [ExperienceStatus] + attr_accessor :experience_status + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -94,6 +100,7 @@ def self.names @_hash['address'] = 'address' @_hash['attributes'] = 'attributes' @_hash['stored_credential'] = 'stored_credential' + @_hash['experience_status'] = 'experience_status' @_hash end @@ -112,6 +119,7 @@ def self.optionals address attributes stored_credential + experience_status ] end @@ -123,7 +131,8 @@ def self.nullables def initialize(email_address: SKIP, account_id: SKIP, account_status: SKIP, name: SKIP, phone_type: SKIP, phone_number: SKIP, birth_date: SKIP, business_name: SKIP, tax_info: SKIP, - address: SKIP, attributes: SKIP, stored_credential: SKIP) + address: SKIP, attributes: SKIP, stored_credential: SKIP, + experience_status: SKIP) @email_address = email_address unless email_address == SKIP @account_id = account_id unless account_id == SKIP @account_status = account_status unless account_status == SKIP @@ -136,6 +145,7 @@ def initialize(email_address: SKIP, account_id: SKIP, account_status: SKIP, @address = address unless address == SKIP @attributes = attributes unless attributes == SKIP @stored_credential = stored_credential unless stored_credential == SKIP + @experience_status = experience_status unless experience_status == SKIP end # Creates an instance of the object from a hash. @@ -158,6 +168,8 @@ def self.from_hash(hash) hash['attributes'] stored_credential = PaypalWalletStoredCredential.from_hash(hash['stored_credential']) if hash['stored_credential'] + experience_status = + hash.key?('experience_status') ? hash['experience_status'] : SKIP # Create object from extracted values. PaypalWalletResponse.new(email_address: email_address, @@ -171,7 +183,8 @@ def self.from_hash(hash) tax_info: tax_info, address: address, attributes: attributes, - stored_credential: stored_credential) + stored_credential: stored_credential, + experience_status: experience_status) end # Provides a human-readable string representation of the object. @@ -181,7 +194,8 @@ def to_s " account_status: #{@account_status}, name: #{@name}, phone_type: #{@phone_type},"\ " phone_number: #{@phone_number}, birth_date: #{@birth_date}, business_name:"\ " #{@business_name}, tax_info: #{@tax_info}, address: #{@address}, attributes:"\ - " #{@attributes}, stored_credential: #{@stored_credential}>" + " #{@attributes}, stored_credential: #{@stored_credential}, experience_status:"\ + " #{@experience_status}>" end # Provides a debugging-friendly string with detailed object information. @@ -192,7 +206,8 @@ def inspect " #{@name.inspect}, phone_type: #{@phone_type.inspect}, phone_number:"\ " #{@phone_number.inspect}, birth_date: #{@birth_date.inspect}, business_name:"\ " #{@business_name.inspect}, tax_info: #{@tax_info.inspect}, address: #{@address.inspect},"\ - " attributes: #{@attributes.inspect}, stored_credential: #{@stored_credential.inspect}>" + " attributes: #{@attributes.inspect}, stored_credential: #{@stored_credential.inspect},"\ + " experience_status: #{@experience_status.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb b/lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb index d5d3d69..93abef2 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Provides additional details to process a payment using the PayPal wallet @@ -15,7 +15,8 @@ class PaypalWalletStoredCredential < BaseModel # @return [PaymentInitiator] attr_accessor :payment_initiator - # Expected business/pricing model for the billing agreement. + # DEPRECATED. Expected business/pricing model for the billing agreement, + # Please use usage_pattern instead. # @return [UsagePattern] attr_accessor :charge_pattern diff --git a/lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb b/lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb index bc495f9..8a138c6 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb @@ -1,18 +1,15 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk - # PaypalWalletVaultInstruction Model. + # Resource consolidating common request and response attributes for vaulting + # PayPal Wallet. class PaypalWalletVaultInstruction < BaseModel SKIP = Object.new private_constant :SKIP - # Defines how and when the payment source gets vaulted. - # @return [StoreInVaultInstruction] - attr_accessor :store_in_vault - # The description displayed to PayPal consumer on the approval flow for # PayPal, as well as on the PayPal payment token management experience on # PayPal.com. @@ -47,7 +44,6 @@ class PaypalWalletVaultInstruction < BaseModel # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? - @_hash['store_in_vault'] = 'store_in_vault' @_hash['description'] = 'description' @_hash['usage_pattern'] = 'usage_pattern' @_hash['usage_type'] = 'usage_type' @@ -60,7 +56,6 @@ def self.names # An array for optional fields def self.optionals %w[ - store_in_vault description usage_pattern customer_type @@ -73,11 +68,9 @@ def self.nullables [] end - def initialize(usage_type:, store_in_vault: SKIP, description: SKIP, - usage_pattern: SKIP, + def initialize(usage_type:, description: SKIP, usage_pattern: SKIP, customer_type: PaypalPaymentTokenCustomerType::CONSUMER, permit_multiple_payment_tokens: false) - @store_in_vault = store_in_vault unless store_in_vault == SKIP @description = description unless description == SKIP @usage_pattern = usage_pattern unless usage_pattern == SKIP @usage_type = usage_type @@ -94,8 +87,6 @@ def self.from_hash(hash) # Extract variables from the hash. usage_type = hash.key?('usage_type') ? hash['usage_type'] : nil - store_in_vault = - hash.key?('store_in_vault') ? hash['store_in_vault'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP usage_pattern = hash.key?('usage_pattern') ? hash['usage_pattern'] : SKIP customer_type = @@ -105,7 +96,6 @@ def self.from_hash(hash) # Create object from extracted values. PaypalWalletVaultInstruction.new(usage_type: usage_type, - store_in_vault: store_in_vault, description: description, usage_pattern: usage_pattern, customer_type: customer_type, @@ -115,18 +105,18 @@ def self.from_hash(hash) # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last - "<#{class_name} store_in_vault: #{@store_in_vault}, description: #{@description},"\ - " usage_pattern: #{@usage_pattern}, usage_type: #{@usage_type}, customer_type:"\ - " #{@customer_type}, permit_multiple_payment_tokens: #{@permit_multiple_payment_tokens}>" + "<#{class_name} description: #{@description}, usage_pattern: #{@usage_pattern}, usage_type:"\ + " #{@usage_type}, customer_type: #{@customer_type}, permit_multiple_payment_tokens:"\ + " #{@permit_multiple_payment_tokens}>" end # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last - "<#{class_name} store_in_vault: #{@store_in_vault.inspect}, description:"\ - " #{@description.inspect}, usage_pattern: #{@usage_pattern.inspect}, usage_type:"\ - " #{@usage_type.inspect}, customer_type: #{@customer_type.inspect},"\ - " permit_multiple_payment_tokens: #{@permit_multiple_payment_tokens.inspect}>" + "<#{class_name} description: #{@description.inspect}, usage_pattern:"\ + " #{@usage_pattern.inspect}, usage_type: #{@usage_type.inspect}, customer_type:"\ + " #{@customer_type.inspect}, permit_multiple_payment_tokens:"\ + " #{@permit_multiple_payment_tokens.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb b/lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb index 14ba3ea..8e82a17 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details about a saved PayPal Wallet payment source. diff --git a/lib/paypal_server_sdk/models/paypal_wallet_vault_status.rb b/lib/paypal_server_sdk/models/paypal_wallet_vault_status.rb index 414b8aa..460b4f7 100644 --- a/lib/paypal_server_sdk/models/paypal_wallet_vault_status.rb +++ b/lib/paypal_server_sdk/models/paypal_wallet_vault_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The vault status. diff --git a/lib/paypal_server_sdk/models/phone.rb b/lib/paypal_server_sdk/models/phone.rb index 8a6c018..665d715 100644 --- a/lib/paypal_server_sdk/models/phone.rb +++ b/lib/paypal_server_sdk/models/phone.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The phone number, in its canonical international [E.164 numbering plan diff --git a/lib/paypal_server_sdk/models/phone_number.rb b/lib/paypal_server_sdk/models/phone_number.rb index cbc849f..b315557 100644 --- a/lib/paypal_server_sdk/models/phone_number.rb +++ b/lib/paypal_server_sdk/models/phone_number.rb @@ -1,10 +1,12 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The phone number in its canonical international [E.164 numbering plan + # format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its + # canonical international [E.164 numbering plan # format](https://www.itu.int/rec/T-REC-E.164/en). class PhoneNumber < BaseModel SKIP = Object.new diff --git a/lib/paypal_server_sdk/models/phone_number_with_country_code.rb b/lib/paypal_server_sdk/models/phone_number_with_country_code.rb index 2baa0e7..bb67f37 100644 --- a/lib/paypal_server_sdk/models/phone_number_with_country_code.rb +++ b/lib/paypal_server_sdk/models/phone_number_with_country_code.rb @@ -1,12 +1,14 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The phone number in its canonical international [E.164 numbering plan # format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its # canonical international [E.164 numbering plan + # format](https://www.itu.int/rec/T-REC-E.164/en)., The phone number, in its + # canonical international [E.164 numbering plan # format](https://www.itu.int/rec/T-REC-E.164/en). class PhoneNumberWithCountryCode < BaseModel SKIP = Object.new diff --git a/lib/paypal_server_sdk/models/phone_number_with_optional_country_code.rb b/lib/paypal_server_sdk/models/phone_number_with_optional_country_code.rb new file mode 100644 index 0000000..4d106e4 --- /dev/null +++ b/lib/paypal_server_sdk/models/phone_number_with_optional_country_code.rb @@ -0,0 +1,81 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The phone number in its canonical international [E.164 numbering plan + # format](https://www.itu.int/rec/T-REC-E.164/en). + class PhoneNumberWithOptionalCountryCode < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The country calling code (CC), in its canonical international [E.164 + # numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The + # combined length of the CC and the national number must not be greater than + # 15 digits. The national number consists of a national destination code + # (NDC) and subscriber number (SN). + # @return [String] + attr_accessor :country_code + + # The national number, in its canonical international [E.164 numbering plan + # format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of + # the country calling code (CC) and the national number must not be greater + # than 15 digits. The national number consists of a national destination + # code (NDC) and subscriber number (SN). + # @return [String] + attr_accessor :national_number + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['country_code'] = 'country_code' + @_hash['national_number'] = 'national_number' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + country_code + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(national_number:, country_code: SKIP) + @country_code = country_code unless country_code == SKIP + @national_number = national_number + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + national_number = + hash.key?('national_number') ? hash['national_number'] : nil + country_code = hash.key?('country_code') ? hash['country_code'] : SKIP + + # Create object from extracted values. + PhoneNumberWithOptionalCountryCode.new(national_number: national_number, + country_code: country_code) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} country_code: #{@country_code}, national_number: #{@national_number}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} country_code: #{@country_code.inspect}, national_number:"\ + " #{@national_number.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/phone_type.rb b/lib/paypal_server_sdk/models/phone_type.rb index 9601e03..96312c9 100644 --- a/lib/paypal_server_sdk/models/phone_type.rb +++ b/lib/paypal_server_sdk/models/phone_type.rb @@ -1,25 +1,25 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The phone type. class PhoneType PHONE_TYPE = [ - # TODO: Write general description for FAX + # Fax number. FAX = 'FAX'.freeze, - # TODO: Write general description for HOME + # Home phone number. HOME = 'HOME'.freeze, - # TODO: Write general description for MOBILE + # Mobile phone number. MOBILE = 'MOBILE'.freeze, - # TODO: Write general description for OTHER + # Other phone number. OTHER = 'OTHER'.freeze, - # TODO: Write general description for PAGER + # Pager number. PAGER = 'PAGER'.freeze ].freeze diff --git a/lib/paypal_server_sdk/models/phone_with_type.rb b/lib/paypal_server_sdk/models/phone_with_type.rb index e386020..6513cea 100644 --- a/lib/paypal_server_sdk/models/phone_with_type.rb +++ b/lib/paypal_server_sdk/models/phone_with_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The phone information. diff --git a/lib/paypal_server_sdk/models/plan.rb b/lib/paypal_server_sdk/models/plan.rb index 7294257..8c71cfe 100644 --- a/lib/paypal_server_sdk/models/plan.rb +++ b/lib/paypal_server_sdk/models/plan.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The merchant level Recurring Billing plan metadata for the Billing @@ -15,10 +15,6 @@ class Plan < BaseModel # @return [Array[BillingCycle]] attr_accessor :billing_cycles - # Product details associated with any one-time product purchase. - # @return [Object] - attr_accessor :product - # The one-time charge info at the time of checkout. # @return [OneTimeCharge] attr_accessor :one_time_charges @@ -31,7 +27,6 @@ class Plan < BaseModel def self.names @_hash = {} if @_hash.nil? @_hash['billing_cycles'] = 'billing_cycles' - @_hash['product'] = 'product' @_hash['one_time_charges'] = 'one_time_charges' @_hash['name'] = 'name' @_hash @@ -40,7 +35,6 @@ def self.names # An array for optional fields def self.optionals %w[ - product name ] end @@ -50,10 +44,8 @@ def self.nullables [] end - def initialize(billing_cycles:, one_time_charges:, product: SKIP, - name: SKIP) + def initialize(billing_cycles:, one_time_charges:, name: SKIP) @billing_cycles = billing_cycles - @product = product unless product == SKIP @one_time_charges = one_time_charges @name = name unless name == SKIP end @@ -75,28 +67,26 @@ def self.from_hash(hash) billing_cycles = nil unless hash.key?('billing_cycles') one_time_charges = OneTimeCharge.from_hash(hash['one_time_charges']) if hash['one_time_charges'] - product = hash.key?('product') ? hash['product'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP # Create object from extracted values. Plan.new(billing_cycles: billing_cycles, one_time_charges: one_time_charges, - product: product, name: name) end # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last - "<#{class_name} billing_cycles: #{@billing_cycles}, product: #{@product}, one_time_charges:"\ - " #{@one_time_charges}, name: #{@name}>" + "<#{class_name} billing_cycles: #{@billing_cycles}, one_time_charges: #{@one_time_charges},"\ + " name: #{@name}>" end # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last - "<#{class_name} billing_cycles: #{@billing_cycles.inspect}, product: #{@product.inspect},"\ - " one_time_charges: #{@one_time_charges.inspect}, name: #{@name.inspect}>" + "<#{class_name} billing_cycles: #{@billing_cycles.inspect}, one_time_charges:"\ + " #{@one_time_charges.inspect}, name: #{@name.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/plan_collection.rb b/lib/paypal_server_sdk/models/plan_collection.rb new file mode 100644 index 0000000..99935b0 --- /dev/null +++ b/lib/paypal_server_sdk/models/plan_collection.rb @@ -0,0 +1,111 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The list of plans with details. + class PlanCollection < BaseModel + SKIP = Object.new + private_constant :SKIP + + # An array of plans. + # @return [Array[BillingPlan]] + attr_accessor :plans + + # The total number of items. + # @return [Integer] + attr_accessor :total_items + + # The total number of pages. + # @return [Integer] + attr_accessor :total_pages + + # An array of request-related [HATEOAS + # links](/docs/api/reference/api-responses/#hateoas-links). + # @return [Array[LinkDescription]] + attr_accessor :links + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['plans'] = 'plans' + @_hash['total_items'] = 'total_items' + @_hash['total_pages'] = 'total_pages' + @_hash['links'] = 'links' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + plans + total_items + total_pages + links + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(plans: SKIP, total_items: SKIP, total_pages: SKIP, + links: SKIP) + @plans = plans unless plans == SKIP + @total_items = total_items unless total_items == SKIP + @total_pages = total_pages unless total_pages == SKIP + @links = links unless links == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + plans = nil + unless hash['plans'].nil? + plans = [] + hash['plans'].each do |structure| + plans << (BillingPlan.from_hash(structure) if structure) + end + end + + plans = SKIP unless hash.key?('plans') + total_items = hash.key?('total_items') ? hash['total_items'] : SKIP + total_pages = hash.key?('total_pages') ? hash['total_pages'] : SKIP + # Parameter is an array, so we need to iterate through it + links = nil + unless hash['links'].nil? + links = [] + hash['links'].each do |structure| + links << (LinkDescription.from_hash(structure) if structure) + end + end + + links = SKIP unless hash.key?('links') + + # Create object from extracted values. + PlanCollection.new(plans: plans, + total_items: total_items, + total_pages: total_pages, + links: links) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} plans: #{@plans}, total_items: #{@total_items}, total_pages:"\ + " #{@total_pages}, links: #{@links}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} plans: #{@plans.inspect}, total_items: #{@total_items.inspect},"\ + " total_pages: #{@total_pages.inspect}, links: #{@links.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/plan_details.rb b/lib/paypal_server_sdk/models/plan_details.rb new file mode 100644 index 0000000..931e913 --- /dev/null +++ b/lib/paypal_server_sdk/models/plan_details.rb @@ -0,0 +1,147 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The plan details. + class PlanDetails < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The ID for the product. + # @return [String] + attr_accessor :product_id + + # The plan name. + # @return [String] + attr_accessor :name + + # The detailed description of the plan. + # @return [String] + attr_accessor :description + + # An array of billing cycles for trial billing and regular billing. A plan + # can have at most two trial cycles and only one regular cycle. + # @return [Array[SubscriptionBillingCycle]] + attr_accessor :billing_cycles + + # The payment preferences for a subscription. + # @return [PaymentPreferences] + attr_accessor :payment_preferences + + # The merchant preferences for a subscription. + # @return [MerchantPreferences] + attr_accessor :merchant_preferences + + # The tax details. + # @return [Taxes] + attr_accessor :taxes + + # Indicates whether you can subscribe to this plan by providing a quantity + # for the goods or service. + # @return [TrueClass | FalseClass] + attr_accessor :quantity_supported + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['product_id'] = 'product_id' + @_hash['name'] = 'name' + @_hash['description'] = 'description' + @_hash['billing_cycles'] = 'billing_cycles' + @_hash['payment_preferences'] = 'payment_preferences' + @_hash['merchant_preferences'] = 'merchant_preferences' + @_hash['taxes'] = 'taxes' + @_hash['quantity_supported'] = 'quantity_supported' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + product_id + name + description + billing_cycles + payment_preferences + merchant_preferences + taxes + quantity_supported + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(product_id: SKIP, name: SKIP, description: SKIP, + billing_cycles: SKIP, payment_preferences: SKIP, + merchant_preferences: SKIP, taxes: SKIP, + quantity_supported: false) + @product_id = product_id unless product_id == SKIP + @name = name unless name == SKIP + @description = description unless description == SKIP + @billing_cycles = billing_cycles unless billing_cycles == SKIP + @payment_preferences = payment_preferences unless payment_preferences == SKIP + @merchant_preferences = merchant_preferences unless merchant_preferences == SKIP + @taxes = taxes unless taxes == SKIP + @quantity_supported = quantity_supported unless quantity_supported == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + product_id = hash.key?('product_id') ? hash['product_id'] : SKIP + name = hash.key?('name') ? hash['name'] : SKIP + description = hash.key?('description') ? hash['description'] : SKIP + # Parameter is an array, so we need to iterate through it + billing_cycles = nil + unless hash['billing_cycles'].nil? + billing_cycles = [] + hash['billing_cycles'].each do |structure| + billing_cycles << (SubscriptionBillingCycle.from_hash(structure) if structure) + end + end + + billing_cycles = SKIP unless hash.key?('billing_cycles') + payment_preferences = PaymentPreferences.from_hash(hash['payment_preferences']) if + hash['payment_preferences'] + merchant_preferences = MerchantPreferences.from_hash(hash['merchant_preferences']) if + hash['merchant_preferences'] + taxes = Taxes.from_hash(hash['taxes']) if hash['taxes'] + quantity_supported = hash['quantity_supported'] ||= false + + # Create object from extracted values. + PlanDetails.new(product_id: product_id, + name: name, + description: description, + billing_cycles: billing_cycles, + payment_preferences: payment_preferences, + merchant_preferences: merchant_preferences, + taxes: taxes, + quantity_supported: quantity_supported) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} product_id: #{@product_id}, name: #{@name}, description: #{@description},"\ + " billing_cycles: #{@billing_cycles}, payment_preferences: #{@payment_preferences},"\ + " merchant_preferences: #{@merchant_preferences}, taxes: #{@taxes}, quantity_supported:"\ + " #{@quantity_supported}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} product_id: #{@product_id.inspect}, name: #{@name.inspect}, description:"\ + " #{@description.inspect}, billing_cycles: #{@billing_cycles.inspect}, payment_preferences:"\ + " #{@payment_preferences.inspect}, merchant_preferences: #{@merchant_preferences.inspect},"\ + " taxes: #{@taxes.inspect}, quantity_supported: #{@quantity_supported.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/plan_override.rb b/lib/paypal_server_sdk/models/plan_override.rb new file mode 100644 index 0000000..8ace4bc --- /dev/null +++ b/lib/paypal_server_sdk/models/plan_override.rb @@ -0,0 +1,96 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # An inline plan object to customise the subscription. You can override plan + # level default attributes by providing customised values for the subscription + # in this object. + class PlanOverride < BaseModel + SKIP = Object.new + private_constant :SKIP + + # An array of billing cycles for trial billing and regular billing. The + # subscription billing cycle definition has to adhere to the plan billing + # cycle definition. + # @return [Array[BillingCycleOverride]] + attr_accessor :billing_cycles + + # The payment preferences to override at subscription level. + # @return [PaymentPreferencesOverride] + attr_accessor :payment_preferences + + # The tax details. + # @return [TaxesOverride] + attr_accessor :taxes + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['billing_cycles'] = 'billing_cycles' + @_hash['payment_preferences'] = 'payment_preferences' + @_hash['taxes'] = 'taxes' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + billing_cycles + payment_preferences + taxes + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(billing_cycles: SKIP, payment_preferences: SKIP, taxes: SKIP) + @billing_cycles = billing_cycles unless billing_cycles == SKIP + @payment_preferences = payment_preferences unless payment_preferences == SKIP + @taxes = taxes unless taxes == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + billing_cycles = nil + unless hash['billing_cycles'].nil? + billing_cycles = [] + hash['billing_cycles'].each do |structure| + billing_cycles << (BillingCycleOverride.from_hash(structure) if structure) + end + end + + billing_cycles = SKIP unless hash.key?('billing_cycles') + payment_preferences = PaymentPreferencesOverride.from_hash(hash['payment_preferences']) if + hash['payment_preferences'] + taxes = TaxesOverride.from_hash(hash['taxes']) if hash['taxes'] + + # Create object from extracted values. + PlanOverride.new(billing_cycles: billing_cycles, + payment_preferences: payment_preferences, + taxes: taxes) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} billing_cycles: #{@billing_cycles}, payment_preferences:"\ + " #{@payment_preferences}, taxes: #{@taxes}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} billing_cycles: #{@billing_cycles.inspect}, payment_preferences:"\ + " #{@payment_preferences.inspect}, taxes: #{@taxes.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/plan_request.rb b/lib/paypal_server_sdk/models/plan_request.rb new file mode 100644 index 0000000..6d1a316 --- /dev/null +++ b/lib/paypal_server_sdk/models/plan_request.rb @@ -0,0 +1,154 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The create plan request details. + class PlanRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The ID of the product created through Catalog Products API. + # @return [String] + attr_accessor :product_id + + # The plan name. + # @return [String] + attr_accessor :name + + # The initial state of the plan. Allowed input values are CREATED and + # ACTIVE. + # @return [PlanRequestStatus] + attr_accessor :status + + # The detailed description of the plan. + # @return [String] + attr_accessor :description + + # An array of billing cycles for trial billing and regular billing. A plan + # can have at most two trial cycles and only one regular cycle. + # @return [Array[SubscriptionBillingCycle]] + attr_accessor :billing_cycles + + # The payment preferences for a subscription. + # @return [PaymentPreferences] + attr_accessor :payment_preferences + + # The merchant preferences for a subscription. + # @return [MerchantPreferences] + attr_accessor :merchant_preferences + + # The tax details. + # @return [Taxes] + attr_accessor :taxes + + # Indicates whether you can subscribe to this plan by providing a quantity + # for the goods or service. + # @return [TrueClass | FalseClass] + attr_accessor :quantity_supported + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['product_id'] = 'product_id' + @_hash['name'] = 'name' + @_hash['status'] = 'status' + @_hash['description'] = 'description' + @_hash['billing_cycles'] = 'billing_cycles' + @_hash['payment_preferences'] = 'payment_preferences' + @_hash['merchant_preferences'] = 'merchant_preferences' + @_hash['taxes'] = 'taxes' + @_hash['quantity_supported'] = 'quantity_supported' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + status + description + merchant_preferences + taxes + quantity_supported + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(product_id:, name:, billing_cycles:, payment_preferences:, + status: PlanRequestStatus::ACTIVE, description: SKIP, + merchant_preferences: SKIP, taxes: SKIP, + quantity_supported: false) + @product_id = product_id + @name = name + @status = status unless status == SKIP + @description = description unless description == SKIP + @billing_cycles = billing_cycles + @payment_preferences = payment_preferences + @merchant_preferences = merchant_preferences unless merchant_preferences == SKIP + @taxes = taxes unless taxes == SKIP + @quantity_supported = quantity_supported unless quantity_supported == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + product_id = hash.key?('product_id') ? hash['product_id'] : nil + name = hash.key?('name') ? hash['name'] : nil + # Parameter is an array, so we need to iterate through it + billing_cycles = nil + unless hash['billing_cycles'].nil? + billing_cycles = [] + hash['billing_cycles'].each do |structure| + billing_cycles << (SubscriptionBillingCycle.from_hash(structure) if structure) + end + end + + billing_cycles = nil unless hash.key?('billing_cycles') + payment_preferences = PaymentPreferences.from_hash(hash['payment_preferences']) if + hash['payment_preferences'] + status = hash['status'] ||= PlanRequestStatus::ACTIVE + description = hash.key?('description') ? hash['description'] : SKIP + merchant_preferences = MerchantPreferences.from_hash(hash['merchant_preferences']) if + hash['merchant_preferences'] + taxes = Taxes.from_hash(hash['taxes']) if hash['taxes'] + quantity_supported = hash['quantity_supported'] ||= false + + # Create object from extracted values. + PlanRequest.new(product_id: product_id, + name: name, + billing_cycles: billing_cycles, + payment_preferences: payment_preferences, + status: status, + description: description, + merchant_preferences: merchant_preferences, + taxes: taxes, + quantity_supported: quantity_supported) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} product_id: #{@product_id}, name: #{@name}, status: #{@status},"\ + " description: #{@description}, billing_cycles: #{@billing_cycles}, payment_preferences:"\ + " #{@payment_preferences}, merchant_preferences: #{@merchant_preferences}, taxes: #{@taxes},"\ + " quantity_supported: #{@quantity_supported}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} product_id: #{@product_id.inspect}, name: #{@name.inspect}, status:"\ + " #{@status.inspect}, description: #{@description.inspect}, billing_cycles:"\ + " #{@billing_cycles.inspect}, payment_preferences: #{@payment_preferences.inspect},"\ + " merchant_preferences: #{@merchant_preferences.inspect}, taxes: #{@taxes.inspect},"\ + " quantity_supported: #{@quantity_supported.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/plan_request_status.rb b/lib/paypal_server_sdk/models/plan_request_status.rb new file mode 100644 index 0000000..de7ac80 --- /dev/null +++ b/lib/paypal_server_sdk/models/plan_request_status.rb @@ -0,0 +1,28 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The initial state of the plan. Allowed input values are CREATED and ACTIVE. + class PlanRequestStatus + PLAN_REQUEST_STATUS = [ + # The plan was created. You cannot create subscriptions for a plan in this + # state. + CREATED = 'CREATED'.freeze, + + # The plan is inactive. + INACTIVE = 'INACTIVE'.freeze, + + # The plan is active. You can only create subscriptions for a plan in this + # state. + ACTIVE = 'ACTIVE'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/platform_fee.rb b/lib/paypal_server_sdk/models/platform_fee.rb index da1dcb0..c02ce38 100644 --- a/lib/paypal_server_sdk/models/platform_fee.rb +++ b/lib/paypal_server_sdk/models/platform_fee.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The platform or partner fee, commission, or brokerage fee that is associated diff --git a/lib/paypal_server_sdk/models/pricing_model.rb b/lib/paypal_server_sdk/models/pricing_model.rb index e31281c..f7f76f5 100644 --- a/lib/paypal_server_sdk/models/pricing_model.rb +++ b/lib/paypal_server_sdk/models/pricing_model.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The pricing model for the billing cycle. diff --git a/lib/paypal_server_sdk/models/pricing_scheme.rb b/lib/paypal_server_sdk/models/pricing_scheme.rb index c017716..48daf2d 100644 --- a/lib/paypal_server_sdk/models/pricing_scheme.rb +++ b/lib/paypal_server_sdk/models/pricing_scheme.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The pricing scheme details. diff --git a/lib/paypal_server_sdk/models/pricing_tier.rb b/lib/paypal_server_sdk/models/pricing_tier.rb new file mode 100644 index 0000000..14f9354 --- /dev/null +++ b/lib/paypal_server_sdk/models/pricing_tier.rb @@ -0,0 +1,83 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The pricing tier details. + class PricingTier < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The starting quantity for the tier. + # @return [String] + attr_accessor :starting_quantity + + # The ending quantity for the tier. Optional for the last tier. + # @return [String] + attr_accessor :ending_quantity + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :amount + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['starting_quantity'] = 'starting_quantity' + @_hash['ending_quantity'] = 'ending_quantity' + @_hash['amount'] = 'amount' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + ending_quantity + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(starting_quantity:, amount:, ending_quantity: SKIP) + @starting_quantity = starting_quantity + @ending_quantity = ending_quantity unless ending_quantity == SKIP + @amount = amount + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + starting_quantity = + hash.key?('starting_quantity') ? hash['starting_quantity'] : nil + amount = Money.from_hash(hash['amount']) if hash['amount'] + ending_quantity = + hash.key?('ending_quantity') ? hash['ending_quantity'] : SKIP + + # Create object from extracted values. + PricingTier.new(starting_quantity: starting_quantity, + amount: amount, + ending_quantity: ending_quantity) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} starting_quantity: #{@starting_quantity}, ending_quantity:"\ + " #{@ending_quantity}, amount: #{@amount}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} starting_quantity: #{@starting_quantity.inspect}, ending_quantity:"\ + " #{@ending_quantity.inspect}, amount: #{@amount.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/processor_response.rb b/lib/paypal_server_sdk/models/processor_response.rb index 6ce8bf5..3aac597 100644 --- a/lib/paypal_server_sdk/models/processor_response.rb +++ b/lib/paypal_server_sdk/models/processor_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The processor response information for payment requests, such as direct diff --git a/lib/paypal_server_sdk/models/processor_response_code.rb b/lib/paypal_server_sdk/models/processor_response_code.rb index 6542fbd..ab367a9 100644 --- a/lib/paypal_server_sdk/models/processor_response_code.rb +++ b/lib/paypal_server_sdk/models/processor_response_code.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Processor response code for the non-PayPal payment processor errors. diff --git a/lib/paypal_server_sdk/models/purchase_unit.rb b/lib/paypal_server_sdk/models/purchase_unit.rb index bb54055..d2720b0 100644 --- a/lib/paypal_server_sdk/models/purchase_unit.rb +++ b/lib/paypal_server_sdk/models/purchase_unit.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The purchase unit details. Used to capture required information for the diff --git a/lib/paypal_server_sdk/models/purchase_unit_request.rb b/lib/paypal_server_sdk/models/purchase_unit_request.rb index 9bba4ce..40301e3 100644 --- a/lib/paypal_server_sdk/models/purchase_unit_request.rb +++ b/lib/paypal_server_sdk/models/purchase_unit_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The purchase unit request. Includes required information for the payment @@ -38,11 +38,14 @@ class PurchaseUnitRequest < BaseModel # @return [PaymentInstruction] attr_accessor :payment_instruction - # The purchase description. The maximum length of the character is dependent - # on the type of characters used. The character length is specified assuming - # a US ASCII character. Depending on type of character; (e.g. accented - # character, Japanese characters) the number of characters that that can be - # specified as input might not equal the permissible max length. + # This field supports up to 3,000 characters, but any content beyond 127 + # characters (including spaces) will be truncated. The 127 character limit + # is reflected in the response representation of this field. The purchase + # description. The maximum length of the character is dependent on the type + # of characters used. The character length is specified assuming a US ASCII + # character. Depending on type of character; (e.g. accented character, + # Japanese characters) the number of characters that that can be specified + # as input might not equal the permissible max length. # @return [String] attr_accessor :description @@ -54,14 +57,21 @@ class PurchaseUnitRequest < BaseModel # The API caller-provided external invoice number for this order. Appears in # both the payer's transaction history and the emails that the payer - # receives. + # receives. invoice_id values are required to be unique within each merchant + # account by default. Although the uniqueness validation is configurable, + # disabling this behavior will remove the account's ability to use + # invoice_id in other APIs as an identifier. It is highly recommended to + # keep a unique invoice_id for each Order. # @return [String] attr_accessor :invoice_id - # The soft descriptor is the dynamic text used to construct the statement - # descriptor that appears on a payer's card statement. If an Order is paid - # using the "PayPal Wallet", the statement descriptor will appear in - # following format on the payer's card statement: + # This field supports up to 127 characters, but any content beyond 22 + # characters (including spaces) will be truncated. The 22 character limit is + # reflected in the response representation of this field. The soft + # descriptor is the dynamic text used to construct the statement descriptor + # that appears on a payer's card statement. If an Order is paid using the + # "PayPal Wallet", the statement descriptor will appear in following format + # on the payer's card statement: # PAYPAL_prefix+(space)+merchant_descriptor+(space)+ soft_descriptor Note: # The merchant descriptor is the descriptor of the merchant’s payment # receiving preferences which can be seen by logging into the merchant @@ -75,7 +85,7 @@ class PurchaseUnitRequest < BaseModel attr_accessor :soft_descriptor # An array of items that the customer purchases from the merchant. - # @return [Array[Item]] + # @return [Array[ItemRequest]] attr_accessor :items # The shipping details. @@ -163,7 +173,7 @@ def self.from_hash(hash) unless hash['items'].nil? items = [] hash['items'].each do |structure| - items << (Item.from_hash(structure) if structure) + items << (ItemRequest.from_hash(structure) if structure) end end diff --git a/lib/paypal_server_sdk/models/reason_code.rb b/lib/paypal_server_sdk/models/reason_code.rb new file mode 100644 index 0000000..0ad1b68 --- /dev/null +++ b/lib/paypal_server_sdk/models/reason_code.rb @@ -0,0 +1,41 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The reason code for the payment failure. + class ReasonCode + REASON_CODE = [ + # PayPal declined the payment due to one or more customer issues. + PAYMENT_DENIED = 'PAYMENT_DENIED'.freeze, + + # An internal server error has occurred. + INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR'.freeze, + + # The payee account is not in good standing and cannot receive payments. + PAYEE_ACCOUNT_RESTRICTED = 'PAYEE_ACCOUNT_RESTRICTED'.freeze, + + # The payer account is not in good standing and cannot make payments. + PAYER_ACCOUNT_RESTRICTED = 'PAYER_ACCOUNT_RESTRICTED'.freeze, + + # Payer cannot pay for this transaction. + PAYER_CANNOT_PAY = 'PAYER_CANNOT_PAY'.freeze, + + # The transaction exceeds the payer's sending limit. + SENDING_LIMIT_EXCEEDED = 'SENDING_LIMIT_EXCEEDED'.freeze, + + # The transaction exceeds the receiver's receiving limit. + TRANSACTION_RECEIVING_LIMIT_EXCEEDED = 'TRANSACTION_RECEIVING_LIMIT_EXCEEDED'.freeze, + + # The transaction is declined due to a currency mismatch. + CURRENCY_MISMATCH = 'CURRENCY_MISMATCH'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/reauthorize_request.rb b/lib/paypal_server_sdk/models/reauthorize_request.rb index d261d1d..4684aec 100644 --- a/lib/paypal_server_sdk/models/reauthorize_request.rb +++ b/lib/paypal_server_sdk/models/reauthorize_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Reauthorizes an authorized PayPal account payment, by ID. To ensure that @@ -14,7 +14,6 @@ module PaypalServerSdk # payment once. The allowed amount depends on context and geography, for # example in US it is up to 115% of the original authorized amount, not to # exceed an increase of $75 USD. Supports only the `amount` request parameter. - # Note: This request is currently not supported for Partner use cases. class ReauthorizeRequest < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/paypal_server_sdk/models/refund.rb b/lib/paypal_server_sdk/models/refund.rb index dfcba5f..3e1f06d 100644 --- a/lib/paypal_server_sdk/models/refund.rb +++ b/lib/paypal_server_sdk/models/refund.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The refund information. diff --git a/lib/paypal_server_sdk/models/refund_incomplete_reason.rb b/lib/paypal_server_sdk/models/refund_incomplete_reason.rb index 04ebd06..c2a4685 100644 --- a/lib/paypal_server_sdk/models/refund_incomplete_reason.rb +++ b/lib/paypal_server_sdk/models/refund_incomplete_reason.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The reason why the refund has the `PENDING` or `FAILED` status. diff --git a/lib/paypal_server_sdk/models/refund_payment_instruction.rb b/lib/paypal_server_sdk/models/refund_payment_instruction.rb index c26a766..ba9552a 100644 --- a/lib/paypal_server_sdk/models/refund_payment_instruction.rb +++ b/lib/paypal_server_sdk/models/refund_payment_instruction.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Any additional payments instructions during refund payment processing. This diff --git a/lib/paypal_server_sdk/models/refund_platform_fee.rb b/lib/paypal_server_sdk/models/refund_platform_fee.rb index 4de11ad..139e13d 100644 --- a/lib/paypal_server_sdk/models/refund_platform_fee.rb +++ b/lib/paypal_server_sdk/models/refund_platform_fee.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The platform or partner fee, commission, or brokerage fee that is associated diff --git a/lib/paypal_server_sdk/models/refund_request.rb b/lib/paypal_server_sdk/models/refund_request.rb index 1f7f2f1..1503853 100644 --- a/lib/paypal_server_sdk/models/refund_request.rb +++ b/lib/paypal_server_sdk/models/refund_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Refunds a captured payment, by ID. For a full refund, include an empty diff --git a/lib/paypal_server_sdk/models/refund_status.rb b/lib/paypal_server_sdk/models/refund_status.rb index 506af13..f5d923a 100644 --- a/lib/paypal_server_sdk/models/refund_status.rb +++ b/lib/paypal_server_sdk/models/refund_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The status of the refund. diff --git a/lib/paypal_server_sdk/models/refund_status_details.rb b/lib/paypal_server_sdk/models/refund_status_details.rb index 8fb9926..682712a 100644 --- a/lib/paypal_server_sdk/models/refund_status_details.rb +++ b/lib/paypal_server_sdk/models/refund_status_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details of the refund status. diff --git a/lib/paypal_server_sdk/models/refund_status_with_details.rb b/lib/paypal_server_sdk/models/refund_status_with_details.rb index 62352d6..23aab10 100644 --- a/lib/paypal_server_sdk/models/refund_status_with_details.rb +++ b/lib/paypal_server_sdk/models/refund_status_with_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The refund status with details. diff --git a/lib/paypal_server_sdk/models/related_identifiers.rb b/lib/paypal_server_sdk/models/related_identifiers.rb index 4a7740f..a07b88c 100644 --- a/lib/paypal_server_sdk/models/related_identifiers.rb +++ b/lib/paypal_server_sdk/models/related_identifiers.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Identifiers related to a specific resource. diff --git a/lib/paypal_server_sdk/models/return_flow.rb b/lib/paypal_server_sdk/models/return_flow.rb new file mode 100644 index 0000000..e31b257 --- /dev/null +++ b/lib/paypal_server_sdk/models/return_flow.rb @@ -0,0 +1,28 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # Merchant preference on how the buyer can navigate back to merchant website + # post approving the transaction on the Venmo App. + class ReturnFlow + RETURN_FLOW = [ + # After payment approval in the PayPal App, buyer will automatically be + # redirected to the merchant website. + AUTO = 'AUTO'.freeze, + + # After payment approval in the PayPal App, buyer will be asked to + # manually navigate back to the merchant website where they started the + # transaction from. The buyer is shown a message like 'Return to Merchant' + # to return to the source where the transaction actually started. + MANUAL = 'MANUAL'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/risk_supplementary_data.rb b/lib/paypal_server_sdk/models/risk_supplementary_data.rb index 8bf29e3..6b564fc 100644 --- a/lib/paypal_server_sdk/models/risk_supplementary_data.rb +++ b/lib/paypal_server_sdk/models/risk_supplementary_data.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Additional information necessary to evaluate the risk profile of a diff --git a/lib/paypal_server_sdk/models/search_response.rb b/lib/paypal_server_sdk/models/search_response.rb new file mode 100644 index 0000000..32b500b --- /dev/null +++ b/lib/paypal_server_sdk/models/search_response.rb @@ -0,0 +1,176 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The search response information. + class SearchResponse < BaseModel + SKIP = Object.new + private_constant :SKIP + + # An array of transaction detail objects. + # @return [Array[TransactionDetails]] + attr_accessor :transaction_details + + # The merchant account number. + # @return [String] + attr_accessor :account_number + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :start_date + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :end_date + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :last_refreshed_datetime + + # A zero-relative index of transactions. + # @return [Integer] + attr_accessor :page + + # The total number of transactions as an integer beginning with the + # specified `page` in the full result and not just in this response. + # @return [Integer] + attr_accessor :total_items + + # The total number of pages, as an `integer`, when the `total_items` is + # divided into pages of the specified `page_size`. + # @return [Integer] + attr_accessor :total_pages + + # An array of request-related [HATEOAS + # links](/api/rest/responses/#hateoas-links). + # @return [Array[LinkDescription]] + attr_accessor :links + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['transaction_details'] = 'transaction_details' + @_hash['account_number'] = 'account_number' + @_hash['start_date'] = 'start_date' + @_hash['end_date'] = 'end_date' + @_hash['last_refreshed_datetime'] = 'last_refreshed_datetime' + @_hash['page'] = 'page' + @_hash['total_items'] = 'total_items' + @_hash['total_pages'] = 'total_pages' + @_hash['links'] = 'links' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + transaction_details + account_number + start_date + end_date + last_refreshed_datetime + page + total_items + total_pages + links + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(transaction_details: SKIP, account_number: SKIP, + start_date: SKIP, end_date: SKIP, + last_refreshed_datetime: SKIP, page: SKIP, total_items: SKIP, + total_pages: SKIP, links: SKIP) + @transaction_details = transaction_details unless transaction_details == SKIP + @account_number = account_number unless account_number == SKIP + @start_date = start_date unless start_date == SKIP + @end_date = end_date unless end_date == SKIP + @last_refreshed_datetime = last_refreshed_datetime unless last_refreshed_datetime == SKIP + @page = page unless page == SKIP + @total_items = total_items unless total_items == SKIP + @total_pages = total_pages unless total_pages == SKIP + @links = links unless links == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + transaction_details = nil + unless hash['transaction_details'].nil? + transaction_details = [] + hash['transaction_details'].each do |structure| + transaction_details << (TransactionDetails.from_hash(structure) if structure) + end + end + + transaction_details = SKIP unless hash.key?('transaction_details') + account_number = + hash.key?('account_number') ? hash['account_number'] : SKIP + start_date = hash.key?('start_date') ? hash['start_date'] : SKIP + end_date = hash.key?('end_date') ? hash['end_date'] : SKIP + last_refreshed_datetime = + hash.key?('last_refreshed_datetime') ? hash['last_refreshed_datetime'] : SKIP + page = hash.key?('page') ? hash['page'] : SKIP + total_items = hash.key?('total_items') ? hash['total_items'] : SKIP + total_pages = hash.key?('total_pages') ? hash['total_pages'] : SKIP + # Parameter is an array, so we need to iterate through it + links = nil + unless hash['links'].nil? + links = [] + hash['links'].each do |structure| + links << (LinkDescription.from_hash(structure) if structure) + end + end + + links = SKIP unless hash.key?('links') + + # Create object from extracted values. + SearchResponse.new(transaction_details: transaction_details, + account_number: account_number, + start_date: start_date, + end_date: end_date, + last_refreshed_datetime: last_refreshed_datetime, + page: page, + total_items: total_items, + total_pages: total_pages, + links: links) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} transaction_details: #{@transaction_details}, account_number:"\ + " #{@account_number}, start_date: #{@start_date}, end_date: #{@end_date},"\ + " last_refreshed_datetime: #{@last_refreshed_datetime}, page: #{@page}, total_items:"\ + " #{@total_items}, total_pages: #{@total_pages}, links: #{@links}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} transaction_details: #{@transaction_details.inspect}, account_number:"\ + " #{@account_number.inspect}, start_date: #{@start_date.inspect}, end_date:"\ + " #{@end_date.inspect}, last_refreshed_datetime: #{@last_refreshed_datetime.inspect}, page:"\ + " #{@page.inspect}, total_items: #{@total_items.inspect}, total_pages:"\ + " #{@total_pages.inspect}, links: #{@links.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/seller_payable_breakdown.rb b/lib/paypal_server_sdk/models/seller_payable_breakdown.rb index dad6fb6..cce3313 100644 --- a/lib/paypal_server_sdk/models/seller_payable_breakdown.rb +++ b/lib/paypal_server_sdk/models/seller_payable_breakdown.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The breakdown of the refund. diff --git a/lib/paypal_server_sdk/models/seller_protection.rb b/lib/paypal_server_sdk/models/seller_protection.rb index 1191658..9984091 100644 --- a/lib/paypal_server_sdk/models/seller_protection.rb +++ b/lib/paypal_server_sdk/models/seller_protection.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The level of protection offered as defined by [PayPal Seller Protection for diff --git a/lib/paypal_server_sdk/models/seller_protection_status.rb b/lib/paypal_server_sdk/models/seller_protection_status.rb index 54690c2..6055a40 100644 --- a/lib/paypal_server_sdk/models/seller_protection_status.rb +++ b/lib/paypal_server_sdk/models/seller_protection_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Indicates whether the transaction is eligible for seller protection. For diff --git a/lib/paypal_server_sdk/models/seller_receivable_breakdown.rb b/lib/paypal_server_sdk/models/seller_receivable_breakdown.rb index fec9d46..9b7e151 100644 --- a/lib/paypal_server_sdk/models/seller_receivable_breakdown.rb +++ b/lib/paypal_server_sdk/models/seller_receivable_breakdown.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The detailed breakdown of the capture activity. This is not available for diff --git a/lib/paypal_server_sdk/models/sepa_debit_experience_context.rb b/lib/paypal_server_sdk/models/sepa_debit_experience_context.rb new file mode 100644 index 0000000..c7a3dfe --- /dev/null +++ b/lib/paypal_server_sdk/models/sepa_debit_experience_context.rb @@ -0,0 +1,88 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # Customizes the payer experience during the approval process for the SEPA + # Debit payment. + class SepaDebitExperienceContext < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the + # language in which to localize the error-related strings, such as messages, + # issues, and suggested actions. The tag is made up of the [ISO 639-2 + # language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), + # the optional [ISO-15924 script + # tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 + # alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region + # code](https://unstats.un.org/unsd/methodology/m49/). + # @return [String] + attr_accessor :locale + + # Describes the URL. + # @return [String] + attr_accessor :return_url + + # Describes the URL. + # @return [String] + attr_accessor :cancel_url + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['locale'] = 'locale' + @_hash['return_url'] = 'return_url' + @_hash['cancel_url'] = 'cancel_url' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + locale + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(return_url:, cancel_url:, locale: SKIP) + @locale = locale unless locale == SKIP + @return_url = return_url + @cancel_url = cancel_url + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + return_url = hash.key?('return_url') ? hash['return_url'] : nil + cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : nil + locale = hash.key?('locale') ? hash['locale'] : SKIP + + # Create object from extracted values. + SepaDebitExperienceContext.new(return_url: return_url, + cancel_url: cancel_url, + locale: locale) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} locale: #{@locale}, return_url: #{@return_url}, cancel_url:"\ + " #{@cancel_url}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} locale: #{@locale.inspect}, return_url: #{@return_url.inspect}, cancel_url:"\ + " #{@cancel_url.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/sepa_debit_request.rb b/lib/paypal_server_sdk/models/sepa_debit_request.rb new file mode 100644 index 0000000..1ea0604 --- /dev/null +++ b/lib/paypal_server_sdk/models/sepa_debit_request.rb @@ -0,0 +1,64 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # An API resource denoting a request to securely store a SEPA Debit. + class SepaDebitRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Customizes the payer experience during the approval process for the SEPA + # Debit payment. + # @return [SepaDebitExperienceContext] + attr_accessor :experience_context + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['experience_context'] = 'experience_context' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + experience_context + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(experience_context: SKIP) + @experience_context = experience_context unless experience_context == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + experience_context = SepaDebitExperienceContext.from_hash(hash['experience_context']) if + hash['experience_context'] + + # Create object from extracted values. + SepaDebitRequest.new(experience_context: experience_context) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} experience_context: #{@experience_context}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} experience_context: #{@experience_context.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/setup_fee_failure_action.rb b/lib/paypal_server_sdk/models/setup_fee_failure_action.rb new file mode 100644 index 0000000..20e02c3 --- /dev/null +++ b/lib/paypal_server_sdk/models/setup_fee_failure_action.rb @@ -0,0 +1,24 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The action to take on the subscription if the initial payment for the setup + # fails. + class SetupFeeFailureAction + SETUP_FEE_FAILURE_ACTION = [ + # Continues the subscription if the initial payment for the setup fails. + CONTINUE = 'CONTINUE'.freeze, + + # Cancels the subscription if the initial payment for the setup fails. + CANCEL = 'CANCEL'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/setup_token_request.rb b/lib/paypal_server_sdk/models/setup_token_request.rb index 5aefca5..8de9c11 100644 --- a/lib/paypal_server_sdk/models/setup_token_request.rb +++ b/lib/paypal_server_sdk/models/setup_token_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Setup Token Request where the `source` defines the type of instrument to be diff --git a/lib/paypal_server_sdk/models/setup_token_request_card.rb b/lib/paypal_server_sdk/models/setup_token_request_card.rb index 7bd57b8..af2a618 100644 --- a/lib/paypal_server_sdk/models/setup_token_request_card.rb +++ b/lib/paypal_server_sdk/models/setup_token_request_card.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # A Resource representing a request to vault a Card. @@ -46,8 +46,8 @@ class SetupTokenRequestCard < BaseModel # @return [VaultCardVerificationMethod] attr_accessor :verification_method - # Customizes the Vault creation flow experience for your customers. - # @return [SetupTokenCardExperienceContext] + # A resource representing an experience context of vault a card. + # @return [VaultCardExperienceContext] attr_accessor :experience_context # A mapping from model property names to API property names. @@ -109,7 +109,7 @@ def self.from_hash(hash) billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address'] verification_method = hash.key?('verification_method') ? hash['verification_method'] : SKIP - experience_context = SetupTokenCardExperienceContext.from_hash(hash['experience_context']) if + experience_context = VaultCardExperienceContext.from_hash(hash['experience_context']) if hash['experience_context'] # Create object from extracted values. diff --git a/lib/paypal_server_sdk/models/setup_token_request_payment_source.rb b/lib/paypal_server_sdk/models/setup_token_request_payment_source.rb index 4f89b1a..5a620cd 100644 --- a/lib/paypal_server_sdk/models/setup_token_request_payment_source.rb +++ b/lib/paypal_server_sdk/models/setup_token_request_payment_source.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The payment method to vault with the instrument details. @@ -17,21 +17,31 @@ class SetupTokenRequestPaymentSource < BaseModel # @return [VaultPaypalWalletRequest] attr_accessor :paypal - # A resource representing a request to vault PayPal Wallet. + # A resource representing a request to vault Venmo. # @return [VaultVenmoRequest] attr_accessor :venmo + # A resource representing a request to vault Apple Pay. + # @return [VaultApplePayRequest] + attr_accessor :apple_pay + # The Tokenized Payment Source representing a Request to Vault a Token. # @return [VaultTokenRequest] attr_accessor :token + # A Resource representing a request to vault a Bank used for ACH Debit. + # @return [BankRequest] + attr_accessor :bank + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @_hash['card'] = 'card' @_hash['paypal'] = 'paypal' @_hash['venmo'] = 'venmo' + @_hash['apple_pay'] = 'apple_pay' @_hash['token'] = 'token' + @_hash['bank'] = 'bank' @_hash end @@ -41,7 +51,9 @@ def self.optionals card paypal venmo + apple_pay token + bank ] end @@ -50,11 +62,14 @@ def self.nullables [] end - def initialize(card: SKIP, paypal: SKIP, venmo: SKIP, token: SKIP) + def initialize(card: SKIP, paypal: SKIP, venmo: SKIP, apple_pay: SKIP, + token: SKIP, bank: SKIP) @card = card unless card == SKIP @paypal = paypal unless paypal == SKIP @venmo = venmo unless venmo == SKIP + @apple_pay = apple_pay unless apple_pay == SKIP @token = token unless token == SKIP + @bank = bank unless bank == SKIP end # Creates an instance of the object from a hash. @@ -65,26 +80,32 @@ def self.from_hash(hash) card = SetupTokenRequestCard.from_hash(hash['card']) if hash['card'] paypal = VaultPaypalWalletRequest.from_hash(hash['paypal']) if hash['paypal'] venmo = VaultVenmoRequest.from_hash(hash['venmo']) if hash['venmo'] + apple_pay = VaultApplePayRequest.from_hash(hash['apple_pay']) if hash['apple_pay'] token = VaultTokenRequest.from_hash(hash['token']) if hash['token'] + bank = BankRequest.from_hash(hash['bank']) if hash['bank'] # Create object from extracted values. SetupTokenRequestPaymentSource.new(card: card, paypal: paypal, venmo: venmo, - token: token) + apple_pay: apple_pay, + token: token, + bank: bank) end # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last - "<#{class_name} card: #{@card}, paypal: #{@paypal}, venmo: #{@venmo}, token: #{@token}>" + "<#{class_name} card: #{@card}, paypal: #{@paypal}, venmo: #{@venmo}, apple_pay:"\ + " #{@apple_pay}, token: #{@token}, bank: #{@bank}>" end # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last "<#{class_name} card: #{@card.inspect}, paypal: #{@paypal.inspect}, venmo:"\ - " #{@venmo.inspect}, token: #{@token.inspect}>" + " #{@venmo.inspect}, apple_pay: #{@apple_pay.inspect}, token: #{@token.inspect}, bank:"\ + " #{@bank.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/setup_token_response.rb b/lib/paypal_server_sdk/models/setup_token_response.rb index 36b723e..b4b3ddc 100644 --- a/lib/paypal_server_sdk/models/setup_token_response.rb +++ b/lib/paypal_server_sdk/models/setup_token_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Minimal representation of a cached setup token. @@ -9,7 +9,9 @@ class SetupTokenResponse < BaseModel SKIP = Object.new private_constant :SKIP - # The PayPal-generated ID for the vault token. + # The PayPal-generated ID for the vaulted payment source. This ID should be + # stored on the merchant's server so the saved payment source can be used + # for future transactions. # @return [String] attr_accessor :id diff --git a/lib/paypal_server_sdk/models/setup_token_response_card.rb b/lib/paypal_server_sdk/models/setup_token_response_card.rb index bf33a0b..937b0ff 100644 --- a/lib/paypal_server_sdk/models/setup_token_response_card.rb +++ b/lib/paypal_server_sdk/models/setup_token_response_card.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # SetupTokenResponseCard Model. diff --git a/lib/paypal_server_sdk/models/setup_token_response_payment_source.rb b/lib/paypal_server_sdk/models/setup_token_response_payment_source.rb index 43bbfe5..914a341 100644 --- a/lib/paypal_server_sdk/models/setup_token_response_payment_source.rb +++ b/lib/paypal_server_sdk/models/setup_token_response_payment_source.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The setup payment method details. @@ -13,11 +13,11 @@ class SetupTokenResponsePaymentSource < BaseModel # @return [SetupTokenResponseCard] attr_accessor :card - # TODO: Write general description for this method + # Full representation of a PayPal Payment Token. # @return [PaypalPaymentToken] attr_accessor :paypal - # TODO: Write general description for this method + # Full representation of a Venmo Payment Token. # @return [VenmoPaymentToken] attr_accessor :venmo diff --git a/lib/paypal_server_sdk/models/shipment_carrier.rb b/lib/paypal_server_sdk/models/shipment_carrier.rb index aa7d1b1..006f274 100644 --- a/lib/paypal_server_sdk/models/shipment_carrier.rb +++ b/lib/paypal_server_sdk/models/shipment_carrier.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The carrier for the shipment. Some carriers have a global version as well as @@ -4139,7 +4139,115 @@ class ShipmentCarrier WINESHIPPING = 'WINESHIPPING'.freeze, # Spedisci online. - SPEDISCI = 'SPEDISCI'.freeze + SPEDISCI = 'SPEDISCI'.freeze, + + # Fourkites. + FOURKITES = 'FOURKITES'.freeze, + + # Etonas. + ETONAS = 'ETONAS'.freeze, + + # Fin Mile. + FINMILE = 'FINMILE'.freeze, + + # Uniuni. + UNIUNI = 'UNIUNI'.freeze, + + # Rodonaves. + RODONAVES = 'RODONAVES'.freeze, + + # Inpost Italy. + INPOST_IT = 'INPOST_IT'.freeze, + + # Tforce Freight. + TFORCE_FREIGHT = 'TFORCE_FREIGHT'.freeze, + + # Rich Mom. + RICHMOM = 'RICHMOM'.freeze, + + # Corriere Franco. + FRANCO = 'FRANCO'.freeze, + + # Ecparcel. + ECPARCEL = 'ECPARCEL'.freeze, + + # Fedex China. + FEDEX_CHINA = 'FEDEX_CHINA'.freeze, + + # Gofo Express. + GOFO_EXPRESS = 'GOFO_EXPRESS'.freeze, + + # Shipbob. + SHIPBOB = 'SHIPBOB'.freeze, + + # Jersey Post Group. + JERSEYPOST_ATLAS = 'JERSEYPOST_ATLAS'.freeze, + + # Coretrails. + CORETRAILS = 'CORETRAILS'.freeze, + + # Rhenus Logistics Italy. + RHENUS_ITALY = 'RHENUS_ITALY'.freeze, + + # Jadlog. + JADLOG = 'JADLOG'.freeze, + + # Jitsu. + JITSU = 'JITSU'.freeze, + + # Yanwen Express. + YANWEN_EXPRESS = 'YANWEN_EXPRESS'.freeze, + + # Dashlink. + DASHLINK = 'DASHLINK'.freeze, + + # Seino Super Express. + SEINO_SUPER_EXPRESS = 'SEINO_SUPER_EXPRESS'.freeze, + + # Floship. + FLOSHIP = 'FLOSHIP'.freeze, + + # Metro Supply Chain. + METROSCG = 'METROSCG'.freeze, + + # Sendparcel. + SENDPARCEL = 'SENDPARCEL'.freeze, + + # P2p. + P2P = 'P2P'.freeze, + + # Cn Express. + CN_EXPRESS = 'CN_EXPRESS'.freeze, + + # Cirro Track. + CIRROTRACK = 'CIRROTRACK'.freeze, + + # Land Logistics. + LAND_LOGISTICS = 'LAND_LOGISTICS'.freeze, + + # Veho. + VEHO = 'VEHO'.freeze, + + # Medline. + MEDLINE = 'MEDLINE'.freeze, + + # Vdtrack. + VDTRACK = 'VDTRACK'.freeze, + + # Sino Scm. + SINO_SCM = 'SINO_SCM'.freeze, + + # 3pe Express. + ENUM_3PE_EXPRESS = '3PE_EXPRESS'.freeze, + + # Swiftx. + SWIFTX = 'SWIFTX'.freeze, + + # Sfyd Express. + SFYDEXPRESS = 'SFYDEXPRESS'.freeze, + + # Toptrans. + TOPTRANS = 'TOPTRANS'.freeze ].freeze def self.validate(value) diff --git a/lib/paypal_server_sdk/models/shipping_details.rb b/lib/paypal_server_sdk/models/shipping_details.rb index a5ac800..96f0560 100644 --- a/lib/paypal_server_sdk/models/shipping_details.rb +++ b/lib/paypal_server_sdk/models/shipping_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The shipping details. diff --git a/lib/paypal_server_sdk/models/shipping_information.rb b/lib/paypal_server_sdk/models/shipping_information.rb new file mode 100644 index 0000000..8505861 --- /dev/null +++ b/lib/paypal_server_sdk/models/shipping_information.rb @@ -0,0 +1,101 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The shipping information. + class ShippingInformation < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The recipient's name. + # @return [String] + attr_accessor :name + + # The shipping method that is associated with this order. + # @return [String] + attr_accessor :method + + # A simple postal address with coarse-grained fields. Do not use for an + # international address. Use for backward compatibility only. Does not + # contain phone. + # @return [SimplePostalAddressCoarseGrained] + attr_accessor :address + + # A simple postal address with coarse-grained fields. Do not use for an + # international address. Use for backward compatibility only. Does not + # contain phone. + # @return [SimplePostalAddressCoarseGrained] + attr_accessor :secondary_shipping_address + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['name'] = 'name' + @_hash['method'] = 'method' + @_hash['address'] = 'address' + @_hash['secondary_shipping_address'] = 'secondary_shipping_address' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + name + method + address + secondary_shipping_address + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(name: SKIP, method: SKIP, address: SKIP, + secondary_shipping_address: SKIP) + @name = name unless name == SKIP + @method = method unless method == SKIP + @address = address unless address == SKIP + unless secondary_shipping_address == SKIP + @secondary_shipping_address = + secondary_shipping_address + end + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + name = hash.key?('name') ? hash['name'] : SKIP + method = hash.key?('method') ? hash['method'] : SKIP + address = SimplePostalAddressCoarseGrained.from_hash(hash['address']) if hash['address'] + if hash['secondary_shipping_address'] + secondary_shipping_address = SimplePostalAddressCoarseGrained.from_hash(hash['secondary_shipping_address']) + end + + # Create object from extracted values. + ShippingInformation.new(name: name, + method: method, + address: address, + secondary_shipping_address: secondary_shipping_address) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name}, method: #{@method}, address: #{@address},"\ + " secondary_shipping_address: #{@secondary_shipping_address}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name.inspect}, method: #{@method.inspect}, address:"\ + " #{@address.inspect}, secondary_shipping_address: #{@secondary_shipping_address.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/shipping_name.rb b/lib/paypal_server_sdk/models/shipping_name.rb index 2b9f4d1..d5cd9ed 100644 --- a/lib/paypal_server_sdk/models/shipping_name.rb +++ b/lib/paypal_server_sdk/models/shipping_name.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The name of the party. diff --git a/lib/paypal_server_sdk/models/shipping_option.rb b/lib/paypal_server_sdk/models/shipping_option.rb index 5733784..2301158 100644 --- a/lib/paypal_server_sdk/models/shipping_option.rb +++ b/lib/paypal_server_sdk/models/shipping_option.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The options that the payee or merchant offers to the payer to ship or pick diff --git a/lib/paypal_server_sdk/models/shipping_options_purchase_unit.rb b/lib/paypal_server_sdk/models/shipping_options_purchase_unit.rb deleted file mode 100644 index 5fdd71b..0000000 --- a/lib/paypal_server_sdk/models/shipping_options_purchase_unit.rb +++ /dev/null @@ -1,121 +0,0 @@ -# paypal_server_sdk -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module PaypalServerSdk - # This would contain shipping option and amount data at purchase unit level. - class ShippingOptionsPurchaseUnit < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The API caller-provided external ID for the purchase unit. Required for - # multiple purchase units when you must update the order through `PATCH`. If - # you omit this value and the order contains only one purchase unit, PayPal - # sets this value to `default`. Note: If there are multiple purchase units, - # reference_id is required for each purchase unit. - # @return [String] - attr_accessor :reference_id - - # The total order amount with an optional breakdown that provides details, - # such as the total item amount, total tax amount, shipping, handling, - # insurance, and discounts, if any. If you specify `amount.breakdown`, the - # amount equals `item_total` plus `tax_total` plus `shipping` plus - # `handling` plus `insurance` minus `shipping_discount` minus discount. The - # amount must be a positive number. For listed of supported currencies and - # decimal precision, see the PayPal REST APIs Currency Codes. - # @return [AmountWithBreakdown] - attr_accessor :amount - - # An array of items that the customer purchases from the merchant. - # @return [Array[Item]] - attr_accessor :items - - # An array of shipping options that the payee or merchant offers to the - # payer to ship or pick up their items. - # @return [Array[ShippingOption]] - attr_accessor :shipping_options - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['reference_id'] = 'reference_id' - @_hash['amount'] = 'amount' - @_hash['items'] = 'items' - @_hash['shipping_options'] = 'shipping_options' - @_hash - end - - # An array for optional fields - def self.optionals - %w[ - reference_id - amount - items - shipping_options - ] - end - - # An array for nullable fields - def self.nullables - [] - end - - def initialize(reference_id: SKIP, amount: SKIP, items: SKIP, - shipping_options: SKIP) - @reference_id = reference_id unless reference_id == SKIP - @amount = amount unless amount == SKIP - @items = items unless items == SKIP - @shipping_options = shipping_options unless shipping_options == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - reference_id = hash.key?('reference_id') ? hash['reference_id'] : SKIP - amount = AmountWithBreakdown.from_hash(hash['amount']) if hash['amount'] - # Parameter is an array, so we need to iterate through it - items = nil - unless hash['items'].nil? - items = [] - hash['items'].each do |structure| - items << (Item.from_hash(structure) if structure) - end - end - - items = SKIP unless hash.key?('items') - # Parameter is an array, so we need to iterate through it - shipping_options = nil - unless hash['shipping_options'].nil? - shipping_options = [] - hash['shipping_options'].each do |structure| - shipping_options << (ShippingOption.from_hash(structure) if structure) - end - end - - shipping_options = SKIP unless hash.key?('shipping_options') - - # Create object from extracted values. - ShippingOptionsPurchaseUnit.new(reference_id: reference_id, - amount: amount, - items: items, - shipping_options: shipping_options) - end - - # Provides a human-readable string representation of the object. - def to_s - class_name = self.class.name.split('::').last - "<#{class_name} reference_id: #{@reference_id}, amount: #{@amount}, items: #{@items},"\ - " shipping_options: #{@shipping_options}>" - end - - # Provides a debugging-friendly string with detailed object information. - def inspect - class_name = self.class.name.split('::').last - "<#{class_name} reference_id: #{@reference_id.inspect}, amount: #{@amount.inspect}, items:"\ - " #{@items.inspect}, shipping_options: #{@shipping_options.inspect}>" - end - end -end diff --git a/lib/paypal_server_sdk/models/shipping_type.rb b/lib/paypal_server_sdk/models/shipping_type.rb index 8fa53f2..7afb175 100644 --- a/lib/paypal_server_sdk/models/shipping_type.rb +++ b/lib/paypal_server_sdk/models/shipping_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # A classification for the method of purchase fulfillment. diff --git a/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb b/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb index 4969c12..f77626e 100644 --- a/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb +++ b/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb @@ -1,14 +1,18 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk - # The order shipping details. + # ShippingWithTrackingDetails Model. class ShippingWithTrackingDetails < BaseModel SKIP = Object.new private_constant :SKIP + # An array of trackers for a transaction. + # @return [Array[OrderTrackerResponse]] + attr_accessor :trackers + # The name of the party. # @return [ShippingName] attr_accessor :name @@ -22,7 +26,7 @@ class ShippingWithTrackingDetails < BaseModel # The phone number in its canonical international [E.164 numbering plan # format](https://www.itu.int/rec/T-REC-E.164/en). - # @return [PhoneNumberWithCountryCode] + # @return [PhoneNumberWithOptionalCountryCode] attr_accessor :phone_number # A classification for the method of purchase fulfillment (e.g shipping, @@ -45,33 +49,29 @@ class ShippingWithTrackingDetails < BaseModel # @return [Address] attr_accessor :address - # An array of trackers for a transaction. - # @return [Array[OrderTrackerResponse]] - attr_accessor :trackers - # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? + @_hash['trackers'] = 'trackers' @_hash['name'] = 'name' @_hash['email_address'] = 'email_address' @_hash['phone_number'] = 'phone_number' @_hash['type'] = 'type' @_hash['options'] = 'options' @_hash['address'] = 'address' - @_hash['trackers'] = 'trackers' @_hash end # An array for optional fields def self.optionals %w[ + trackers name email_address phone_number type options address - trackers ] end @@ -80,15 +80,15 @@ def self.nullables [] end - def initialize(name: SKIP, email_address: SKIP, phone_number: SKIP, - type: SKIP, options: SKIP, address: SKIP, trackers: SKIP) + def initialize(trackers: SKIP, name: SKIP, email_address: SKIP, + phone_number: SKIP, type: SKIP, options: SKIP, address: SKIP) + @trackers = trackers unless trackers == SKIP @name = name unless name == SKIP @email_address = email_address unless email_address == SKIP @phone_number = phone_number unless phone_number == SKIP @type = type unless type == SKIP @options = options unless options == SKIP @address = address unless address == SKIP - @trackers = trackers unless trackers == SKIP end # Creates an instance of the object from a hash. @@ -96,9 +96,19 @@ def self.from_hash(hash) return nil unless hash # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + trackers = nil + unless hash['trackers'].nil? + trackers = [] + hash['trackers'].each do |structure| + trackers << (OrderTrackerResponse.from_hash(structure) if structure) + end + end + + trackers = SKIP unless hash.key?('trackers') name = ShippingName.from_hash(hash['name']) if hash['name'] email_address = hash.key?('email_address') ? hash['email_address'] : SKIP - phone_number = PhoneNumberWithCountryCode.from_hash(hash['phone_number']) if + phone_number = PhoneNumberWithOptionalCountryCode.from_hash(hash['phone_number']) if hash['phone_number'] type = hash.key?('type') ? hash['type'] : SKIP # Parameter is an array, so we need to iterate through it @@ -112,41 +122,31 @@ def self.from_hash(hash) options = SKIP unless hash.key?('options') address = Address.from_hash(hash['address']) if hash['address'] - # Parameter is an array, so we need to iterate through it - trackers = nil - unless hash['trackers'].nil? - trackers = [] - hash['trackers'].each do |structure| - trackers << (OrderTrackerResponse.from_hash(structure) if structure) - end - end - - trackers = SKIP unless hash.key?('trackers') # Create object from extracted values. - ShippingWithTrackingDetails.new(name: name, + ShippingWithTrackingDetails.new(trackers: trackers, + name: name, email_address: email_address, phone_number: phone_number, type: type, options: options, - address: address, - trackers: trackers) + address: address) end # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last - "<#{class_name} name: #{@name}, email_address: #{@email_address}, phone_number:"\ - " #{@phone_number}, type: #{@type}, options: #{@options}, address: #{@address}, trackers:"\ - " #{@trackers}>" + "<#{class_name} trackers: #{@trackers}, name: #{@name}, email_address: #{@email_address},"\ + " phone_number: #{@phone_number}, type: #{@type}, options: #{@options}, address:"\ + " #{@address}>" end # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last - "<#{class_name} name: #{@name.inspect}, email_address: #{@email_address.inspect},"\ - " phone_number: #{@phone_number.inspect}, type: #{@type.inspect}, options:"\ - " #{@options.inspect}, address: #{@address.inspect}, trackers: #{@trackers.inspect}>" + "<#{class_name} trackers: #{@trackers.inspect}, name: #{@name.inspect}, email_address:"\ + " #{@email_address.inspect}, phone_number: #{@phone_number.inspect}, type: #{@type.inspect},"\ + " options: #{@options.inspect}, address: #{@address.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/simple_postal_address_coarse_grained.rb b/lib/paypal_server_sdk/models/simple_postal_address_coarse_grained.rb new file mode 100644 index 0000000..a89bb33 --- /dev/null +++ b/lib/paypal_server_sdk/models/simple_postal_address_coarse_grained.rb @@ -0,0 +1,130 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # A simple postal address with coarse-grained fields. Do not use for an + # international address. Use for backward compatibility only. Does not contain + # phone. + class SimplePostalAddressCoarseGrained < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The first line of the address. For example, number or street. + # @return [String] + attr_accessor :line1 + + # The second line of the address. For example, suite or apartment number. + # @return [String] + attr_accessor :line2 + + # The city name. + # @return [String] + attr_accessor :city + + # The [code](/docs/api/reference/state-codes/) for a US state or the + # equivalent for other countries. Required for transactions if the address + # is in one of these countries: + # [Argentina](/docs/api/reference/state-codes/#argentina), + # [Brazil](/docs/api/reference/state-codes/#brazil), + # [Canada](/docs/api/reference/state-codes/#canada), + # [China](/docs/api/reference/state-codes/#china), + # [India](/docs/api/reference/state-codes/#india), + # [Italy](/docs/api/reference/state-codes/#italy), + # [Japan](/docs/api/reference/state-codes/#japan), + # [Mexico](/docs/api/reference/state-codes/#mexico), + # [Thailand](/docs/api/reference/state-codes/#thailand), or [United + # States](/docs/api/reference/state-codes/#usa). Maximum length is 40 + # single-byte characters. + # @return [String] + attr_accessor :state + + # The [two-character ISO 3166-1 + # code](/docs/integration/direct/rest/country-codes/) that identifies the + # country or region. Note: The country code for Great Britain is GB and not + # UK as used in the top-level domain names for that country. Use the `C2` + # country code for China worldwide for comparable uncontrolled price (CUP) + # method, bank card, and cross-border transactions. + # @return [String] + attr_accessor :country_code + + # The postal code, which is the zip code or equivalent. Typically required + # for countries with a postal code or an equivalent. See [postal + # code](https://en.wikipedia.org/wiki/Postal_code). + # @return [String] + attr_accessor :postal_code + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['line1'] = 'line1' + @_hash['line2'] = 'line2' + @_hash['city'] = 'city' + @_hash['state'] = 'state' + @_hash['country_code'] = 'country_code' + @_hash['postal_code'] = 'postal_code' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + line2 + state + postal_code + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(line1:, city:, country_code:, line2: SKIP, state: SKIP, + postal_code: SKIP) + @line1 = line1 + @line2 = line2 unless line2 == SKIP + @city = city + @state = state unless state == SKIP + @country_code = country_code + @postal_code = postal_code unless postal_code == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + line1 = hash.key?('line1') ? hash['line1'] : nil + city = hash.key?('city') ? hash['city'] : nil + country_code = hash.key?('country_code') ? hash['country_code'] : nil + line2 = hash.key?('line2') ? hash['line2'] : SKIP + state = hash.key?('state') ? hash['state'] : SKIP + postal_code = hash.key?('postal_code') ? hash['postal_code'] : SKIP + + # Create object from extracted values. + SimplePostalAddressCoarseGrained.new(line1: line1, + city: city, + country_code: country_code, + line2: line2, + state: state, + postal_code: postal_code) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} line1: #{@line1}, line2: #{@line2}, city: #{@city}, state: #{@state},"\ + " country_code: #{@country_code}, postal_code: #{@postal_code}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} line1: #{@line1.inspect}, line2: #{@line2.inspect}, city: #{@city.inspect},"\ + " state: #{@state.inspect}, country_code: #{@country_code.inspect}, postal_code:"\ + " #{@postal_code.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/sofort_payment_object.rb b/lib/paypal_server_sdk/models/sofort_payment_object.rb index a568db9..ab86d3b 100644 --- a/lib/paypal_server_sdk/models/sofort_payment_object.rb +++ b/lib/paypal_server_sdk/models/sofort_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information used to pay using Sofort. diff --git a/lib/paypal_server_sdk/models/sofort_payment_request.rb b/lib/paypal_server_sdk/models/sofort_payment_request.rb index 82e8cde..f57a8dc 100644 --- a/lib/paypal_server_sdk/models/sofort_payment_request.rb +++ b/lib/paypal_server_sdk/models/sofort_payment_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using Sofort. diff --git a/lib/paypal_server_sdk/models/standard_entry_class_code.rb b/lib/paypal_server_sdk/models/standard_entry_class_code.rb index 706048d..1823c5a 100644 --- a/lib/paypal_server_sdk/models/standard_entry_class_code.rb +++ b/lib/paypal_server_sdk/models/standard_entry_class_code.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # NACHA (the regulatory body governing the ACH network) requires that API diff --git a/lib/paypal_server_sdk/models/store_in_vault_instruction.rb b/lib/paypal_server_sdk/models/store_in_vault_instruction.rb index 54ab478..29098b3 100644 --- a/lib/paypal_server_sdk/models/store_in_vault_instruction.rb +++ b/lib/paypal_server_sdk/models/store_in_vault_instruction.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Defines how and when the payment source gets vaulted. diff --git a/lib/paypal_server_sdk/models/store_information.rb b/lib/paypal_server_sdk/models/store_information.rb new file mode 100644 index 0000000..8c1bf98 --- /dev/null +++ b/lib/paypal_server_sdk/models/store_information.rb @@ -0,0 +1,71 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The store information. + class StoreInformation < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The ID of a store for a merchant in the system of record. + # @return [String] + attr_accessor :store_id + + # The terminal ID for the checkout stand in a merchant store. + # @return [String] + attr_accessor :terminal_id + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['store_id'] = 'store_id' + @_hash['terminal_id'] = 'terminal_id' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + store_id + terminal_id + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(store_id: SKIP, terminal_id: SKIP) + @store_id = store_id unless store_id == SKIP + @terminal_id = terminal_id unless terminal_id == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + store_id = hash.key?('store_id') ? hash['store_id'] : SKIP + terminal_id = hash.key?('terminal_id') ? hash['terminal_id'] : SKIP + + # Create object from extracted values. + StoreInformation.new(store_id: store_id, + terminal_id: terminal_id) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} store_id: #{@store_id}, terminal_id: #{@terminal_id}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} store_id: #{@store_id.inspect}, terminal_id: #{@terminal_id.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/stored_payment_source.rb b/lib/paypal_server_sdk/models/stored_payment_source.rb index 4414c52..0141781 100644 --- a/lib/paypal_server_sdk/models/stored_payment_source.rb +++ b/lib/paypal_server_sdk/models/stored_payment_source.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Provides additional details to process a payment using a `payment_source` @@ -32,7 +32,7 @@ class StoredPaymentSource < BaseModel attr_accessor :usage # Reference values used by the card network to identify a transaction. - # @return [NetworkTransactionReference] + # @return [NetworkTransaction] attr_accessor :previous_network_transaction_reference # A mapping from model property names to API property names. @@ -81,7 +81,7 @@ def self.from_hash(hash) payment_type = hash.key?('payment_type') ? hash['payment_type'] : nil usage = hash['usage'] ||= StoredPaymentSourceUsageType::DERIVED if hash['previous_network_transaction_reference'] - previous_network_transaction_reference = NetworkTransactionReference.from_hash(hash['previous_network_transaction_reference']) + previous_network_transaction_reference = NetworkTransaction.from_hash(hash['previous_network_transaction_reference']) end # Create object from extracted values. diff --git a/lib/paypal_server_sdk/models/stored_payment_source_payment_type.rb b/lib/paypal_server_sdk/models/stored_payment_source_payment_type.rb index 1d4524b..5add211 100644 --- a/lib/paypal_server_sdk/models/stored_payment_source_payment_type.rb +++ b/lib/paypal_server_sdk/models/stored_payment_source_payment_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Indicates the type of the stored payment_source payment. diff --git a/lib/paypal_server_sdk/models/stored_payment_source_usage_type.rb b/lib/paypal_server_sdk/models/stored_payment_source_usage_type.rb index 7b2a8e0..9f1599e 100644 --- a/lib/paypal_server_sdk/models/stored_payment_source_usage_type.rb +++ b/lib/paypal_server_sdk/models/stored_payment_source_usage_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Indicates if this is a `first` or `subsequent` payment using a stored diff --git a/lib/paypal_server_sdk/models/subscriber.rb b/lib/paypal_server_sdk/models/subscriber.rb new file mode 100644 index 0000000..4d44972 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscriber.rb @@ -0,0 +1,84 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The subscriber response information. + class Subscriber < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The name of the party. + # @return [Name] + attr_accessor :name + + # The shipping details. + # @return [ShippingDetails] + attr_accessor :shipping_address + + # The payment source used to fund the payment. + # @return [SubscriptionPaymentSourceResponse] + attr_accessor :payment_source + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['name'] = 'name' + @_hash['shipping_address'] = 'shipping_address' + @_hash['payment_source'] = 'payment_source' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + name + shipping_address + payment_source + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(name: SKIP, shipping_address: SKIP, payment_source: SKIP) + @name = name unless name == SKIP + @shipping_address = shipping_address unless shipping_address == SKIP + @payment_source = payment_source unless payment_source == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + name = Name.from_hash(hash['name']) if hash['name'] + shipping_address = ShippingDetails.from_hash(hash['shipping_address']) if + hash['shipping_address'] + payment_source = SubscriptionPaymentSourceResponse.from_hash(hash['payment_source']) if + hash['payment_source'] + + # Create object from extracted values. + Subscriber.new(name: name, + shipping_address: shipping_address, + payment_source: payment_source) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name}, shipping_address: #{@shipping_address}, payment_source:"\ + " #{@payment_source}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name.inspect}, shipping_address: #{@shipping_address.inspect},"\ + " payment_source: #{@payment_source.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscriber_request.rb b/lib/paypal_server_sdk/models/subscriber_request.rb new file mode 100644 index 0000000..ef2fd84 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscriber_request.rb @@ -0,0 +1,97 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The subscriber request information . + class SubscriberRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The name of the party. + # @return [Name] + attr_accessor :name + + # The phone information. + # @return [PhoneWithType] + attr_accessor :phone + + # The shipping details. + # @return [ShippingDetails] + attr_accessor :shipping_address + + # The payment source definition. To be eligible to create subscription using + # debit or credit card, you will need to sign up here + # (https://www.paypal.com/bizsignup/entry/product/ppcp). Please note, its + # available only for non-3DS cards and for merchants in US and AU regions. + # @return [SubscriptionPaymentSource] + attr_accessor :payment_source + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['name'] = 'name' + @_hash['phone'] = 'phone' + @_hash['shipping_address'] = 'shipping_address' + @_hash['payment_source'] = 'payment_source' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + name + phone + shipping_address + payment_source + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(name: SKIP, phone: SKIP, shipping_address: SKIP, + payment_source: SKIP) + @name = name unless name == SKIP + @phone = phone unless phone == SKIP + @shipping_address = shipping_address unless shipping_address == SKIP + @payment_source = payment_source unless payment_source == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + name = Name.from_hash(hash['name']) if hash['name'] + phone = PhoneWithType.from_hash(hash['phone']) if hash['phone'] + shipping_address = ShippingDetails.from_hash(hash['shipping_address']) if + hash['shipping_address'] + payment_source = SubscriptionPaymentSource.from_hash(hash['payment_source']) if + hash['payment_source'] + + # Create object from extracted values. + SubscriberRequest.new(name: name, + phone: phone, + shipping_address: shipping_address, + payment_source: payment_source) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name}, phone: #{@phone}, shipping_address: #{@shipping_address},"\ + " payment_source: #{@payment_source}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name.inspect}, phone: #{@phone.inspect}, shipping_address:"\ + " #{@shipping_address.inspect}, payment_source: #{@payment_source.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription.rb b/lib/paypal_server_sdk/models/subscription.rb new file mode 100644 index 0000000..4548af9 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription.rb @@ -0,0 +1,205 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The subscription details. + class Subscription < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The PayPal-generated ID for the subscription. + # @return [String] + attr_accessor :id + + # The ID of the plan. + # @return [String] + attr_accessor :plan_id + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :start_time + + # The quantity of the product in the subscription. + # @return [String] + attr_accessor :quantity + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :shipping_amount + + # The subscriber response information. + # @return [Subscriber] + attr_accessor :subscriber + + # The billing details for the subscription. If the subscription was or is + # active, these fields are populated. + # @return [SubscriptionBillingInformation] + attr_accessor :billing_info + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :create_time + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :update_time + + # The custom id for the subscription. Can be invoice id. + # @return [String] + attr_accessor :custom_id + + # Indicates whether the subscription has overridden any plan attributes. + # @return [TrueClass | FalseClass] + attr_accessor :plan_overridden + + # The plan details. + # @return [PlanDetails] + attr_accessor :plan + + # An array of request-related [HATEOAS + # links](/docs/api/reference/api-responses/#hateoas-links). + # @return [Array[LinkDescription]] + attr_accessor :links + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['id'] = 'id' + @_hash['plan_id'] = 'plan_id' + @_hash['start_time'] = 'start_time' + @_hash['quantity'] = 'quantity' + @_hash['shipping_amount'] = 'shipping_amount' + @_hash['subscriber'] = 'subscriber' + @_hash['billing_info'] = 'billing_info' + @_hash['create_time'] = 'create_time' + @_hash['update_time'] = 'update_time' + @_hash['custom_id'] = 'custom_id' + @_hash['plan_overridden'] = 'plan_overridden' + @_hash['plan'] = 'plan' + @_hash['links'] = 'links' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + id + plan_id + start_time + quantity + shipping_amount + subscriber + billing_info + create_time + update_time + custom_id + plan_overridden + plan + links + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(id: SKIP, plan_id: SKIP, start_time: SKIP, quantity: SKIP, + shipping_amount: SKIP, subscriber: SKIP, billing_info: SKIP, + create_time: SKIP, update_time: SKIP, custom_id: SKIP, + plan_overridden: SKIP, plan: SKIP, links: SKIP) + @id = id unless id == SKIP + @plan_id = plan_id unless plan_id == SKIP + @start_time = start_time unless start_time == SKIP + @quantity = quantity unless quantity == SKIP + @shipping_amount = shipping_amount unless shipping_amount == SKIP + @subscriber = subscriber unless subscriber == SKIP + @billing_info = billing_info unless billing_info == SKIP + @create_time = create_time unless create_time == SKIP + @update_time = update_time unless update_time == SKIP + @custom_id = custom_id unless custom_id == SKIP + @plan_overridden = plan_overridden unless plan_overridden == SKIP + @plan = plan unless plan == SKIP + @links = links unless links == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + id = hash.key?('id') ? hash['id'] : SKIP + plan_id = hash.key?('plan_id') ? hash['plan_id'] : SKIP + start_time = hash.key?('start_time') ? hash['start_time'] : SKIP + quantity = hash.key?('quantity') ? hash['quantity'] : SKIP + shipping_amount = Money.from_hash(hash['shipping_amount']) if hash['shipping_amount'] + subscriber = Subscriber.from_hash(hash['subscriber']) if hash['subscriber'] + billing_info = SubscriptionBillingInformation.from_hash(hash['billing_info']) if + hash['billing_info'] + create_time = hash.key?('create_time') ? hash['create_time'] : SKIP + update_time = hash.key?('update_time') ? hash['update_time'] : SKIP + custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP + plan_overridden = + hash.key?('plan_overridden') ? hash['plan_overridden'] : SKIP + plan = PlanDetails.from_hash(hash['plan']) if hash['plan'] + # Parameter is an array, so we need to iterate through it + links = nil + unless hash['links'].nil? + links = [] + hash['links'].each do |structure| + links << (LinkDescription.from_hash(structure) if structure) + end + end + + links = SKIP unless hash.key?('links') + + # Create object from extracted values. + Subscription.new(id: id, + plan_id: plan_id, + start_time: start_time, + quantity: quantity, + shipping_amount: shipping_amount, + subscriber: subscriber, + billing_info: billing_info, + create_time: create_time, + update_time: update_time, + custom_id: custom_id, + plan_overridden: plan_overridden, + plan: plan, + links: links) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id}, plan_id: #{@plan_id}, start_time: #{@start_time}, quantity:"\ + " #{@quantity}, shipping_amount: #{@shipping_amount}, subscriber: #{@subscriber},"\ + " billing_info: #{@billing_info}, create_time: #{@create_time}, update_time:"\ + " #{@update_time}, custom_id: #{@custom_id}, plan_overridden: #{@plan_overridden}, plan:"\ + " #{@plan}, links: #{@links}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id.inspect}, plan_id: #{@plan_id.inspect}, start_time:"\ + " #{@start_time.inspect}, quantity: #{@quantity.inspect}, shipping_amount:"\ + " #{@shipping_amount.inspect}, subscriber: #{@subscriber.inspect}, billing_info:"\ + " #{@billing_info.inspect}, create_time: #{@create_time.inspect}, update_time:"\ + " #{@update_time.inspect}, custom_id: #{@custom_id.inspect}, plan_overridden:"\ + " #{@plan_overridden.inspect}, plan: #{@plan.inspect}, links: #{@links.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_amount_with_breakdown.rb b/lib/paypal_server_sdk/models/subscription_amount_with_breakdown.rb new file mode 100644 index 0000000..1c51e18 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_amount_with_breakdown.rb @@ -0,0 +1,119 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The breakdown details for the amount. Includes the gross, tax, fee, and + # shipping amounts. + class SubscriptionAmountWithBreakdown < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :gross_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :total_item_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :fee_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :shipping_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :tax_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :net_amount + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['gross_amount'] = 'gross_amount' + @_hash['total_item_amount'] = 'total_item_amount' + @_hash['fee_amount'] = 'fee_amount' + @_hash['shipping_amount'] = 'shipping_amount' + @_hash['tax_amount'] = 'tax_amount' + @_hash['net_amount'] = 'net_amount' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + total_item_amount + fee_amount + shipping_amount + tax_amount + net_amount + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(gross_amount:, total_item_amount: SKIP, fee_amount: SKIP, + shipping_amount: SKIP, tax_amount: SKIP, net_amount: SKIP) + @gross_amount = gross_amount + @total_item_amount = total_item_amount unless total_item_amount == SKIP + @fee_amount = fee_amount unless fee_amount == SKIP + @shipping_amount = shipping_amount unless shipping_amount == SKIP + @tax_amount = tax_amount unless tax_amount == SKIP + @net_amount = net_amount unless net_amount == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + gross_amount = Money.from_hash(hash['gross_amount']) if hash['gross_amount'] + total_item_amount = Money.from_hash(hash['total_item_amount']) if hash['total_item_amount'] + fee_amount = Money.from_hash(hash['fee_amount']) if hash['fee_amount'] + shipping_amount = Money.from_hash(hash['shipping_amount']) if hash['shipping_amount'] + tax_amount = Money.from_hash(hash['tax_amount']) if hash['tax_amount'] + net_amount = Money.from_hash(hash['net_amount']) if hash['net_amount'] + + # Create object from extracted values. + SubscriptionAmountWithBreakdown.new(gross_amount: gross_amount, + total_item_amount: total_item_amount, + fee_amount: fee_amount, + shipping_amount: shipping_amount, + tax_amount: tax_amount, + net_amount: net_amount) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} gross_amount: #{@gross_amount}, total_item_amount: #{@total_item_amount},"\ + " fee_amount: #{@fee_amount}, shipping_amount: #{@shipping_amount}, tax_amount:"\ + " #{@tax_amount}, net_amount: #{@net_amount}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} gross_amount: #{@gross_amount.inspect}, total_item_amount:"\ + " #{@total_item_amount.inspect}, fee_amount: #{@fee_amount.inspect}, shipping_amount:"\ + " #{@shipping_amount.inspect}, tax_amount: #{@tax_amount.inspect}, net_amount:"\ + " #{@net_amount.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_application_context.rb b/lib/paypal_server_sdk/models/subscription_application_context.rb new file mode 100644 index 0000000..f527872 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_application_context.rb @@ -0,0 +1,134 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The application context, which customizes the payer experience during the + # subscription approval process with PayPal. + class SubscriptionApplicationContext < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The label that overrides the business name in the PayPal account on the + # PayPal site. + # @return [String] + attr_accessor :brand_name + + # The BCP 47-formatted locale of pages that the PayPal payment experience + # shows. PayPal supports a five-character code. For example, `da-DK`, + # `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, + # `zh-CN`, `zh-HK`, or `zh-TW`. + # @return [String] + attr_accessor :locale + + # The location from which the shipping address is derived. + # @return [ExperienceContextShippingPreference] + attr_accessor :shipping_preference + + # Configures the label name to `Continue` or `Subscribe Now` for + # subscription consent experience. + # @return [ApplicationContextUserAction] + attr_accessor :user_action + + # The customer and merchant payment preferences. + # @return [PaymentMethod] + attr_accessor :payment_method + + # The URL where the customer is redirected after the customer approves the + # payment. + # @return [String] + attr_accessor :return_url + + # The URL where the customer is redirected after the customer cancels the + # payment. + # @return [String] + attr_accessor :cancel_url + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['brand_name'] = 'brand_name' + @_hash['locale'] = 'locale' + @_hash['shipping_preference'] = 'shipping_preference' + @_hash['user_action'] = 'user_action' + @_hash['payment_method'] = 'payment_method' + @_hash['return_url'] = 'return_url' + @_hash['cancel_url'] = 'cancel_url' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + brand_name + locale + shipping_preference + user_action + payment_method + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize( + return_url:, cancel_url:, brand_name: SKIP, locale: SKIP, + shipping_preference: ExperienceContextShippingPreference::GET_FROM_FILE, + user_action: ApplicationContextUserAction::SUBSCRIBE_NOW, + payment_method: SKIP + ) + @brand_name = brand_name unless brand_name == SKIP + @locale = locale unless locale == SKIP + @shipping_preference = shipping_preference unless shipping_preference == SKIP + @user_action = user_action unless user_action == SKIP + @payment_method = payment_method unless payment_method == SKIP + @return_url = return_url + @cancel_url = cancel_url + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + return_url = hash.key?('return_url') ? hash['return_url'] : nil + cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : nil + brand_name = hash.key?('brand_name') ? hash['brand_name'] : SKIP + locale = hash.key?('locale') ? hash['locale'] : SKIP + shipping_preference = + hash['shipping_preference'] ||= ExperienceContextShippingPreference::GET_FROM_FILE + user_action = + hash['user_action'] ||= ApplicationContextUserAction::SUBSCRIBE_NOW + payment_method = PaymentMethod.from_hash(hash['payment_method']) if hash['payment_method'] + + # Create object from extracted values. + SubscriptionApplicationContext.new(return_url: return_url, + cancel_url: cancel_url, + brand_name: brand_name, + locale: locale, + shipping_preference: shipping_preference, + user_action: user_action, + payment_method: payment_method) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} brand_name: #{@brand_name}, locale: #{@locale}, shipping_preference:"\ + " #{@shipping_preference}, user_action: #{@user_action}, payment_method: #{@payment_method},"\ + " return_url: #{@return_url}, cancel_url: #{@cancel_url}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} brand_name: #{@brand_name.inspect}, locale: #{@locale.inspect},"\ + " shipping_preference: #{@shipping_preference.inspect}, user_action:"\ + " #{@user_action.inspect}, payment_method: #{@payment_method.inspect}, return_url:"\ + " #{@return_url.inspect}, cancel_url: #{@cancel_url.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_billing_cycle.rb b/lib/paypal_server_sdk/models/subscription_billing_cycle.rb new file mode 100644 index 0000000..e824791 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_billing_cycle.rb @@ -0,0 +1,108 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The billing cycle details. + class SubscriptionBillingCycle < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The pricing scheme details. + # @return [SubscriptionPricingScheme] + attr_accessor :pricing_scheme + + # The frequency of the billing cycle. + # @return [Frequency] + attr_accessor :frequency + + # The tenure type of the billing cycle. In case of a plan having trial + # cycle, only 2 trial cycles are allowed per plan. + # @return [TenureType] + attr_accessor :tenure_type + + # The order in which this cycle is to run among other billing cycles. For + # example, a trial billing cycle has a `sequence` of `1` while a regular + # billing cycle has a `sequence` of `2`, so that trial cycle runs before the + # regular cycle. + # @return [Integer] + attr_accessor :sequence + + # The number of times this billing cycle gets executed. Trial billing cycles + # can only be executed a finite number of times (value between 1 and 999 for + # total_cycles). Regular billing cycles can be executed infinite times + # (value of 0 for total_cycles) or a finite number of times (value between 1 + # and 999 for total_cycles). + # @return [Integer] + attr_accessor :total_cycles + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['pricing_scheme'] = 'pricing_scheme' + @_hash['frequency'] = 'frequency' + @_hash['tenure_type'] = 'tenure_type' + @_hash['sequence'] = 'sequence' + @_hash['total_cycles'] = 'total_cycles' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + pricing_scheme + total_cycles + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(frequency:, tenure_type:, sequence:, pricing_scheme: SKIP, + total_cycles: 1) + @pricing_scheme = pricing_scheme unless pricing_scheme == SKIP + @frequency = frequency + @tenure_type = tenure_type + @sequence = sequence + @total_cycles = total_cycles unless total_cycles == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + frequency = Frequency.from_hash(hash['frequency']) if hash['frequency'] + tenure_type = hash.key?('tenure_type') ? hash['tenure_type'] : nil + sequence = hash.key?('sequence') ? hash['sequence'] : nil + pricing_scheme = SubscriptionPricingScheme.from_hash(hash['pricing_scheme']) if + hash['pricing_scheme'] + total_cycles = hash['total_cycles'] ||= 1 + + # Create object from extracted values. + SubscriptionBillingCycle.new(frequency: frequency, + tenure_type: tenure_type, + sequence: sequence, + pricing_scheme: pricing_scheme, + total_cycles: total_cycles) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} pricing_scheme: #{@pricing_scheme}, frequency: #{@frequency}, tenure_type:"\ + " #{@tenure_type}, sequence: #{@sequence}, total_cycles: #{@total_cycles}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} pricing_scheme: #{@pricing_scheme.inspect}, frequency:"\ + " #{@frequency.inspect}, tenure_type: #{@tenure_type.inspect}, sequence:"\ + " #{@sequence.inspect}, total_cycles: #{@total_cycles.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_billing_information.rb b/lib/paypal_server_sdk/models/subscription_billing_information.rb new file mode 100644 index 0000000..2d9d763 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_billing_information.rb @@ -0,0 +1,148 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The billing details for the subscription. If the subscription was or is + # active, these fields are populated. + class SubscriptionBillingInformation < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :outstanding_balance + + # The trial and regular billing executions. + # @return [Array[CycleExecution]] + attr_accessor :cycle_executions + + # The details for the last payment. + # @return [LastPaymentDetails] + attr_accessor :last_payment + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :next_billing_time + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :final_payment_time + + # The number of consecutive payment failures. Resets to `0` after a + # successful payment. If this reaches the `payment_failure_threshold` value, + # the subscription updates to the `SUSPENDED` state. + # @return [Integer] + attr_accessor :failed_payments_count + + # The details for the failed payment of the subscription. + # @return [FailedPaymentDetails] + attr_accessor :last_failed_payment + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['outstanding_balance'] = 'outstanding_balance' + @_hash['cycle_executions'] = 'cycle_executions' + @_hash['last_payment'] = 'last_payment' + @_hash['next_billing_time'] = 'next_billing_time' + @_hash['final_payment_time'] = 'final_payment_time' + @_hash['failed_payments_count'] = 'failed_payments_count' + @_hash['last_failed_payment'] = 'last_failed_payment' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + cycle_executions + last_payment + next_billing_time + final_payment_time + last_failed_payment + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(outstanding_balance:, failed_payments_count:, + cycle_executions: SKIP, last_payment: SKIP, + next_billing_time: SKIP, final_payment_time: SKIP, + last_failed_payment: SKIP) + @outstanding_balance = outstanding_balance + @cycle_executions = cycle_executions unless cycle_executions == SKIP + @last_payment = last_payment unless last_payment == SKIP + @next_billing_time = next_billing_time unless next_billing_time == SKIP + @final_payment_time = final_payment_time unless final_payment_time == SKIP + @failed_payments_count = failed_payments_count + @last_failed_payment = last_failed_payment unless last_failed_payment == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + outstanding_balance = Money.from_hash(hash['outstanding_balance']) if + hash['outstanding_balance'] + failed_payments_count = + hash.key?('failed_payments_count') ? hash['failed_payments_count'] : nil + # Parameter is an array, so we need to iterate through it + cycle_executions = nil + unless hash['cycle_executions'].nil? + cycle_executions = [] + hash['cycle_executions'].each do |structure| + cycle_executions << (CycleExecution.from_hash(structure) if structure) + end + end + + cycle_executions = SKIP unless hash.key?('cycle_executions') + last_payment = LastPaymentDetails.from_hash(hash['last_payment']) if hash['last_payment'] + next_billing_time = + hash.key?('next_billing_time') ? hash['next_billing_time'] : SKIP + final_payment_time = + hash.key?('final_payment_time') ? hash['final_payment_time'] : SKIP + last_failed_payment = FailedPaymentDetails.from_hash(hash['last_failed_payment']) if + hash['last_failed_payment'] + + # Create object from extracted values. + SubscriptionBillingInformation.new(outstanding_balance: outstanding_balance, + failed_payments_count: failed_payments_count, + cycle_executions: cycle_executions, + last_payment: last_payment, + next_billing_time: next_billing_time, + final_payment_time: final_payment_time, + last_failed_payment: last_failed_payment) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} outstanding_balance: #{@outstanding_balance}, cycle_executions:"\ + " #{@cycle_executions}, last_payment: #{@last_payment}, next_billing_time:"\ + " #{@next_billing_time}, final_payment_time: #{@final_payment_time}, failed_payments_count:"\ + " #{@failed_payments_count}, last_failed_payment: #{@last_failed_payment}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} outstanding_balance: #{@outstanding_balance.inspect}, cycle_executions:"\ + " #{@cycle_executions.inspect}, last_payment: #{@last_payment.inspect}, next_billing_time:"\ + " #{@next_billing_time.inspect}, final_payment_time: #{@final_payment_time.inspect},"\ + " failed_payments_count: #{@failed_payments_count.inspect}, last_failed_payment:"\ + " #{@last_failed_payment.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_card_request.rb b/lib/paypal_server_sdk/models/subscription_card_request.rb new file mode 100644 index 0000000..661a2c1 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_card_request.rb @@ -0,0 +1,141 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The payment card to use to fund a payment. Can be a credit or debit card. + class SubscriptionCardRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The card holder's name as it appears on the card. + # @return [String] + attr_accessor :name + + # The primary account number (PAN) for the payment card. + # @return [String] + attr_accessor :number + + # The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date + # and time format](https://tools.ietf.org/html/rfc3339#section-5.6). + # @return [String] + attr_accessor :expiry + + # The three- or four-digit security code of the card. Also known as the CVV, + # CVC, CVN, CVE, or CID. This parameter cannot be present in the request + # when `payment_initiator=MERCHANT`. + # @return [String] + attr_accessor :security_code + + # Type of card. i.e Credit, Debit and so on. + # @return [CardType] + attr_accessor :type + + # The card network or brand. Applies to credit, debit, gift, and payment + # cards. + # @return [SubscriptionsCardBrand] + attr_accessor :brand + + # The portable international postal address. Maps to + # [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/ + # wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: + # the autocomplete + # attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-co + # ntrols-the-autocomplete-attribute). + # @return [Address] + attr_accessor :billing_address + + # Additional attributes associated with the use of this card. + # @return [SubscriptionsCardAttributes] + attr_accessor :attributes + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['name'] = 'name' + @_hash['number'] = 'number' + @_hash['expiry'] = 'expiry' + @_hash['security_code'] = 'security_code' + @_hash['type'] = 'type' + @_hash['brand'] = 'brand' + @_hash['billing_address'] = 'billing_address' + @_hash['attributes'] = 'attributes' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + name + number + expiry + security_code + type + brand + billing_address + attributes + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(name: SKIP, number: SKIP, expiry: SKIP, security_code: SKIP, + type: SKIP, brand: SKIP, billing_address: SKIP, + attributes: SKIP) + @name = name unless name == SKIP + @number = number unless number == SKIP + @expiry = expiry unless expiry == SKIP + @security_code = security_code unless security_code == SKIP + @type = type unless type == SKIP + @brand = brand unless brand == SKIP + @billing_address = billing_address unless billing_address == SKIP + @attributes = attributes unless attributes == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + name = hash.key?('name') ? hash['name'] : SKIP + number = hash.key?('number') ? hash['number'] : SKIP + expiry = hash.key?('expiry') ? hash['expiry'] : SKIP + security_code = hash.key?('security_code') ? hash['security_code'] : SKIP + type = hash.key?('type') ? hash['type'] : SKIP + brand = hash.key?('brand') ? hash['brand'] : SKIP + billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address'] + attributes = SubscriptionsCardAttributes.from_hash(hash['attributes']) if hash['attributes'] + + # Create object from extracted values. + SubscriptionCardRequest.new(name: name, + number: number, + expiry: expiry, + security_code: security_code, + type: type, + brand: brand, + billing_address: billing_address, + attributes: attributes) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name}, number: #{@number}, expiry: #{@expiry}, security_code:"\ + " #{@security_code}, type: #{@type}, brand: #{@brand}, billing_address: #{@billing_address},"\ + " attributes: #{@attributes}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} name: #{@name.inspect}, number: #{@number.inspect}, expiry:"\ + " #{@expiry.inspect}, security_code: #{@security_code.inspect}, type: #{@type.inspect},"\ + " brand: #{@brand.inspect}, billing_address: #{@billing_address.inspect}, attributes:"\ + " #{@attributes.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_collection.rb b/lib/paypal_server_sdk/models/subscription_collection.rb new file mode 100644 index 0000000..174b319 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_collection.rb @@ -0,0 +1,90 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The list of subscriptions. + class SubscriptionCollection < BaseModel + SKIP = Object.new + private_constant :SKIP + + # An array of subscriptions. + # @return [Array[Subscription]] + attr_accessor :subscriptions + + # An array of request-related [HATEOAS + # links](/docs/api/reference/api-responses/#hateoas-links). + # @return [Array[LinkDescription]] + attr_accessor :links + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['subscriptions'] = 'subscriptions' + @_hash['links'] = 'links' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + subscriptions + links + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(subscriptions: SKIP, links: SKIP) + @subscriptions = subscriptions unless subscriptions == SKIP + @links = links unless links == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + subscriptions = nil + unless hash['subscriptions'].nil? + subscriptions = [] + hash['subscriptions'].each do |structure| + subscriptions << (Subscription.from_hash(structure) if structure) + end + end + + subscriptions = SKIP unless hash.key?('subscriptions') + # Parameter is an array, so we need to iterate through it + links = nil + unless hash['links'].nil? + links = [] + hash['links'].each do |structure| + links << (LinkDescription.from_hash(structure) if structure) + end + end + + links = SKIP unless hash.key?('links') + + # Create object from extracted values. + SubscriptionCollection.new(subscriptions: subscriptions, + links: links) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} subscriptions: #{@subscriptions}, links: #{@links}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} subscriptions: #{@subscriptions.inspect}, links: #{@links.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_customer_information.rb b/lib/paypal_server_sdk/models/subscription_customer_information.rb new file mode 100644 index 0000000..43e5ea0 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_customer_information.rb @@ -0,0 +1,84 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The details about a customer in PayPal's system of record. + class SubscriptionCustomerInformation < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The unique ID for a customer generated by PayPal. + # @return [String] + attr_accessor :id + + # The internationalized email address. Note: Up to 64 characters are allowed + # before and 255 characters are allowed after the @ sign. However, the + # generally accepted maximum length for an email address is 254 characters. + # The pattern verifies that an unquoted @ sign exists. + # @return [String] + attr_accessor :email_address + + # The phone information. + # @return [PhoneWithType] + attr_accessor :phone + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['id'] = 'id' + @_hash['email_address'] = 'email_address' + @_hash['phone'] = 'phone' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + id + email_address + phone + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(id: SKIP, email_address: SKIP, phone: SKIP) + @id = id unless id == SKIP + @email_address = email_address unless email_address == SKIP + @phone = phone unless phone == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + id = hash.key?('id') ? hash['id'] : SKIP + email_address = hash.key?('email_address') ? hash['email_address'] : SKIP + phone = PhoneWithType.from_hash(hash['phone']) if hash['phone'] + + # Create object from extracted values. + SubscriptionCustomerInformation.new(id: id, + email_address: email_address, + phone: phone) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id}, email_address: #{@email_address}, phone: #{@phone}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id.inspect}, email_address: #{@email_address.inspect}, phone:"\ + " #{@phone.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_patch_application_context.rb b/lib/paypal_server_sdk/models/subscription_patch_application_context.rb new file mode 100644 index 0000000..48db2b8 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_patch_application_context.rb @@ -0,0 +1,122 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The application context, which customizes the payer experience during the + # subscription approval process with PayPal. + class SubscriptionPatchApplicationContext < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The label that overrides the business name in the PayPal account on the + # PayPal site. + # @return [String] + attr_accessor :brand_name + + # The BCP 47-formatted locale of pages that the PayPal payment experience + # shows. PayPal supports a five-character code. For example, `da-DK`, + # `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, + # `zh-CN`, `zh-HK`, or `zh-TW`. + # @return [String] + attr_accessor :locale + + # The location from which the shipping address is derived. + # @return [ExperienceContextShippingPreference] + attr_accessor :shipping_preference + + # The customer and merchant payment preferences. + # @return [PaymentMethod] + attr_accessor :payment_method + + # The URL where the customer is redirected after the customer approves the + # payment. + # @return [String] + attr_accessor :return_url + + # The URL where the customer is redirected after the customer cancels the + # payment. + # @return [String] + attr_accessor :cancel_url + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['brand_name'] = 'brand_name' + @_hash['locale'] = 'locale' + @_hash['shipping_preference'] = 'shipping_preference' + @_hash['payment_method'] = 'payment_method' + @_hash['return_url'] = 'return_url' + @_hash['cancel_url'] = 'cancel_url' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + brand_name + locale + shipping_preference + payment_method + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize( + return_url:, cancel_url:, brand_name: SKIP, locale: SKIP, + shipping_preference: ExperienceContextShippingPreference::GET_FROM_FILE, + payment_method: SKIP + ) + @brand_name = brand_name unless brand_name == SKIP + @locale = locale unless locale == SKIP + @shipping_preference = shipping_preference unless shipping_preference == SKIP + @payment_method = payment_method unless payment_method == SKIP + @return_url = return_url + @cancel_url = cancel_url + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + return_url = hash.key?('return_url') ? hash['return_url'] : nil + cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : nil + brand_name = hash.key?('brand_name') ? hash['brand_name'] : SKIP + locale = hash.key?('locale') ? hash['locale'] : SKIP + shipping_preference = + hash['shipping_preference'] ||= ExperienceContextShippingPreference::GET_FROM_FILE + payment_method = PaymentMethod.from_hash(hash['payment_method']) if hash['payment_method'] + + # Create object from extracted values. + SubscriptionPatchApplicationContext.new(return_url: return_url, + cancel_url: cancel_url, + brand_name: brand_name, + locale: locale, + shipping_preference: shipping_preference, + payment_method: payment_method) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} brand_name: #{@brand_name}, locale: #{@locale}, shipping_preference:"\ + " #{@shipping_preference}, payment_method: #{@payment_method}, return_url: #{@return_url},"\ + " cancel_url: #{@cancel_url}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} brand_name: #{@brand_name.inspect}, locale: #{@locale.inspect},"\ + " shipping_preference: #{@shipping_preference.inspect}, payment_method:"\ + " #{@payment_method.inspect}, return_url: #{@return_url.inspect}, cancel_url:"\ + " #{@cancel_url.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_payer_name.rb b/lib/paypal_server_sdk/models/subscription_payer_name.rb new file mode 100644 index 0000000..e313e5d --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_payer_name.rb @@ -0,0 +1,114 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The name of the party. + class SubscriptionPayerName < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The prefix, or title, to the party's name. + # @return [String] + attr_accessor :prefix + + # When the party is a person, the party's given, or first, name. + # @return [String] + attr_accessor :given_name + + # When the party is a person, the party's surname or family name. Also known + # as the last name. Required when the party is a person. Use also to store + # multiple surnames including the matronymic, or mother's, surname. + # @return [String] + attr_accessor :surname + + # When the party is a person, the party's middle name. Use also to store + # multiple middle names including the patronymic, or father's, middle name. + # @return [String] + attr_accessor :middle_name + + # The suffix for the party's name. + # @return [String] + attr_accessor :suffix + + # When the party is a person, the party's full name. + # @return [String] + attr_accessor :full_name + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['prefix'] = 'prefix' + @_hash['given_name'] = 'given_name' + @_hash['surname'] = 'surname' + @_hash['middle_name'] = 'middle_name' + @_hash['suffix'] = 'suffix' + @_hash['full_name'] = 'full_name' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + prefix + given_name + surname + middle_name + suffix + full_name + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(prefix: SKIP, given_name: SKIP, surname: SKIP, + middle_name: SKIP, suffix: SKIP, full_name: SKIP) + @prefix = prefix unless prefix == SKIP + @given_name = given_name unless given_name == SKIP + @surname = surname unless surname == SKIP + @middle_name = middle_name unless middle_name == SKIP + @suffix = suffix unless suffix == SKIP + @full_name = full_name unless full_name == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + prefix = hash.key?('prefix') ? hash['prefix'] : SKIP + given_name = hash.key?('given_name') ? hash['given_name'] : SKIP + surname = hash.key?('surname') ? hash['surname'] : SKIP + middle_name = hash.key?('middle_name') ? hash['middle_name'] : SKIP + suffix = hash.key?('suffix') ? hash['suffix'] : SKIP + full_name = hash.key?('full_name') ? hash['full_name'] : SKIP + + # Create object from extracted values. + SubscriptionPayerName.new(prefix: prefix, + given_name: given_name, + surname: surname, + middle_name: middle_name, + suffix: suffix, + full_name: full_name) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} prefix: #{@prefix}, given_name: #{@given_name}, surname: #{@surname},"\ + " middle_name: #{@middle_name}, suffix: #{@suffix}, full_name: #{@full_name}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} prefix: #{@prefix.inspect}, given_name: #{@given_name.inspect}, surname:"\ + " #{@surname.inspect}, middle_name: #{@middle_name.inspect}, suffix: #{@suffix.inspect},"\ + " full_name: #{@full_name.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_payment_source.rb b/lib/paypal_server_sdk/models/subscription_payment_source.rb new file mode 100644 index 0000000..40a0dff --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_payment_source.rb @@ -0,0 +1,65 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The payment source definition. To be eligible to create subscription using + # debit or credit card, you will need to sign up here + # (https://www.paypal.com/bizsignup/entry/product/ppcp). Please note, its + # available only for non-3DS cards and for merchants in US and AU regions. + class SubscriptionPaymentSource < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The payment card to use to fund a payment. Can be a credit or debit card. + # @return [SubscriptionCardRequest] + attr_accessor :card + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['card'] = 'card' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + card + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(card: SKIP) + @card = card unless card == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + card = SubscriptionCardRequest.from_hash(hash['card']) if hash['card'] + + # Create object from extracted values. + SubscriptionPaymentSource.new(card: card) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} card: #{@card}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} card: #{@card.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_payment_source_response.rb b/lib/paypal_server_sdk/models/subscription_payment_source_response.rb new file mode 100644 index 0000000..ff8fc70 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_payment_source_response.rb @@ -0,0 +1,63 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The payment source used to fund the payment. + class SubscriptionPaymentSourceResponse < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The payment card used to fund the payment. Card can be a credit or debit + # card. + # @return [CardResponseWithBillingAddress] + attr_accessor :card + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['card'] = 'card' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + card + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(card: SKIP) + @card = card unless card == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + card = CardResponseWithBillingAddress.from_hash(hash['card']) if hash['card'] + + # Create object from extracted values. + SubscriptionPaymentSourceResponse.new(card: card) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} card: #{@card}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} card: #{@card.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_plan_status.rb b/lib/paypal_server_sdk/models/subscription_plan_status.rb new file mode 100644 index 0000000..dddc24a --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_plan_status.rb @@ -0,0 +1,28 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The plan status. + class SubscriptionPlanStatus + SUBSCRIPTION_PLAN_STATUS = [ + # The plan was created. You cannot create subscriptions for a plan in this + # state. + CREATED = 'CREATED'.freeze, + + # The plan is inactive. + INACTIVE = 'INACTIVE'.freeze, + + # The plan is active. You can only create subscriptions for a plan in this + # state. + ACTIVE = 'ACTIVE'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_pricing_model.rb b/lib/paypal_server_sdk/models/subscription_pricing_model.rb new file mode 100644 index 0000000..5d29abb --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_pricing_model.rb @@ -0,0 +1,23 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The pricing model for tiered plan. The `tiers` parameter is required. + class SubscriptionPricingModel + SUBSCRIPTION_PRICING_MODEL = [ + # A volume pricing model. + VOLUME = 'VOLUME'.freeze, + + # A tiered pricing model. + TIERED = 'TIERED'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_pricing_scheme.rb b/lib/paypal_server_sdk/models/subscription_pricing_scheme.rb new file mode 100644 index 0000000..ef9c7dd --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_pricing_scheme.rb @@ -0,0 +1,129 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The pricing scheme details. + class SubscriptionPricingScheme < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The version of the pricing scheme. + # @return [Integer] + attr_accessor :version + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :fixed_price + + # The pricing model for tiered plan. The `tiers` parameter is required. + # @return [SubscriptionPricingModel] + attr_accessor :pricing_model + + # An array of pricing tiers which are used for billing volume/tiered plans. + # pricing_model field has to be specified. + # @return [Array[PricingTier]] + attr_accessor :tiers + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :create_time + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :update_time + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['version'] = 'version' + @_hash['fixed_price'] = 'fixed_price' + @_hash['pricing_model'] = 'pricing_model' + @_hash['tiers'] = 'tiers' + @_hash['create_time'] = 'create_time' + @_hash['update_time'] = 'update_time' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + version + fixed_price + pricing_model + tiers + create_time + update_time + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(version: SKIP, fixed_price: SKIP, pricing_model: SKIP, + tiers: SKIP, create_time: SKIP, update_time: SKIP) + @version = version unless version == SKIP + @fixed_price = fixed_price unless fixed_price == SKIP + @pricing_model = pricing_model unless pricing_model == SKIP + @tiers = tiers unless tiers == SKIP + @create_time = create_time unless create_time == SKIP + @update_time = update_time unless update_time == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + version = hash.key?('version') ? hash['version'] : SKIP + fixed_price = Money.from_hash(hash['fixed_price']) if hash['fixed_price'] + pricing_model = hash.key?('pricing_model') ? hash['pricing_model'] : SKIP + # Parameter is an array, so we need to iterate through it + tiers = nil + unless hash['tiers'].nil? + tiers = [] + hash['tiers'].each do |structure| + tiers << (PricingTier.from_hash(structure) if structure) + end + end + + tiers = SKIP unless hash.key?('tiers') + create_time = hash.key?('create_time') ? hash['create_time'] : SKIP + update_time = hash.key?('update_time') ? hash['update_time'] : SKIP + + # Create object from extracted values. + SubscriptionPricingScheme.new(version: version, + fixed_price: fixed_price, + pricing_model: pricing_model, + tiers: tiers, + create_time: create_time, + update_time: update_time) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} version: #{@version}, fixed_price: #{@fixed_price}, pricing_model:"\ + " #{@pricing_model}, tiers: #{@tiers}, create_time: #{@create_time}, update_time:"\ + " #{@update_time}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} version: #{@version.inspect}, fixed_price: #{@fixed_price.inspect},"\ + " pricing_model: #{@pricing_model.inspect}, tiers: #{@tiers.inspect}, create_time:"\ + " #{@create_time.inspect}, update_time: #{@update_time.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscription_transaction_details.rb b/lib/paypal_server_sdk/models/subscription_transaction_details.rb new file mode 100644 index 0000000..16dfe9e --- /dev/null +++ b/lib/paypal_server_sdk/models/subscription_transaction_details.rb @@ -0,0 +1,118 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The transaction details. + class SubscriptionTransactionDetails < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The status of the captured payment. + # @return [CaptureStatus] + attr_accessor :status + + # The PayPal-generated transaction ID. + # @return [String] + attr_accessor :id + + # The breakdown details for the amount. Includes the gross, tax, fee, and + # shipping amounts. + # @return [SubscriptionAmountWithBreakdown] + attr_accessor :amount_with_breakdown + + # The name of the party. + # @return [SubscriptionPayerName] + attr_accessor :payer_name + + # The internationalized email address. Note: Up to 64 characters are allowed + # before and 255 characters are allowed after the @ sign. However, the + # generally accepted maximum length for an email address is 254 characters. + # The pattern verifies that an unquoted @ sign exists. + # @return [String] + attr_accessor :payer_email + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :time + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['status'] = 'status' + @_hash['id'] = 'id' + @_hash['amount_with_breakdown'] = 'amount_with_breakdown' + @_hash['payer_name'] = 'payer_name' + @_hash['payer_email'] = 'payer_email' + @_hash['time'] = 'time' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + status + payer_name + payer_email + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(id:, amount_with_breakdown:, time:, status: SKIP, + payer_name: SKIP, payer_email: SKIP) + @status = status unless status == SKIP + @id = id + @amount_with_breakdown = amount_with_breakdown + @payer_name = payer_name unless payer_name == SKIP + @payer_email = payer_email unless payer_email == SKIP + @time = time + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + id = hash.key?('id') ? hash['id'] : nil + if hash['amount_with_breakdown'] + amount_with_breakdown = SubscriptionAmountWithBreakdown.from_hash(hash['amount_with_breakdown']) + end + time = hash.key?('time') ? hash['time'] : nil + status = hash.key?('status') ? hash['status'] : SKIP + payer_name = SubscriptionPayerName.from_hash(hash['payer_name']) if hash['payer_name'] + payer_email = hash.key?('payer_email') ? hash['payer_email'] : SKIP + + # Create object from extracted values. + SubscriptionTransactionDetails.new(id: id, + amount_with_breakdown: amount_with_breakdown, + time: time, + status: status, + payer_name: payer_name, + payer_email: payer_email) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} status: #{@status}, id: #{@id}, amount_with_breakdown:"\ + " #{@amount_with_breakdown}, payer_name: #{@payer_name}, payer_email: #{@payer_email}, time:"\ + " #{@time}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} status: #{@status.inspect}, id: #{@id.inspect}, amount_with_breakdown:"\ + " #{@amount_with_breakdown.inspect}, payer_name: #{@payer_name.inspect}, payer_email:"\ + " #{@payer_email.inspect}, time: #{@time.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscriptions_card_attributes.rb b/lib/paypal_server_sdk/models/subscriptions_card_attributes.rb new file mode 100644 index 0000000..bdf9961 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscriptions_card_attributes.rb @@ -0,0 +1,83 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # Additional attributes associated with the use of this card. + class SubscriptionsCardAttributes < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The details about a customer in PayPal's system of record. + # @return [CardCustomer] + attr_accessor :customer + + # Basic vault instruction specification that can be extended by specific + # payment sources that supports vaulting. + # @return [VaultInstructionBase] + attr_accessor :vault + + # The API caller can opt in to verify the card through PayPal offered + # verification services (e.g. Smart Dollar Auth, 3DS). + # @return [CardVerification] + attr_accessor :verification + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['customer'] = 'customer' + @_hash['vault'] = 'vault' + @_hash['verification'] = 'verification' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + customer + vault + verification + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(customer: SKIP, vault: SKIP, verification: SKIP) + @customer = customer unless customer == SKIP + @vault = vault unless vault == SKIP + @verification = verification unless verification == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + customer = CardCustomer.from_hash(hash['customer']) if hash['customer'] + vault = VaultInstructionBase.from_hash(hash['vault']) if hash['vault'] + verification = CardVerification.from_hash(hash['verification']) if hash['verification'] + + # Create object from extracted values. + SubscriptionsCardAttributes.new(customer: customer, + vault: vault, + verification: verification) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} customer: #{@customer}, vault: #{@vault}, verification: #{@verification}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} customer: #{@customer.inspect}, vault: #{@vault.inspect}, verification:"\ + " #{@verification.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/subscriptions_card_brand.rb b/lib/paypal_server_sdk/models/subscriptions_card_brand.rb new file mode 100644 index 0000000..2b7ebe8 --- /dev/null +++ b/lib/paypal_server_sdk/models/subscriptions_card_brand.rb @@ -0,0 +1,97 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The card network or brand. Applies to credit, debit, gift, and payment + # cards. + class SubscriptionsCardBrand + SUBSCRIPTIONS_CARD_BRAND = [ + # Visa card. + VISA = 'VISA'.freeze, + + # Mastercard card. + MASTERCARD = 'MASTERCARD'.freeze, + + # Discover card. + DISCOVER = 'DISCOVER'.freeze, + + # American Express card. + AMEX = 'AMEX'.freeze, + + # Solo debit card. + SOLO = 'SOLO'.freeze, + + # Japan Credit Bureau card. + JCB = 'JCB'.freeze, + + # Military Star card. + STAR = 'STAR'.freeze, + + # Delta Airlines card. + DELTA = 'DELTA'.freeze, + + # Switch credit card. + SWITCH = 'SWITCH'.freeze, + + # Maestro credit card. + MAESTRO = 'MAESTRO'.freeze, + + # Carte Bancaire (CB) credit card. + CB_NATIONALE = 'CB_NATIONALE'.freeze, + + # Configoga credit card. + CONFIGOGA = 'CONFIGOGA'.freeze, + + # Confidis credit card. + CONFIDIS = 'CONFIDIS'.freeze, + + # Visa Electron credit card. + ELECTRON = 'ELECTRON'.freeze, + + # Cetelem credit card. + CETELEM = 'CETELEM'.freeze, + + # China union pay credit card. + CHINA_UNION_PAY = 'CHINA_UNION_PAY'.freeze, + + # The Diners Club International banking and payment services capability + # network owned by Discover Financial Services (DFS), one of the most + # recognized brands in US financial services. + DINERS = 'DINERS'.freeze, + + # The Brazilian Elo card payment network. + ELO = 'ELO'.freeze, + + # The Hiper - Ingenico ePayment network. + HIPER = 'HIPER'.freeze, + + # The Brazilian Hipercard payment network that's widely accepted in the + # retail market. + HIPERCARD = 'HIPERCARD'.freeze, + + # The RuPay payment network. + RUPAY = 'RUPAY'.freeze, + + # The GE Credit Union 3Point card payment network. + GE = 'GE'.freeze, + + # The Synchrony Financial (SYF) payment network. + SYNCHRONY = 'SYNCHRONY'.freeze, + + # The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment + # network. + EFTPOS = 'EFTPOS'.freeze, + + # UNKNOWN payment network. + UNKNOWN = 'UNKNOWN'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/supplementary_data.rb b/lib/paypal_server_sdk/models/supplementary_data.rb index 506bab4..61d0483 100644 --- a/lib/paypal_server_sdk/models/supplementary_data.rb +++ b/lib/paypal_server_sdk/models/supplementary_data.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Supplementary data about a payment. This object passes information that can diff --git a/lib/paypal_server_sdk/models/supplementary_purchase_data.rb b/lib/paypal_server_sdk/models/supplementary_purchase_data.rb deleted file mode 100644 index 089f3ba..0000000 --- a/lib/paypal_server_sdk/models/supplementary_purchase_data.rb +++ /dev/null @@ -1,76 +0,0 @@ -# paypal_server_sdk -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module PaypalServerSdk - # The capture identification-related fields. Includes the invoice ID, custom - # ID, note to payer, and soft descriptor. - class SupplementaryPurchaseData < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The API caller-provided external invoice number for this order. Appears in - # both the payer's transaction history and the emails that the payer - # receives. - # @return [String] - attr_accessor :invoice_id - - # An informational note about this settlement. Appears in both the payer's - # transaction history and the emails that the payer receives. - # @return [String] - attr_accessor :note_to_payer - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['invoice_id'] = 'invoice_id' - @_hash['note_to_payer'] = 'note_to_payer' - @_hash - end - - # An array for optional fields - def self.optionals - %w[ - invoice_id - note_to_payer - ] - end - - # An array for nullable fields - def self.nullables - [] - end - - def initialize(invoice_id: SKIP, note_to_payer: SKIP) - @invoice_id = invoice_id unless invoice_id == SKIP - @note_to_payer = note_to_payer unless note_to_payer == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP - note_to_payer = hash.key?('note_to_payer') ? hash['note_to_payer'] : SKIP - - # Create object from extracted values. - SupplementaryPurchaseData.new(invoice_id: invoice_id, - note_to_payer: note_to_payer) - end - - # Provides a human-readable string representation of the object. - def to_s - class_name = self.class.name.split('::').last - "<#{class_name} invoice_id: #{@invoice_id}, note_to_payer: #{@note_to_payer}>" - end - - # Provides a debugging-friendly string with detailed object information. - def inspect - class_name = self.class.name.split('::').last - "<#{class_name} invoice_id: #{@invoice_id.inspect}, note_to_payer:"\ - " #{@note_to_payer.inspect}>" - end - end -end diff --git a/lib/paypal_server_sdk/models/suspend_subscription.rb b/lib/paypal_server_sdk/models/suspend_subscription.rb new file mode 100644 index 0000000..3e67e5f --- /dev/null +++ b/lib/paypal_server_sdk/models/suspend_subscription.rb @@ -0,0 +1,60 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The suspend subscription request details. + class SuspendSubscription < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The reason for suspension of the Subscription. + # @return [String] + attr_accessor :reason + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['reason'] = 'reason' + @_hash + end + + # An array for optional fields + def self.optionals + [] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(reason:) + @reason = reason + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + reason = hash.key?('reason') ? hash['reason'] : nil + + # Create object from extracted values. + SuspendSubscription.new(reason: reason) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} reason: #{@reason}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} reason: #{@reason.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/tax_amount.rb b/lib/paypal_server_sdk/models/tax_amount.rb new file mode 100644 index 0000000..e1e1419 --- /dev/null +++ b/lib/paypal_server_sdk/models/tax_amount.rb @@ -0,0 +1,63 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The tax levied by a government on the purchase of goods or services. + class TaxAmount < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :tax_amount + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['tax_amount'] = 'tax_amount' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + tax_amount + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(tax_amount: SKIP) + @tax_amount = tax_amount unless tax_amount == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + tax_amount = Money.from_hash(hash['tax_amount']) if hash['tax_amount'] + + # Create object from extracted values. + TaxAmount.new(tax_amount: tax_amount) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} tax_amount: #{@tax_amount}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} tax_amount: #{@tax_amount.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/tax_id_type.rb b/lib/paypal_server_sdk/models/tax_id_type.rb index f970dd3..b35cff4 100644 --- a/lib/paypal_server_sdk/models/tax_id_type.rb +++ b/lib/paypal_server_sdk/models/tax_id_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The customer's tax ID type. diff --git a/lib/paypal_server_sdk/models/tax_info.rb b/lib/paypal_server_sdk/models/tax_info.rb index 564d134..e9a40ce 100644 --- a/lib/paypal_server_sdk/models/tax_info.rb +++ b/lib/paypal_server_sdk/models/tax_info.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The tax ID of the customer. The customer is also known as the payer. Both diff --git a/lib/paypal_server_sdk/models/taxes.rb b/lib/paypal_server_sdk/models/taxes.rb new file mode 100644 index 0000000..4e1a2dd --- /dev/null +++ b/lib/paypal_server_sdk/models/taxes.rb @@ -0,0 +1,71 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The tax details. + class Taxes < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The percentage, as a fixed-point, signed decimal number. For example, + # define a 19.99% interest rate as `19.99`. + # @return [String] + attr_accessor :percentage + + # Indicates whether the tax was already included in the billing amount. + # @return [TrueClass | FalseClass] + attr_accessor :inclusive + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['percentage'] = 'percentage' + @_hash['inclusive'] = 'inclusive' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + inclusive + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(percentage:, inclusive: true) + @percentage = percentage + @inclusive = inclusive unless inclusive == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + percentage = hash.key?('percentage') ? hash['percentage'] : nil + inclusive = hash['inclusive'] ||= true + + # Create object from extracted values. + Taxes.new(percentage: percentage, + inclusive: inclusive) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} percentage: #{@percentage}, inclusive: #{@inclusive}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} percentage: #{@percentage.inspect}, inclusive: #{@inclusive.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/taxes_override.rb b/lib/paypal_server_sdk/models/taxes_override.rb new file mode 100644 index 0000000..1bd3edd --- /dev/null +++ b/lib/paypal_server_sdk/models/taxes_override.rb @@ -0,0 +1,72 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The tax details. + class TaxesOverride < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The percentage, as a fixed-point, signed decimal number. For example, + # define a 19.99% interest rate as `19.99`. + # @return [String] + attr_accessor :percentage + + # Indicates whether the tax was already included in the billing amount. + # @return [TrueClass | FalseClass] + attr_accessor :inclusive + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['percentage'] = 'percentage' + @_hash['inclusive'] = 'inclusive' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + percentage + inclusive + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(percentage: SKIP, inclusive: SKIP) + @percentage = percentage unless percentage == SKIP + @inclusive = inclusive unless inclusive == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + percentage = hash.key?('percentage') ? hash['percentage'] : SKIP + inclusive = hash.key?('inclusive') ? hash['inclusive'] : SKIP + + # Create object from extracted values. + TaxesOverride.new(percentage: percentage, + inclusive: inclusive) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} percentage: #{@percentage}, inclusive: #{@inclusive}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} percentage: #{@percentage.inspect}, inclusive: #{@inclusive.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/tenure_type.rb b/lib/paypal_server_sdk/models/tenure_type.rb index e375def..69218ee 100644 --- a/lib/paypal_server_sdk/models/tenure_type.rb +++ b/lib/paypal_server_sdk/models/tenure_type.rb @@ -1,11 +1,13 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The tenure type of the billing cycle identifies if the billing cycle is a - # trial(free or discounted) or regular billing cycle. + # trial(free or discounted) or regular billing cycle., The tenure type of the + # billing cycle. In case of a plan having trial cycle, only 2 trial cycles are + # allowed per plan., The type of the billing cycle. class TenureType TENURE_TYPE = [ # A regular billing cycle to identify recurring charges for the billing diff --git a/lib/paypal_server_sdk/models/three_d_secure_authentication_response.rb b/lib/paypal_server_sdk/models/three_d_secure_authentication_response.rb index ce5664f..61cb717 100644 --- a/lib/paypal_server_sdk/models/three_d_secure_authentication_response.rb +++ b/lib/paypal_server_sdk/models/three_d_secure_authentication_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Results of 3D Secure Authentication. diff --git a/lib/paypal_server_sdk/models/three_d_secure_card_authentication_response.rb b/lib/paypal_server_sdk/models/three_d_secure_card_authentication_response.rb index 2129dff..1009ada 100644 --- a/lib/paypal_server_sdk/models/three_d_secure_card_authentication_response.rb +++ b/lib/paypal_server_sdk/models/three_d_secure_card_authentication_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Results of 3D Secure Authentication. diff --git a/lib/paypal_server_sdk/models/token.rb b/lib/paypal_server_sdk/models/token.rb index 4ac5af8..1be4513 100644 --- a/lib/paypal_server_sdk/models/token.rb +++ b/lib/paypal_server_sdk/models/token.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The tokenized payment source to fund a payment. diff --git a/lib/paypal_server_sdk/models/token_type.rb b/lib/paypal_server_sdk/models/token_type.rb index 8cd13ea..6622528 100644 --- a/lib/paypal_server_sdk/models/token_type.rb +++ b/lib/paypal_server_sdk/models/token_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The tokenization method that generated the ID. diff --git a/lib/paypal_server_sdk/models/transaction_details.rb b/lib/paypal_server_sdk/models/transaction_details.rb new file mode 100644 index 0000000..1e67a5c --- /dev/null +++ b/lib/paypal_server_sdk/models/transaction_details.rb @@ -0,0 +1,126 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The transaction details. + class TransactionDetails < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The transaction information. + # @return [TransactionInformation] + attr_accessor :transaction_info + + # The payer information. + # @return [PayerInformation] + attr_accessor :payer_info + + # The shipping information. + # @return [ShippingInformation] + attr_accessor :shipping_info + + # The cart information. + # @return [CartInformation] + attr_accessor :cart_info + + # The store information. + # @return [StoreInformation] + attr_accessor :store_info + + # The auction information. + # @return [AuctionInformation] + attr_accessor :auction_info + + # The incentive details. + # @return [IncentiveInformation] + attr_accessor :incentive_info + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['transaction_info'] = 'transaction_info' + @_hash['payer_info'] = 'payer_info' + @_hash['shipping_info'] = 'shipping_info' + @_hash['cart_info'] = 'cart_info' + @_hash['store_info'] = 'store_info' + @_hash['auction_info'] = 'auction_info' + @_hash['incentive_info'] = 'incentive_info' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + transaction_info + payer_info + shipping_info + cart_info + store_info + auction_info + incentive_info + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(transaction_info: SKIP, payer_info: SKIP, + shipping_info: SKIP, cart_info: SKIP, store_info: SKIP, + auction_info: SKIP, incentive_info: SKIP) + @transaction_info = transaction_info unless transaction_info == SKIP + @payer_info = payer_info unless payer_info == SKIP + @shipping_info = shipping_info unless shipping_info == SKIP + @cart_info = cart_info unless cart_info == SKIP + @store_info = store_info unless store_info == SKIP + @auction_info = auction_info unless auction_info == SKIP + @incentive_info = incentive_info unless incentive_info == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + transaction_info = TransactionInformation.from_hash(hash['transaction_info']) if + hash['transaction_info'] + payer_info = PayerInformation.from_hash(hash['payer_info']) if hash['payer_info'] + shipping_info = ShippingInformation.from_hash(hash['shipping_info']) if + hash['shipping_info'] + cart_info = CartInformation.from_hash(hash['cart_info']) if hash['cart_info'] + store_info = StoreInformation.from_hash(hash['store_info']) if hash['store_info'] + auction_info = AuctionInformation.from_hash(hash['auction_info']) if hash['auction_info'] + incentive_info = IncentiveInformation.from_hash(hash['incentive_info']) if + hash['incentive_info'] + + # Create object from extracted values. + TransactionDetails.new(transaction_info: transaction_info, + payer_info: payer_info, + shipping_info: shipping_info, + cart_info: cart_info, + store_info: store_info, + auction_info: auction_info, + incentive_info: incentive_info) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} transaction_info: #{@transaction_info}, payer_info: #{@payer_info},"\ + " shipping_info: #{@shipping_info}, cart_info: #{@cart_info}, store_info: #{@store_info},"\ + " auction_info: #{@auction_info}, incentive_info: #{@incentive_info}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} transaction_info: #{@transaction_info.inspect}, payer_info:"\ + " #{@payer_info.inspect}, shipping_info: #{@shipping_info.inspect}, cart_info:"\ + " #{@cart_info.inspect}, store_info: #{@store_info.inspect}, auction_info:"\ + " #{@auction_info.inspect}, incentive_info: #{@incentive_info.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/transaction_information.rb b/lib/paypal_server_sdk/models/transaction_information.rb new file mode 100644 index 0000000..758345f --- /dev/null +++ b/lib/paypal_server_sdk/models/transaction_information.rb @@ -0,0 +1,494 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The transaction information. + class TransactionInformation < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The ID of the PayPal account of the counterparty. + # @return [String] + attr_accessor :paypal_account_id + + # The PayPal-generated transaction ID. + # @return [String] + attr_accessor :transaction_id + + # The PayPal-generated base ID. PayPal exclusive. Cannot be altered. Defined + # as a related, pre-existing transaction or event. + # @return [String] + attr_accessor :paypal_reference_id + + # The PayPal reference ID type. + # @return [PaypalReferenceIdType] + attr_accessor :paypal_reference_id_type + + # A five-digit transaction event code that classifies the transaction type + # based on money movement and debit or credit. For example, T0001. See + # [Transaction event + # codes](/docs/integration/direct/transaction-search/transaction-event-codes + # /). + # @return [String] + attr_accessor :transaction_event_code + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :transaction_initiation_date + + # The date and time, in [Internet date and time + # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are + # required while fractional seconds are optional. Note: The regular + # expression provides guidance but does not reject all invalid dates. + # @return [String] + attr_accessor :transaction_updated_date + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :transaction_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :fee_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :discount_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :insurance_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :sales_tax_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :shipping_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :shipping_discount_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :shipping_tax_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :other_amount + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :tip_amount + + # A code that indicates the transaction status. Value is: Status code + # Description D PayPal or merchant rules denied the transaction. P The + # transaction is pending. The transaction was created but waits for another + # payment process to complete, such as an ACH transaction, before the status + # changes to S. S The transaction successfully completed without a denial + # and after any pending statuses. V A successful transaction was fully + # reversed and funds were refunded to the original sender. + # @return [String] + attr_accessor :transaction_status + + # The subject of payment. The payer passes this value to the payee. The + # payer controls this data through the interface through which he or she + # sends the data. + # @return [String] + attr_accessor :transaction_subject + + # A special note that the payer passes to the payee. Might contain special + # customer requests, such as shipping instructions. + # @return [String] + attr_accessor :transaction_note + + # The payment tracking ID, which is a unique ID that partners specify to + # either get information about a payment or request a refund. + # @return [String] + attr_accessor :payment_tracking_id + + # The bank reference ID. The bank provides this value for an ACH + # transaction. + # @return [String] + attr_accessor :bank_reference_id + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :ending_balance + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :available_balance + + # The invoice ID that is sent by the merchant with the transaction. Note: If + # an invoice ID was sent with the capture request, the value is reported. + # Otherwise, the invoice ID of the authorizing transaction is reported. + # @return [String] + attr_accessor :invoice_id + + # The merchant-provided custom text. Note: Usually, this field includes the + # unique ID for payments made with MassPay type transaction. + # @return [String] + attr_accessor :custom_field + + # Indicates whether the transaction is eligible for protection. Value is: + # 01. Eligible. 02. Not eligible 03. Partially eligible. + # @return [String] + attr_accessor :protection_eligibility + + # The credit term. The time span covered by the installment payments as + # expressed in the term length plus the length time unit code. + # @return [String] + attr_accessor :credit_term + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :credit_transactional_fee + + # The currency and amount for a financial transaction, such as a balance or + # payment due. + # @return [Money] + attr_accessor :credit_promotional_fee + + # The percentage, as a fixed-point, signed decimal number. For example, + # define a 19.99% interest rate as `19.99`. + # @return [String] + attr_accessor :annual_percentage_rate + + # The payment method that was used for a transaction. Value is PUI, + # installment, or mEFT. Note: Appears only for pay upon invoice (PUI), + # installment, and mEFT transactions. Merchants and partners in the EMEA + # region can use this attribute to note transactions that attract turn-over + # tax. + # @return [String] + attr_accessor :payment_method_type + + # A high-level classification of the type of financial instrument that was + # used to fund a payment. The pattern is not provided because the value is + # defined by an external party. E.g. PAYPAL, CREDIT_CARD, DEBIT_CARD, + # APPLE_PAY, BANK , VENMO ,Pay Upon Invoice, Pay Later or Alternative + # Payment Methods (APM). + # @return [String] + attr_accessor :instrument_type + + # A finer-grained classification of the financial instrument that was used + # to fund a payment. For example, `Visa card` or a `Mastercard` for a credit + # card, BANKCARD ,DISCOVER etc. The pattern is not provided because the + # value is defined by an external party. + # @return [String] + attr_accessor :instrument_sub_type + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['paypal_account_id'] = 'paypal_account_id' + @_hash['transaction_id'] = 'transaction_id' + @_hash['paypal_reference_id'] = 'paypal_reference_id' + @_hash['paypal_reference_id_type'] = 'paypal_reference_id_type' + @_hash['transaction_event_code'] = 'transaction_event_code' + @_hash['transaction_initiation_date'] = 'transaction_initiation_date' + @_hash['transaction_updated_date'] = 'transaction_updated_date' + @_hash['transaction_amount'] = 'transaction_amount' + @_hash['fee_amount'] = 'fee_amount' + @_hash['discount_amount'] = 'discount_amount' + @_hash['insurance_amount'] = 'insurance_amount' + @_hash['sales_tax_amount'] = 'sales_tax_amount' + @_hash['shipping_amount'] = 'shipping_amount' + @_hash['shipping_discount_amount'] = 'shipping_discount_amount' + @_hash['shipping_tax_amount'] = 'shipping_tax_amount' + @_hash['other_amount'] = 'other_amount' + @_hash['tip_amount'] = 'tip_amount' + @_hash['transaction_status'] = 'transaction_status' + @_hash['transaction_subject'] = 'transaction_subject' + @_hash['transaction_note'] = 'transaction_note' + @_hash['payment_tracking_id'] = 'payment_tracking_id' + @_hash['bank_reference_id'] = 'bank_reference_id' + @_hash['ending_balance'] = 'ending_balance' + @_hash['available_balance'] = 'available_balance' + @_hash['invoice_id'] = 'invoice_id' + @_hash['custom_field'] = 'custom_field' + @_hash['protection_eligibility'] = 'protection_eligibility' + @_hash['credit_term'] = 'credit_term' + @_hash['credit_transactional_fee'] = 'credit_transactional_fee' + @_hash['credit_promotional_fee'] = 'credit_promotional_fee' + @_hash['annual_percentage_rate'] = 'annual_percentage_rate' + @_hash['payment_method_type'] = 'payment_method_type' + @_hash['instrument_type'] = 'instrument_type' + @_hash['instrument_sub_type'] = 'instrument_sub_type' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + paypal_account_id + transaction_id + paypal_reference_id + paypal_reference_id_type + transaction_event_code + transaction_initiation_date + transaction_updated_date + transaction_amount + fee_amount + discount_amount + insurance_amount + sales_tax_amount + shipping_amount + shipping_discount_amount + shipping_tax_amount + other_amount + tip_amount + transaction_status + transaction_subject + transaction_note + payment_tracking_id + bank_reference_id + ending_balance + available_balance + invoice_id + custom_field + protection_eligibility + credit_term + credit_transactional_fee + credit_promotional_fee + annual_percentage_rate + payment_method_type + instrument_type + instrument_sub_type + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(paypal_account_id: SKIP, transaction_id: SKIP, + paypal_reference_id: SKIP, paypal_reference_id_type: SKIP, + transaction_event_code: SKIP, + transaction_initiation_date: SKIP, + transaction_updated_date: SKIP, transaction_amount: SKIP, + fee_amount: SKIP, discount_amount: SKIP, + insurance_amount: SKIP, sales_tax_amount: SKIP, + shipping_amount: SKIP, shipping_discount_amount: SKIP, + shipping_tax_amount: SKIP, other_amount: SKIP, + tip_amount: SKIP, transaction_status: SKIP, + transaction_subject: SKIP, transaction_note: SKIP, + payment_tracking_id: SKIP, bank_reference_id: SKIP, + ending_balance: SKIP, available_balance: SKIP, + invoice_id: SKIP, custom_field: SKIP, + protection_eligibility: SKIP, credit_term: SKIP, + credit_transactional_fee: SKIP, credit_promotional_fee: SKIP, + annual_percentage_rate: SKIP, payment_method_type: SKIP, + instrument_type: SKIP, instrument_sub_type: SKIP) + @paypal_account_id = paypal_account_id unless paypal_account_id == SKIP + @transaction_id = transaction_id unless transaction_id == SKIP + @paypal_reference_id = paypal_reference_id unless paypal_reference_id == SKIP + @paypal_reference_id_type = paypal_reference_id_type unless paypal_reference_id_type == SKIP + @transaction_event_code = transaction_event_code unless transaction_event_code == SKIP + unless transaction_initiation_date == SKIP + @transaction_initiation_date = + transaction_initiation_date + end + @transaction_updated_date = transaction_updated_date unless transaction_updated_date == SKIP + @transaction_amount = transaction_amount unless transaction_amount == SKIP + @fee_amount = fee_amount unless fee_amount == SKIP + @discount_amount = discount_amount unless discount_amount == SKIP + @insurance_amount = insurance_amount unless insurance_amount == SKIP + @sales_tax_amount = sales_tax_amount unless sales_tax_amount == SKIP + @shipping_amount = shipping_amount unless shipping_amount == SKIP + @shipping_discount_amount = shipping_discount_amount unless shipping_discount_amount == SKIP + @shipping_tax_amount = shipping_tax_amount unless shipping_tax_amount == SKIP + @other_amount = other_amount unless other_amount == SKIP + @tip_amount = tip_amount unless tip_amount == SKIP + @transaction_status = transaction_status unless transaction_status == SKIP + @transaction_subject = transaction_subject unless transaction_subject == SKIP + @transaction_note = transaction_note unless transaction_note == SKIP + @payment_tracking_id = payment_tracking_id unless payment_tracking_id == SKIP + @bank_reference_id = bank_reference_id unless bank_reference_id == SKIP + @ending_balance = ending_balance unless ending_balance == SKIP + @available_balance = available_balance unless available_balance == SKIP + @invoice_id = invoice_id unless invoice_id == SKIP + @custom_field = custom_field unless custom_field == SKIP + @protection_eligibility = protection_eligibility unless protection_eligibility == SKIP + @credit_term = credit_term unless credit_term == SKIP + @credit_transactional_fee = credit_transactional_fee unless credit_transactional_fee == SKIP + @credit_promotional_fee = credit_promotional_fee unless credit_promotional_fee == SKIP + @annual_percentage_rate = annual_percentage_rate unless annual_percentage_rate == SKIP + @payment_method_type = payment_method_type unless payment_method_type == SKIP + @instrument_type = instrument_type unless instrument_type == SKIP + @instrument_sub_type = instrument_sub_type unless instrument_sub_type == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + paypal_account_id = + hash.key?('paypal_account_id') ? hash['paypal_account_id'] : SKIP + transaction_id = + hash.key?('transaction_id') ? hash['transaction_id'] : SKIP + paypal_reference_id = + hash.key?('paypal_reference_id') ? hash['paypal_reference_id'] : SKIP + paypal_reference_id_type = + hash.key?('paypal_reference_id_type') ? hash['paypal_reference_id_type'] : SKIP + transaction_event_code = + hash.key?('transaction_event_code') ? hash['transaction_event_code'] : SKIP + transaction_initiation_date = + hash.key?('transaction_initiation_date') ? hash['transaction_initiation_date'] : SKIP + transaction_updated_date = + hash.key?('transaction_updated_date') ? hash['transaction_updated_date'] : SKIP + transaction_amount = Money.from_hash(hash['transaction_amount']) if + hash['transaction_amount'] + fee_amount = Money.from_hash(hash['fee_amount']) if hash['fee_amount'] + discount_amount = Money.from_hash(hash['discount_amount']) if hash['discount_amount'] + insurance_amount = Money.from_hash(hash['insurance_amount']) if hash['insurance_amount'] + sales_tax_amount = Money.from_hash(hash['sales_tax_amount']) if hash['sales_tax_amount'] + shipping_amount = Money.from_hash(hash['shipping_amount']) if hash['shipping_amount'] + shipping_discount_amount = Money.from_hash(hash['shipping_discount_amount']) if + hash['shipping_discount_amount'] + shipping_tax_amount = Money.from_hash(hash['shipping_tax_amount']) if + hash['shipping_tax_amount'] + other_amount = Money.from_hash(hash['other_amount']) if hash['other_amount'] + tip_amount = Money.from_hash(hash['tip_amount']) if hash['tip_amount'] + transaction_status = + hash.key?('transaction_status') ? hash['transaction_status'] : SKIP + transaction_subject = + hash.key?('transaction_subject') ? hash['transaction_subject'] : SKIP + transaction_note = + hash.key?('transaction_note') ? hash['transaction_note'] : SKIP + payment_tracking_id = + hash.key?('payment_tracking_id') ? hash['payment_tracking_id'] : SKIP + bank_reference_id = + hash.key?('bank_reference_id') ? hash['bank_reference_id'] : SKIP + ending_balance = Money.from_hash(hash['ending_balance']) if hash['ending_balance'] + available_balance = Money.from_hash(hash['available_balance']) if hash['available_balance'] + invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP + custom_field = hash.key?('custom_field') ? hash['custom_field'] : SKIP + protection_eligibility = + hash.key?('protection_eligibility') ? hash['protection_eligibility'] : SKIP + credit_term = hash.key?('credit_term') ? hash['credit_term'] : SKIP + credit_transactional_fee = Money.from_hash(hash['credit_transactional_fee']) if + hash['credit_transactional_fee'] + credit_promotional_fee = Money.from_hash(hash['credit_promotional_fee']) if + hash['credit_promotional_fee'] + annual_percentage_rate = + hash.key?('annual_percentage_rate') ? hash['annual_percentage_rate'] : SKIP + payment_method_type = + hash.key?('payment_method_type') ? hash['payment_method_type'] : SKIP + instrument_type = + hash.key?('instrument_type') ? hash['instrument_type'] : SKIP + instrument_sub_type = + hash.key?('instrument_sub_type') ? hash['instrument_sub_type'] : SKIP + + # Create object from extracted values. + TransactionInformation.new(paypal_account_id: paypal_account_id, + transaction_id: transaction_id, + paypal_reference_id: paypal_reference_id, + paypal_reference_id_type: paypal_reference_id_type, + transaction_event_code: transaction_event_code, + transaction_initiation_date: transaction_initiation_date, + transaction_updated_date: transaction_updated_date, + transaction_amount: transaction_amount, + fee_amount: fee_amount, + discount_amount: discount_amount, + insurance_amount: insurance_amount, + sales_tax_amount: sales_tax_amount, + shipping_amount: shipping_amount, + shipping_discount_amount: shipping_discount_amount, + shipping_tax_amount: shipping_tax_amount, + other_amount: other_amount, + tip_amount: tip_amount, + transaction_status: transaction_status, + transaction_subject: transaction_subject, + transaction_note: transaction_note, + payment_tracking_id: payment_tracking_id, + bank_reference_id: bank_reference_id, + ending_balance: ending_balance, + available_balance: available_balance, + invoice_id: invoice_id, + custom_field: custom_field, + protection_eligibility: protection_eligibility, + credit_term: credit_term, + credit_transactional_fee: credit_transactional_fee, + credit_promotional_fee: credit_promotional_fee, + annual_percentage_rate: annual_percentage_rate, + payment_method_type: payment_method_type, + instrument_type: instrument_type, + instrument_sub_type: instrument_sub_type) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} paypal_account_id: #{@paypal_account_id}, transaction_id:"\ + " #{@transaction_id}, paypal_reference_id: #{@paypal_reference_id},"\ + " paypal_reference_id_type: #{@paypal_reference_id_type}, transaction_event_code:"\ + " #{@transaction_event_code}, transaction_initiation_date: #{@transaction_initiation_date},"\ + " transaction_updated_date: #{@transaction_updated_date}, transaction_amount:"\ + " #{@transaction_amount}, fee_amount: #{@fee_amount}, discount_amount: #{@discount_amount},"\ + " insurance_amount: #{@insurance_amount}, sales_tax_amount: #{@sales_tax_amount},"\ + " shipping_amount: #{@shipping_amount}, shipping_discount_amount:"\ + " #{@shipping_discount_amount}, shipping_tax_amount: #{@shipping_tax_amount}, other_amount:"\ + " #{@other_amount}, tip_amount: #{@tip_amount}, transaction_status: #{@transaction_status},"\ + " transaction_subject: #{@transaction_subject}, transaction_note: #{@transaction_note},"\ + " payment_tracking_id: #{@payment_tracking_id}, bank_reference_id: #{@bank_reference_id},"\ + " ending_balance: #{@ending_balance}, available_balance: #{@available_balance}, invoice_id:"\ + " #{@invoice_id}, custom_field: #{@custom_field}, protection_eligibility:"\ + " #{@protection_eligibility}, credit_term: #{@credit_term}, credit_transactional_fee:"\ + " #{@credit_transactional_fee}, credit_promotional_fee: #{@credit_promotional_fee},"\ + " annual_percentage_rate: #{@annual_percentage_rate}, payment_method_type:"\ + " #{@payment_method_type}, instrument_type: #{@instrument_type}, instrument_sub_type:"\ + " #{@instrument_sub_type}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} paypal_account_id: #{@paypal_account_id.inspect}, transaction_id:"\ + " #{@transaction_id.inspect}, paypal_reference_id: #{@paypal_reference_id.inspect},"\ + " paypal_reference_id_type: #{@paypal_reference_id_type.inspect}, transaction_event_code:"\ + " #{@transaction_event_code.inspect}, transaction_initiation_date:"\ + " #{@transaction_initiation_date.inspect}, transaction_updated_date:"\ + " #{@transaction_updated_date.inspect}, transaction_amount: #{@transaction_amount.inspect},"\ + " fee_amount: #{@fee_amount.inspect}, discount_amount: #{@discount_amount.inspect},"\ + " insurance_amount: #{@insurance_amount.inspect}, sales_tax_amount:"\ + " #{@sales_tax_amount.inspect}, shipping_amount: #{@shipping_amount.inspect},"\ + " shipping_discount_amount: #{@shipping_discount_amount.inspect}, shipping_tax_amount:"\ + " #{@shipping_tax_amount.inspect}, other_amount: #{@other_amount.inspect}, tip_amount:"\ + " #{@tip_amount.inspect}, transaction_status: #{@transaction_status.inspect},"\ + " transaction_subject: #{@transaction_subject.inspect}, transaction_note:"\ + " #{@transaction_note.inspect}, payment_tracking_id: #{@payment_tracking_id.inspect},"\ + " bank_reference_id: #{@bank_reference_id.inspect}, ending_balance:"\ + " #{@ending_balance.inspect}, available_balance: #{@available_balance.inspect}, invoice_id:"\ + " #{@invoice_id.inspect}, custom_field: #{@custom_field.inspect}, protection_eligibility:"\ + " #{@protection_eligibility.inspect}, credit_term: #{@credit_term.inspect},"\ + " credit_transactional_fee: #{@credit_transactional_fee.inspect}, credit_promotional_fee:"\ + " #{@credit_promotional_fee.inspect}, annual_percentage_rate:"\ + " #{@annual_percentage_rate.inspect}, payment_method_type: #{@payment_method_type.inspect},"\ + " instrument_type: #{@instrument_type.inspect}, instrument_sub_type:"\ + " #{@instrument_sub_type.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb b/lib/paypal_server_sdk/models/transaction_search_error_details.rb similarity index 55% rename from lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb rename to lib/paypal_server_sdk/models/transaction_search_error_details.rb index 042931c..483b79d 100644 --- a/lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb +++ b/lib/paypal_server_sdk/models/transaction_search_error_details.rb @@ -1,11 +1,11 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The error details. Required for client-side `4XX` errors. - class OrderUpdateCallbackErrorResponseDetails < BaseModel + class TransactionSearchErrorDetails < BaseModel SKIP = Object.new private_constant :SKIP @@ -18,16 +18,28 @@ class OrderUpdateCallbackErrorResponseDetails < BaseModel # @return [String] attr_accessor :value + # The location of the field that caused the error. Value is `body`, `path`, + # or `query`. + # @return [String] + attr_accessor :location + # The unique, fine-grained application-level error code. # @return [String] attr_accessor :issue + # The human-readable description for an issue. The description can change + # over the lifetime of an API, so clients must not depend on this value. + # @return [String] + attr_accessor :description + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @_hash['field'] = 'field' @_hash['value'] = 'value' + @_hash['location'] = 'location' @_hash['issue'] = 'issue' + @_hash['description'] = 'description' @_hash end @@ -36,6 +48,8 @@ def self.optionals %w[ field value + location + description ] end @@ -44,10 +58,13 @@ def self.nullables [] end - def initialize(issue:, field: SKIP, value: SKIP) + def initialize(issue:, field: SKIP, value: SKIP, location: 'body', + description: SKIP) @field = field unless field == SKIP @value = value unless value == SKIP + @location = location unless location == SKIP @issue = issue + @description = description unless description == SKIP end # Creates an instance of the object from a hash. @@ -58,24 +75,29 @@ def self.from_hash(hash) issue = hash.key?('issue') ? hash['issue'] : nil field = hash.key?('field') ? hash['field'] : SKIP value = hash.key?('value') ? hash['value'] : SKIP + location = hash['location'] ||= 'body' + description = hash.key?('description') ? hash['description'] : SKIP # Create object from extracted values. - OrderUpdateCallbackErrorResponseDetails.new(issue: issue, - field: field, - value: value) + TransactionSearchErrorDetails.new(issue: issue, + field: field, + value: value, + location: location, + description: description) end # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last - "<#{class_name} field: #{@field}, value: #{@value}, issue: #{@issue}>" + "<#{class_name} field: #{@field}, value: #{@value}, location: #{@location}, issue:"\ + " #{@issue}, description: #{@description}>" end # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last - "<#{class_name} field: #{@field.inspect}, value: #{@value.inspect}, issue:"\ - " #{@issue.inspect}>" + "<#{class_name} field: #{@field.inspect}, value: #{@value.inspect}, location:"\ + " #{@location.inspect}, issue: #{@issue.inspect}, description: #{@description.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/transactions_list.rb b/lib/paypal_server_sdk/models/transactions_list.rb new file mode 100644 index 0000000..766aa86 --- /dev/null +++ b/lib/paypal_server_sdk/models/transactions_list.rb @@ -0,0 +1,111 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The list transactions for a subscription request details. + class TransactionsList < BaseModel + SKIP = Object.new + private_constant :SKIP + + # An array of transactions. + # @return [Array[SubscriptionTransactionDetails]] + attr_accessor :transactions + + # The total number of items. + # @return [Integer] + attr_accessor :total_items + + # The total number of pages. + # @return [Integer] + attr_accessor :total_pages + + # An array of request-related [HATEOAS + # links](/docs/api/reference/api-responses/#hateoas-links). + # @return [Array[LinkDescription]] + attr_accessor :links + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['transactions'] = 'transactions' + @_hash['total_items'] = 'total_items' + @_hash['total_pages'] = 'total_pages' + @_hash['links'] = 'links' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + transactions + total_items + total_pages + links + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(transactions: SKIP, total_items: SKIP, total_pages: SKIP, + links: SKIP) + @transactions = transactions unless transactions == SKIP + @total_items = total_items unless total_items == SKIP + @total_pages = total_pages unless total_pages == SKIP + @links = links unless links == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + transactions = nil + unless hash['transactions'].nil? + transactions = [] + hash['transactions'].each do |structure| + transactions << (SubscriptionTransactionDetails.from_hash(structure) if structure) + end + end + + transactions = SKIP unless hash.key?('transactions') + total_items = hash.key?('total_items') ? hash['total_items'] : SKIP + total_pages = hash.key?('total_pages') ? hash['total_pages'] : SKIP + # Parameter is an array, so we need to iterate through it + links = nil + unless hash['links'].nil? + links = [] + hash['links'].each do |structure| + links << (LinkDescription.from_hash(structure) if structure) + end + end + + links = SKIP unless hash.key?('links') + + # Create object from extracted values. + TransactionsList.new(transactions: transactions, + total_items: total_items, + total_pages: total_pages, + links: links) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} transactions: #{@transactions}, total_items: #{@total_items}, total_pages:"\ + " #{@total_pages}, links: #{@links}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} transactions: #{@transactions.inspect}, total_items:"\ + " #{@total_items.inspect}, total_pages: #{@total_pages.inspect}, links: #{@links.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/trustly_payment_object.rb b/lib/paypal_server_sdk/models/trustly_payment_object.rb index 2543ea1..ac8bc08 100644 --- a/lib/paypal_server_sdk/models/trustly_payment_object.rb +++ b/lib/paypal_server_sdk/models/trustly_payment_object.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using Trustly. diff --git a/lib/paypal_server_sdk/models/trustly_payment_request.rb b/lib/paypal_server_sdk/models/trustly_payment_request.rb index 1a7a5de..c585f2d 100644 --- a/lib/paypal_server_sdk/models/trustly_payment_request.rb +++ b/lib/paypal_server_sdk/models/trustly_payment_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using Trustly. diff --git a/lib/paypal_server_sdk/models/universal_product_code.rb b/lib/paypal_server_sdk/models/universal_product_code.rb index b6f8cac..5cb9706 100644 --- a/lib/paypal_server_sdk/models/universal_product_code.rb +++ b/lib/paypal_server_sdk/models/universal_product_code.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The Universal Product Code of the item. diff --git a/lib/paypal_server_sdk/models/upc_type.rb b/lib/paypal_server_sdk/models/upc_type.rb index adc2007..1e52b4e 100644 --- a/lib/paypal_server_sdk/models/upc_type.rb +++ b/lib/paypal_server_sdk/models/upc_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The Universal Product Code type. diff --git a/lib/paypal_server_sdk/models/update_pricing_scheme.rb b/lib/paypal_server_sdk/models/update_pricing_scheme.rb new file mode 100644 index 0000000..e652242 --- /dev/null +++ b/lib/paypal_server_sdk/models/update_pricing_scheme.rb @@ -0,0 +1,72 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The update pricing scheme request details. + class UpdatePricingScheme < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The billing cycle sequence. + # @return [Integer] + attr_accessor :billing_cycle_sequence + + # The pricing scheme details. + # @return [SubscriptionPricingScheme] + attr_accessor :pricing_scheme + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['billing_cycle_sequence'] = 'billing_cycle_sequence' + @_hash['pricing_scheme'] = 'pricing_scheme' + @_hash + end + + # An array for optional fields + def self.optionals + [] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(billing_cycle_sequence:, pricing_scheme:) + @billing_cycle_sequence = billing_cycle_sequence + @pricing_scheme = pricing_scheme + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + billing_cycle_sequence = + hash.key?('billing_cycle_sequence') ? hash['billing_cycle_sequence'] : nil + pricing_scheme = SubscriptionPricingScheme.from_hash(hash['pricing_scheme']) if + hash['pricing_scheme'] + + # Create object from extracted values. + UpdatePricingScheme.new(billing_cycle_sequence: billing_cycle_sequence, + pricing_scheme: pricing_scheme) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} billing_cycle_sequence: #{@billing_cycle_sequence}, pricing_scheme:"\ + " #{@pricing_scheme}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} billing_cycle_sequence: #{@billing_cycle_sequence.inspect}, pricing_scheme:"\ + " #{@pricing_scheme.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/update_pricing_schemes_request.rb b/lib/paypal_server_sdk/models/update_pricing_schemes_request.rb new file mode 100644 index 0000000..e3bf1a4 --- /dev/null +++ b/lib/paypal_server_sdk/models/update_pricing_schemes_request.rb @@ -0,0 +1,69 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The update pricing scheme request details. + class UpdatePricingSchemesRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # An array of pricing schemes. + # @return [Array[UpdatePricingScheme]] + attr_accessor :pricing_schemes + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['pricing_schemes'] = 'pricing_schemes' + @_hash + end + + # An array for optional fields + def self.optionals + [] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(pricing_schemes:) + @pricing_schemes = pricing_schemes + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + pricing_schemes = nil + unless hash['pricing_schemes'].nil? + pricing_schemes = [] + hash['pricing_schemes'].each do |structure| + pricing_schemes << (UpdatePricingScheme.from_hash(structure) if structure) + end + end + + pricing_schemes = nil unless hash.key?('pricing_schemes') + + # Create object from extracted values. + UpdatePricingSchemesRequest.new(pricing_schemes: pricing_schemes) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} pricing_schemes: #{@pricing_schemes}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} pricing_schemes: #{@pricing_schemes.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/usage_pattern.rb b/lib/paypal_server_sdk/models/usage_pattern.rb index 3afca60..e485f09 100644 --- a/lib/paypal_server_sdk/models/usage_pattern.rb +++ b/lib/paypal_server_sdk/models/usage_pattern.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Expected business/pricing model for the billing agreement., Expected diff --git a/lib/paypal_server_sdk/models/vault_apple_pay_request.rb b/lib/paypal_server_sdk/models/vault_apple_pay_request.rb new file mode 100644 index 0000000..6bf20d8 --- /dev/null +++ b/lib/paypal_server_sdk/models/vault_apple_pay_request.rb @@ -0,0 +1,73 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # A resource representing a request to vault Apple Pay. + class VaultApplePayRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Encrypted Apple Pay token, containing card information. This token would + # be base64 encoded. + # @return [String] + attr_accessor :token + + # The payment card to be used to fund a payment. Can be a credit or debit + # card. + # @return [ApplePayRequestCard] + attr_accessor :card + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['token'] = 'token' + @_hash['card'] = 'card' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + token + card + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(token: SKIP, card: SKIP) + @token = token unless token == SKIP + @card = card unless card == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + token = hash.key?('token') ? hash['token'] : SKIP + card = ApplePayRequestCard.from_hash(hash['card']) if hash['card'] + + # Create object from extracted values. + VaultApplePayRequest.new(token: token, + card: card) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} token: #{@token}, card: #{@card}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} token: #{@token.inspect}, card: #{@card.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/setup_token_card_experience_context.rb b/lib/paypal_server_sdk/models/vault_card_experience_context.rb similarity index 71% rename from lib/paypal_server_sdk/models/setup_token_card_experience_context.rb rename to lib/paypal_server_sdk/models/vault_card_experience_context.rb index 453cb46..a5cc158 100644 --- a/lib/paypal_server_sdk/models/setup_token_card_experience_context.rb +++ b/lib/paypal_server_sdk/models/vault_card_experience_context.rb @@ -1,11 +1,11 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk - # Customizes the Vault creation flow experience for your customers. - class SetupTokenCardExperienceContext < BaseModel + # A resource representing an experience context of vault a card. + class VaultCardExperienceContext < BaseModel SKIP = Object.new private_constant :SKIP @@ -38,11 +38,15 @@ class SetupTokenCardExperienceContext < BaseModel # @return [String] attr_accessor :cancel_url - # Vault Instruction on action to be performed after a successful payer - # approval. + # DEPRECATED. Vault Instruction on action to be performed after a successful + # payer approval. # @return [VaultInstructionAction] attr_accessor :vault_instruction + # User Action on action to be performed after a successful payer approval. + # @return [VaultUserAction] + attr_accessor :user_action + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -51,6 +55,7 @@ def self.names @_hash['return_url'] = 'return_url' @_hash['cancel_url'] = 'cancel_url' @_hash['vault_instruction'] = 'vault_instruction' + @_hash['user_action'] = 'user_action' @_hash end @@ -62,6 +67,7 @@ def self.optionals return_url cancel_url vault_instruction + user_action ] end @@ -70,15 +76,15 @@ def self.nullables [] end - def initialize( - brand_name: SKIP, locale: SKIP, return_url: SKIP, cancel_url: SKIP, - vault_instruction: VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS - ) + def initialize(brand_name: SKIP, locale: SKIP, return_url: SKIP, + cancel_url: SKIP, vault_instruction: SKIP, + user_action: VaultUserAction::CONTINUE) @brand_name = brand_name unless brand_name == SKIP @locale = locale unless locale == SKIP @return_url = return_url unless return_url == SKIP @cancel_url = cancel_url unless cancel_url == SKIP @vault_instruction = vault_instruction unless vault_instruction == SKIP + @user_action = user_action unless user_action == SKIP end # Creates an instance of the object from a hash. @@ -91,21 +97,24 @@ def self.from_hash(hash) return_url = hash.key?('return_url') ? hash['return_url'] : SKIP cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : SKIP vault_instruction = - hash['vault_instruction'] ||= VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS + hash.key?('vault_instruction') ? hash['vault_instruction'] : SKIP + user_action = hash['user_action'] ||= VaultUserAction::CONTINUE # Create object from extracted values. - SetupTokenCardExperienceContext.new(brand_name: brand_name, - locale: locale, - return_url: return_url, - cancel_url: cancel_url, - vault_instruction: vault_instruction) + VaultCardExperienceContext.new(brand_name: brand_name, + locale: locale, + return_url: return_url, + cancel_url: cancel_url, + vault_instruction: vault_instruction, + user_action: user_action) end # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last "<#{class_name} brand_name: #{@brand_name}, locale: #{@locale}, return_url: #{@return_url},"\ - " cancel_url: #{@cancel_url}, vault_instruction: #{@vault_instruction}>" + " cancel_url: #{@cancel_url}, vault_instruction: #{@vault_instruction}, user_action:"\ + " #{@user_action}>" end # Provides a debugging-friendly string with detailed object information. @@ -113,7 +122,7 @@ def inspect class_name = self.class.name.split('::').last "<#{class_name} brand_name: #{@brand_name.inspect}, locale: #{@locale.inspect}, return_url:"\ " #{@return_url.inspect}, cancel_url: #{@cancel_url.inspect}, vault_instruction:"\ - " #{@vault_instruction.inspect}>" + " #{@vault_instruction.inspect}, user_action: #{@user_action.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/vault_card_verification_method.rb b/lib/paypal_server_sdk/models/vault_card_verification_method.rb index 452727b..3295ae5 100644 --- a/lib/paypal_server_sdk/models/vault_card_verification_method.rb +++ b/lib/paypal_server_sdk/models/vault_card_verification_method.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The verification method of the card. diff --git a/lib/paypal_server_sdk/models/vault_customer.rb b/lib/paypal_server_sdk/models/vault_customer.rb index 0326d9d..9d20c0f 100644 --- a/lib/paypal_server_sdk/models/vault_customer.rb +++ b/lib/paypal_server_sdk/models/vault_customer.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # This object represents a merchant’s customer, allowing them to store contact diff --git a/lib/paypal_server_sdk/models/vault_experience_context.rb b/lib/paypal_server_sdk/models/vault_experience_context.rb index 6c9ccd6..390f816 100644 --- a/lib/paypal_server_sdk/models/vault_experience_context.rb +++ b/lib/paypal_server_sdk/models/vault_experience_context.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Customizes the Vault creation flow experience for your customers. @@ -39,14 +39,23 @@ class VaultExperienceContext < BaseModel attr_accessor :cancel_url # The shipping preference. This only applies to PayPal payment source. - # @return [OrderApplicationContextShippingPreference] + # @return [ExperienceContextShippingPreference] attr_accessor :shipping_preference - # Vault Instruction on action to be performed after a successful payer - # approval. + # DEPRECATED. Vault Instruction on action to be performed after a successful + # payer approval. # @return [VaultInstructionAction] attr_accessor :vault_instruction + # Merchant provided details of the native app or mobile web browser to + # facilitate buyer's app switch to the PayPal consumer app. + # @return [AppSwitchContext] + attr_accessor :app_switch_context + + # User Action on action to be performed after a successful payer approval. + # @return [VaultUserAction] + attr_accessor :user_action + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -56,6 +65,8 @@ def self.names @_hash['cancel_url'] = 'cancel_url' @_hash['shipping_preference'] = 'shipping_preference' @_hash['vault_instruction'] = 'vault_instruction' + @_hash['app_switch_context'] = 'app_switch_context' + @_hash['user_action'] = 'user_action' @_hash end @@ -68,6 +79,8 @@ def self.optionals cancel_url shipping_preference vault_instruction + app_switch_context + user_action ] end @@ -78,8 +91,9 @@ def self.nullables def initialize( brand_name: SKIP, locale: SKIP, return_url: SKIP, cancel_url: SKIP, - shipping_preference: OrderApplicationContextShippingPreference::GET_FROM_FILE, - vault_instruction: VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS + shipping_preference: ExperienceContextShippingPreference::GET_FROM_FILE, + vault_instruction: SKIP, app_switch_context: SKIP, + user_action: VaultUserAction::CONTINUE ) @brand_name = brand_name unless brand_name == SKIP @locale = locale unless locale == SKIP @@ -87,6 +101,8 @@ def initialize( @cancel_url = cancel_url unless cancel_url == SKIP @shipping_preference = shipping_preference unless shipping_preference == SKIP @vault_instruction = vault_instruction unless vault_instruction == SKIP + @app_switch_context = app_switch_context unless app_switch_context == SKIP + @user_action = user_action unless user_action == SKIP end # Creates an instance of the object from a hash. @@ -99,9 +115,12 @@ def self.from_hash(hash) return_url = hash.key?('return_url') ? hash['return_url'] : SKIP cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : SKIP shipping_preference = - hash['shipping_preference'] ||= OrderApplicationContextShippingPreference::GET_FROM_FILE + hash['shipping_preference'] ||= ExperienceContextShippingPreference::GET_FROM_FILE vault_instruction = - hash['vault_instruction'] ||= VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS + hash.key?('vault_instruction') ? hash['vault_instruction'] : SKIP + app_switch_context = AppSwitchContext.from_hash(hash['app_switch_context']) if + hash['app_switch_context'] + user_action = hash['user_action'] ||= VaultUserAction::CONTINUE # Create object from extracted values. VaultExperienceContext.new(brand_name: brand_name, @@ -109,7 +128,9 @@ def self.from_hash(hash) return_url: return_url, cancel_url: cancel_url, shipping_preference: shipping_preference, - vault_instruction: vault_instruction) + vault_instruction: vault_instruction, + app_switch_context: app_switch_context, + user_action: user_action) end # Provides a human-readable string representation of the object. @@ -117,7 +138,8 @@ def to_s class_name = self.class.name.split('::').last "<#{class_name} brand_name: #{@brand_name}, locale: #{@locale}, return_url: #{@return_url},"\ " cancel_url: #{@cancel_url}, shipping_preference: #{@shipping_preference},"\ - " vault_instruction: #{@vault_instruction}>" + " vault_instruction: #{@vault_instruction}, app_switch_context: #{@app_switch_context},"\ + " user_action: #{@user_action}>" end # Provides a debugging-friendly string with detailed object information. @@ -125,7 +147,8 @@ def inspect class_name = self.class.name.split('::').last "<#{class_name} brand_name: #{@brand_name.inspect}, locale: #{@locale.inspect}, return_url:"\ " #{@return_url.inspect}, cancel_url: #{@cancel_url.inspect}, shipping_preference:"\ - " #{@shipping_preference.inspect}, vault_instruction: #{@vault_instruction.inspect}>" + " #{@shipping_preference.inspect}, vault_instruction: #{@vault_instruction.inspect},"\ + " app_switch_context: #{@app_switch_context.inspect}, user_action: #{@user_action.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/vault_instruction.rb b/lib/paypal_server_sdk/models/vault_instruction.rb index 91e5de4..881ea64 100644 --- a/lib/paypal_server_sdk/models/vault_instruction.rb +++ b/lib/paypal_server_sdk/models/vault_instruction.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Base vaulting specification. The object can be extended for specific use diff --git a/lib/paypal_server_sdk/models/vault_instruction_action.rb b/lib/paypal_server_sdk/models/vault_instruction_action.rb index 36d8131..d4fd52a 100644 --- a/lib/paypal_server_sdk/models/vault_instruction_action.rb +++ b/lib/paypal_server_sdk/models/vault_instruction_action.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Vault Instruction on action to be performed after a successful payer diff --git a/lib/paypal_server_sdk/models/vault_instruction_base.rb b/lib/paypal_server_sdk/models/vault_instruction_base.rb index cd86ad3..35aa3a2 100644 --- a/lib/paypal_server_sdk/models/vault_instruction_base.rb +++ b/lib/paypal_server_sdk/models/vault_instruction_base.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Basic vault instruction specification that can be extended by specific diff --git a/lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb b/lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb index 693ff0e..5d0371b 100644 --- a/lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb +++ b/lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # A resource representing a request to vault PayPal Wallet. @@ -49,7 +49,7 @@ class VaultPaypalWalletRequest < BaseModel # @return [Plan] attr_accessor :billing_plan - # Customizes the Vault creation flow experience for your customers. + # A resource representing an experience context of vault PayPal Wallet. # @return [VaultExperienceContext] attr_accessor :experience_context diff --git a/lib/paypal_server_sdk/models/vault_response.rb b/lib/paypal_server_sdk/models/vault_response.rb index 9e5444f..06ba3dd 100644 --- a/lib/paypal_server_sdk/models/vault_response.rb +++ b/lib/paypal_server_sdk/models/vault_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details about a saved payment source. diff --git a/lib/paypal_server_sdk/models/vault_response_customer.rb b/lib/paypal_server_sdk/models/vault_response_customer.rb index 4b3238f..740ef03 100644 --- a/lib/paypal_server_sdk/models/vault_response_customer.rb +++ b/lib/paypal_server_sdk/models/vault_response_customer.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # This object defines a customer in your system. Use it to manage customer diff --git a/lib/paypal_server_sdk/models/vault_status.rb b/lib/paypal_server_sdk/models/vault_status.rb index 36292ec..0b63c11 100644 --- a/lib/paypal_server_sdk/models/vault_status.rb +++ b/lib/paypal_server_sdk/models/vault_status.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The vault status. diff --git a/lib/paypal_server_sdk/models/vault_token_request.rb b/lib/paypal_server_sdk/models/vault_token_request.rb index 1e8f745..bb2d68e 100644 --- a/lib/paypal_server_sdk/models/vault_token_request.rb +++ b/lib/paypal_server_sdk/models/vault_token_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The Tokenized Payment Source representing a Request to Vault a Token. diff --git a/lib/paypal_server_sdk/models/vault_token_request_type.rb b/lib/paypal_server_sdk/models/vault_token_request_type.rb index e7591be..4ea2762 100644 --- a/lib/paypal_server_sdk/models/vault_token_request_type.rb +++ b/lib/paypal_server_sdk/models/vault_token_request_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The tokenization method that generated the ID. diff --git a/lib/paypal_server_sdk/models/vault_user_action.rb b/lib/paypal_server_sdk/models/vault_user_action.rb new file mode 100644 index 0000000..1e104ef --- /dev/null +++ b/lib/paypal_server_sdk/models/vault_user_action.rb @@ -0,0 +1,29 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # User Action on action to be performed after a successful payer approval. + class VaultUserAction + VAULT_USER_ACTION = [ + # After you redirect the customer to the PayPal payment page, a Setup Now + # button appears. Use this option when no additional inputs are needed + # from merchant site and to create the billing agreement immediately when + # the customer clicks Setup Now. + SETUP_NOW = 'SETUP_NOW'.freeze, + + # After you redirect the customer to the PayPal payment page, a Continue + # button appears. Use this option when you want to redirect the customer + # from the completed payment page to the merchant site for additional + # inputs without immediately creating the billing agreement. + CONTINUE = 'CONTINUE'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/vault_venmo_request.rb b/lib/paypal_server_sdk/models/vault_venmo_request.rb index 1985bed..ee2068a 100644 --- a/lib/paypal_server_sdk/models/vault_venmo_request.rb +++ b/lib/paypal_server_sdk/models/vault_venmo_request.rb @@ -1,10 +1,10 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk - # VaultVenmoRequest Model. + # A resource representing a request to vault Venmo. class VaultVenmoRequest < BaseModel SKIP = Object.new private_constant :SKIP @@ -44,8 +44,8 @@ class VaultVenmoRequest < BaseModel # @return [PaypalPaymentTokenCustomerType] attr_accessor :customer_type - # Customizes the Vault creation flow experience for your customers. - # @return [VaultVenmoExperienceContext] + # A resource representing an experience context of vault a venmo account. + # @return [VenmoExperienceContext] attr_accessor :experience_context # A mapping from model property names to API property names. @@ -108,7 +108,7 @@ def self.from_hash(hash) hash['permit_multiple_payment_tokens'] ||= false usage_type = hash.key?('usage_type') ? hash['usage_type'] : SKIP customer_type = hash.key?('customer_type') ? hash['customer_type'] : SKIP - experience_context = VaultVenmoExperienceContext.from_hash(hash['experience_context']) if + experience_context = VenmoExperienceContext.from_hash(hash['experience_context']) if hash['experience_context'] # Create object from extracted values. diff --git a/lib/paypal_server_sdk/models/vaulted_digital_wallet.rb b/lib/paypal_server_sdk/models/vaulted_digital_wallet.rb index f689919..b6d2f85 100644 --- a/lib/paypal_server_sdk/models/vaulted_digital_wallet.rb +++ b/lib/paypal_server_sdk/models/vaulted_digital_wallet.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Resource consolidating common request and response attributes for vaulting a diff --git a/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb b/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb index ade16f9..9715721 100644 --- a/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb +++ b/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The shipping details. @@ -13,6 +13,13 @@ class VaultedDigitalWalletShippingDetails < BaseModel # @return [ShippingName] attr_accessor :name + # The internationalized email address. Note: Up to 64 characters are allowed + # before and 255 characters are allowed after the @ sign. However, the + # generally accepted maximum length for an email address is 254 characters. + # The pattern verifies that an unquoted @ sign exists. + # @return [String] + attr_accessor :email_address + # The phone number, in its canonical international [E.164 numbering plan # format](https://www.itu.int/rec/T-REC-E.164/en). # @return [PhoneNumberWithCountryCode] @@ -37,6 +44,7 @@ class VaultedDigitalWalletShippingDetails < BaseModel def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' + @_hash['email_address'] = 'email_address' @_hash['phone_number'] = 'phone_number' @_hash['type'] = 'type' @_hash['address'] = 'address' @@ -47,6 +55,7 @@ def self.names def self.optionals %w[ name + email_address phone_number type address @@ -58,8 +67,10 @@ def self.nullables [] end - def initialize(name: SKIP, phone_number: SKIP, type: SKIP, address: SKIP) + def initialize(name: SKIP, email_address: SKIP, phone_number: SKIP, + type: SKIP, address: SKIP) @name = name unless name == SKIP + @email_address = email_address unless email_address == SKIP @phone_number = phone_number unless phone_number == SKIP @type = type unless type == SKIP @address = address unless address == SKIP @@ -71,6 +82,7 @@ def self.from_hash(hash) # Extract variables from the hash. name = ShippingName.from_hash(hash['name']) if hash['name'] + email_address = hash.key?('email_address') ? hash['email_address'] : SKIP phone_number = PhoneNumberWithCountryCode.from_hash(hash['phone_number']) if hash['phone_number'] type = hash.key?('type') ? hash['type'] : SKIP @@ -78,6 +90,7 @@ def self.from_hash(hash) # Create object from extracted values. VaultedDigitalWalletShippingDetails.new(name: name, + email_address: email_address, phone_number: phone_number, type: type, address: address) @@ -86,15 +99,16 @@ def self.from_hash(hash) # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last - "<#{class_name} name: #{@name}, phone_number: #{@phone_number}, type: #{@type}, address:"\ - " #{@address}>" + "<#{class_name} name: #{@name}, email_address: #{@email_address}, phone_number:"\ + " #{@phone_number}, type: #{@type}, address: #{@address}>" end # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last - "<#{class_name} name: #{@name.inspect}, phone_number: #{@phone_number.inspect}, type:"\ - " #{@type.inspect}, address: #{@address.inspect}>" + "<#{class_name} name: #{@name.inspect}, email_address: #{@email_address.inspect},"\ + " phone_number: #{@phone_number.inspect}, type: #{@type.inspect}, address:"\ + " #{@address.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/vault_venmo_experience_context.rb b/lib/paypal_server_sdk/models/venmo_experience_context.rb similarity index 60% rename from lib/paypal_server_sdk/models/vault_venmo_experience_context.rb rename to lib/paypal_server_sdk/models/venmo_experience_context.rb index 8909a5f..05db337 100644 --- a/lib/paypal_server_sdk/models/vault_venmo_experience_context.rb +++ b/lib/paypal_server_sdk/models/venmo_experience_context.rb @@ -1,11 +1,11 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk - # Customizes the Vault creation flow experience for your customers. - class VaultVenmoExperienceContext < BaseModel + # A resource representing an experience context of vault a venmo account. + class VenmoExperienceContext < BaseModel SKIP = Object.new private_constant :SKIP @@ -16,20 +16,25 @@ class VaultVenmoExperienceContext < BaseModel attr_accessor :brand_name # The shipping preference. This only applies to PayPal payment source. - # @return [OrderApplicationContextShippingPreference] + # @return [ExperienceContextShippingPreference] attr_accessor :shipping_preference - # Vault Instruction on action to be performed after a successful payer - # approval. + # DEPRECATED. Vault Instruction on action to be performed after a successful + # payer approval. # @return [VaultInstructionAction] attr_accessor :vault_instruction + # User Action on action to be performed after a successful payer approval. + # @return [VaultUserAction] + attr_accessor :user_action + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @_hash['brand_name'] = 'brand_name' @_hash['shipping_preference'] = 'shipping_preference' @_hash['vault_instruction'] = 'vault_instruction' + @_hash['user_action'] = 'user_action' @_hash end @@ -39,6 +44,7 @@ def self.optionals brand_name shipping_preference vault_instruction + user_action ] end @@ -49,12 +55,13 @@ def self.nullables def initialize( brand_name: SKIP, - shipping_preference: OrderApplicationContextShippingPreference::GET_FROM_FILE, - vault_instruction: VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS + shipping_preference: ExperienceContextShippingPreference::GET_FROM_FILE, + vault_instruction: SKIP, user_action: VaultUserAction::CONTINUE ) @brand_name = brand_name unless brand_name == SKIP @shipping_preference = shipping_preference unless shipping_preference == SKIP @vault_instruction = vault_instruction unless vault_instruction == SKIP + @user_action = user_action unless user_action == SKIP end # Creates an instance of the object from a hash. @@ -64,28 +71,31 @@ def self.from_hash(hash) # Extract variables from the hash. brand_name = hash.key?('brand_name') ? hash['brand_name'] : SKIP shipping_preference = - hash['shipping_preference'] ||= OrderApplicationContextShippingPreference::GET_FROM_FILE + hash['shipping_preference'] ||= ExperienceContextShippingPreference::GET_FROM_FILE vault_instruction = - hash['vault_instruction'] ||= VaultInstructionAction::ON_CREATE_PAYMENT_TOKENS + hash.key?('vault_instruction') ? hash['vault_instruction'] : SKIP + user_action = hash['user_action'] ||= VaultUserAction::CONTINUE # Create object from extracted values. - VaultVenmoExperienceContext.new(brand_name: brand_name, - shipping_preference: shipping_preference, - vault_instruction: vault_instruction) + VenmoExperienceContext.new(brand_name: brand_name, + shipping_preference: shipping_preference, + vault_instruction: vault_instruction, + user_action: user_action) end # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last "<#{class_name} brand_name: #{@brand_name}, shipping_preference: #{@shipping_preference},"\ - " vault_instruction: #{@vault_instruction}>" + " vault_instruction: #{@vault_instruction}, user_action: #{@user_action}>" end # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last "<#{class_name} brand_name: #{@brand_name.inspect}, shipping_preference:"\ - " #{@shipping_preference.inspect}, vault_instruction: #{@vault_instruction.inspect}>" + " #{@shipping_preference.inspect}, vault_instruction: #{@vault_instruction.inspect},"\ + " user_action: #{@user_action.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/venmo_payment_token.rb b/lib/paypal_server_sdk/models/venmo_payment_token.rb index 5626703..f4d66f0 100644 --- a/lib/paypal_server_sdk/models/venmo_payment_token.rb +++ b/lib/paypal_server_sdk/models/venmo_payment_token.rb @@ -1,10 +1,10 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk - # VenmoPaymentToken Model. + # Full representation of a Venmo Payment Token. class VenmoPaymentToken < BaseModel SKIP = Object.new private_constant :SKIP @@ -44,10 +44,11 @@ class VenmoPaymentToken < BaseModel # @return [PaypalPaymentTokenCustomerType] attr_accessor :customer_type - # The internationalized email address. Note: Up to 64 characters are allowed - # before and 255 characters are allowed after the @ sign. However, the - # generally accepted maximum length for an email address is 254 characters. - # The pattern verifies that an unquoted @ sign exists. + # The internationalized email address.
Note: Up + # to 64 characters are allowed before and 255 characters are allowed after + # the @ sign. However, the generally accepted maximum length + # for an email address is 254 characters. The pattern verifies that an + # unquoted @ sign exists.
# @return [String] attr_accessor :email_address diff --git a/lib/paypal_server_sdk/models/venmo_payment_token_customer_type.rb b/lib/paypal_server_sdk/models/venmo_payment_token_customer_type.rb index 8326325..d8ad6f9 100644 --- a/lib/paypal_server_sdk/models/venmo_payment_token_customer_type.rb +++ b/lib/paypal_server_sdk/models/venmo_payment_token_customer_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The customer type associated with the Venmo payment token. This is to diff --git a/lib/paypal_server_sdk/models/venmo_payment_token_usage_pattern.rb b/lib/paypal_server_sdk/models/venmo_payment_token_usage_pattern.rb index 01b3e19..bd3a182 100644 --- a/lib/paypal_server_sdk/models/venmo_payment_token_usage_pattern.rb +++ b/lib/paypal_server_sdk/models/venmo_payment_token_usage_pattern.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Expected business/pricing model for the billing agreement. diff --git a/lib/paypal_server_sdk/models/venmo_payment_token_usage_type.rb b/lib/paypal_server_sdk/models/venmo_payment_token_usage_type.rb index 275abfd..e1e2880 100644 --- a/lib/paypal_server_sdk/models/venmo_payment_token_usage_type.rb +++ b/lib/paypal_server_sdk/models/venmo_payment_token_usage_type.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The usage type associated with the Venmo payment token. diff --git a/lib/paypal_server_sdk/models/venmo_vault_response.rb b/lib/paypal_server_sdk/models/venmo_vault_response.rb new file mode 100644 index 0000000..e30ce0e --- /dev/null +++ b/lib/paypal_server_sdk/models/venmo_vault_response.rb @@ -0,0 +1,100 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The details about a saved venmo payment source. + class VenmoVaultResponse < BaseModel + SKIP = Object.new + private_constant :SKIP + + # The PayPal-generated ID for the saved payment source. + # @return [String] + attr_accessor :id + + # The vault status. + # @return [VenmoVaultResponseStatus] + attr_accessor :status + + # An array of request-related HATEOAS links. + # @return [Array[LinkDescription]] + attr_accessor :links + + # This object represents a merchant’s customer, allowing them to store + # contact details, and track all payments associated with the same customer. + # @return [CustomerInformation] + attr_accessor :customer + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['id'] = 'id' + @_hash['status'] = 'status' + @_hash['links'] = 'links' + @_hash['customer'] = 'customer' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + id + status + links + customer + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(id: SKIP, status: SKIP, links: SKIP, customer: SKIP) + @id = id unless id == SKIP + @status = status unless status == SKIP + @links = links unless links == SKIP + @customer = customer unless customer == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + id = hash.key?('id') ? hash['id'] : SKIP + status = hash.key?('status') ? hash['status'] : SKIP + # Parameter is an array, so we need to iterate through it + links = nil + unless hash['links'].nil? + links = [] + hash['links'].each do |structure| + links << (LinkDescription.from_hash(structure) if structure) + end + end + + links = SKIP unless hash.key?('links') + customer = CustomerInformation.from_hash(hash['customer']) if hash['customer'] + + # Create object from extracted values. + VenmoVaultResponse.new(id: id, + status: status, + links: links, + customer: customer) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id}, status: #{@status}, links: #{@links}, customer: #{@customer}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id.inspect}, status: #{@status.inspect}, links: #{@links.inspect},"\ + " customer: #{@customer.inspect}>" + end + end +end diff --git a/lib/paypal_server_sdk/models/venmo_vault_response_status.rb b/lib/paypal_server_sdk/models/venmo_vault_response_status.rb new file mode 100644 index 0000000..300c77b --- /dev/null +++ b/lib/paypal_server_sdk/models/venmo_vault_response_status.rb @@ -0,0 +1,31 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # The vault status. + class VenmoVaultResponseStatus + VENMO_VAULT_RESPONSE_STATUS = [ + # The payment source has been saved in your customer's vault. This vault + # status reflects `/v3/vault` status. + VAULTED = 'VAULTED'.freeze, + + # DEPRECATED. The payment source has been saved in your customer's vault. + # This status applies to deprecated integration patterns and will not be + # returned for v3/vault integrations. + CREATED = 'CREATED'.freeze, + + # Customer has approved the action of saving the specified payment_source + # into their vault. Use v3/vault/payment-tokens with given setup_token to + # save the payment source in the vault + APPROVED = 'APPROVED'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/venmo_wallet_additional_attributes.rb b/lib/paypal_server_sdk/models/venmo_wallet_additional_attributes.rb index f9db2a4..55e2130 100644 --- a/lib/paypal_server_sdk/models/venmo_wallet_additional_attributes.rb +++ b/lib/paypal_server_sdk/models/venmo_wallet_additional_attributes.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Additional attributes associated with the use of this Venmo Wallet. diff --git a/lib/paypal_server_sdk/models/venmo_wallet_attributes_response.rb b/lib/paypal_server_sdk/models/venmo_wallet_attributes_response.rb index 4716d55..33b1447 100644 --- a/lib/paypal_server_sdk/models/venmo_wallet_attributes_response.rb +++ b/lib/paypal_server_sdk/models/venmo_wallet_attributes_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Additional attributes associated with the use of a Venmo Wallet. @@ -9,8 +9,8 @@ class VenmoWalletAttributesResponse < BaseModel SKIP = Object.new private_constant :SKIP - # The details about a saved payment source. - # @return [VaultResponse] + # The details about a saved venmo payment source. + # @return [VenmoVaultResponse] attr_accessor :vault # A mapping from model property names to API property names. @@ -41,7 +41,7 @@ def self.from_hash(hash) return nil unless hash # Extract variables from the hash. - vault = VaultResponse.from_hash(hash['vault']) if hash['vault'] + vault = VenmoVaultResponse.from_hash(hash['vault']) if hash['vault'] # Create object from extracted values. VenmoWalletAttributesResponse.new(vault: vault) diff --git a/lib/paypal_server_sdk/models/venmo_wallet_customer_information.rb b/lib/paypal_server_sdk/models/venmo_wallet_customer_information.rb index 87fa4d2..22c3b43 100644 --- a/lib/paypal_server_sdk/models/venmo_wallet_customer_information.rb +++ b/lib/paypal_server_sdk/models/venmo_wallet_customer_information.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The details about a customer in PayPal's system of record. diff --git a/lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb b/lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb index be18871..32ece3f 100644 --- a/lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb +++ b/lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Customizes the buyer experience during the approval process for payment with @@ -17,19 +17,24 @@ class VenmoWalletExperienceContext < BaseModel attr_accessor :brand_name # The location from which the shipping address is derived. - # @return [ShippingPreference] + # @return [VenmoWalletExperienceContextShippingPreference] attr_accessor :shipping_preference # CallBack Configuration that the merchant can provide to PayPal/Venmo. # @return [CallbackConfiguration] attr_accessor :order_update_callback_config + # Configures a Continue or Pay Now checkout flow. + # @return [VenmoWalletExperienceContextUserAction] + attr_accessor :user_action + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @_hash['brand_name'] = 'brand_name' @_hash['shipping_preference'] = 'shipping_preference' @_hash['order_update_callback_config'] = 'order_update_callback_config' + @_hash['user_action'] = 'user_action' @_hash end @@ -39,6 +44,7 @@ def self.optionals brand_name shipping_preference order_update_callback_config + user_action ] end @@ -47,15 +53,19 @@ def self.nullables [] end - def initialize(brand_name: SKIP, - shipping_preference: ShippingPreference::GET_FROM_FILE, - order_update_callback_config: SKIP) + def initialize( + brand_name: SKIP, + shipping_preference: VenmoWalletExperienceContextShippingPreference::GET_FROM_FILE, + order_update_callback_config: SKIP, + user_action: VenmoWalletExperienceContextUserAction::CONTINUE + ) @brand_name = brand_name unless brand_name == SKIP @shipping_preference = shipping_preference unless shipping_preference == SKIP unless order_update_callback_config == SKIP @order_update_callback_config = order_update_callback_config end + @user_action = user_action unless user_action == SKIP end # Creates an instance of the object from a hash. @@ -65,22 +75,26 @@ def self.from_hash(hash) # Extract variables from the hash. brand_name = hash.key?('brand_name') ? hash['brand_name'] : SKIP shipping_preference = - hash['shipping_preference'] ||= ShippingPreference::GET_FROM_FILE + hash['shipping_preference'] ||= VenmoWalletExperienceContextShippingPreference::GET_FROM_FILE if hash['order_update_callback_config'] order_update_callback_config = CallbackConfiguration.from_hash(hash['order_update_callback_config']) end + user_action = + hash['user_action'] ||= VenmoWalletExperienceContextUserAction::CONTINUE # Create object from extracted values. VenmoWalletExperienceContext.new(brand_name: brand_name, shipping_preference: shipping_preference, - order_update_callback_config: order_update_callback_config) + order_update_callback_config: order_update_callback_config, + user_action: user_action) end # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last "<#{class_name} brand_name: #{@brand_name}, shipping_preference: #{@shipping_preference},"\ - " order_update_callback_config: #{@order_update_callback_config}>" + " order_update_callback_config: #{@order_update_callback_config}, user_action:"\ + " #{@user_action}>" end # Provides a debugging-friendly string with detailed object information. @@ -88,7 +102,7 @@ def inspect class_name = self.class.name.split('::').last "<#{class_name} brand_name: #{@brand_name.inspect}, shipping_preference:"\ " #{@shipping_preference.inspect}, order_update_callback_config:"\ - " #{@order_update_callback_config.inspect}>" + " #{@order_update_callback_config.inspect}, user_action: #{@user_action.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/shipping_preference.rb b/lib/paypal_server_sdk/models/venmo_wallet_experience_context_shipping_preference.rb similarity index 78% rename from lib/paypal_server_sdk/models/shipping_preference.rb rename to lib/paypal_server_sdk/models/venmo_wallet_experience_context_shipping_preference.rb index 3188d54..8e1fd17 100644 --- a/lib/paypal_server_sdk/models/shipping_preference.rb +++ b/lib/paypal_server_sdk/models/venmo_wallet_experience_context_shipping_preference.rb @@ -1,12 +1,12 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # The location from which the shipping address is derived. - class ShippingPreference - SHIPPING_PREFERENCE = [ + class VenmoWalletExperienceContextShippingPreference + VENMO_WALLET_EXPERIENCE_CONTEXT_SHIPPING_PREFERENCE = [ # Get the customer-provided shipping address on the PayPal site. GET_FROM_FILE = 'GET_FROM_FILE'.freeze, diff --git a/lib/paypal_server_sdk/models/venmo_wallet_experience_context_user_action.rb b/lib/paypal_server_sdk/models/venmo_wallet_experience_context_user_action.rb new file mode 100644 index 0000000..4a4563a --- /dev/null +++ b/lib/paypal_server_sdk/models/venmo_wallet_experience_context_user_action.rb @@ -0,0 +1,29 @@ +# paypal_server_sdk +# +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). + +module PaypalServerSdk + # Configures a Continue or Pay Now checkout flow. + class VenmoWalletExperienceContextUserAction + VENMO_WALLET_EXPERIENCE_CONTEXT_USER_ACTION = [ + # After you redirect the customer to the Venmo payment page, a Continue + # button appears. Use this option when the final amount is not known when + # the checkout flow is initiated and you want to redirect the customer to + # the merchant page without processing the payment. + CONTINUE = 'CONTINUE'.freeze, + + # After you redirect the customer to the Venmo payment page, a Pay Now + # button appears. Use this option when the final amount is known when the + # checkout is initiated and you want to process the payment immediately + # when the customer clicks Pay Now. + PAY_NOW = 'PAY_NOW'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + true + end + end +end diff --git a/lib/paypal_server_sdk/models/venmo_wallet_request.rb b/lib/paypal_server_sdk/models/venmo_wallet_request.rb index e2ca406..aeeddf9 100644 --- a/lib/paypal_server_sdk/models/venmo_wallet_request.rb +++ b/lib/paypal_server_sdk/models/venmo_wallet_request.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Information needed to pay using Venmo. diff --git a/lib/paypal_server_sdk/models/venmo_wallet_response.rb b/lib/paypal_server_sdk/models/venmo_wallet_response.rb index 7c98e3d..6fb2062 100644 --- a/lib/paypal_server_sdk/models/venmo_wallet_response.rb +++ b/lib/paypal_server_sdk/models/venmo_wallet_response.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Venmo wallet response. @@ -45,6 +45,11 @@ class VenmoWalletResponse < BaseModel # @return [Address] attr_accessor :address + # Merchant preference on how the buyer can navigate back to merchant website + # post approving the transaction on the Venmo App. + # @return [ReturnFlow] + attr_accessor :return_flow + # Additional attributes associated with the use of a Venmo Wallet. # @return [VenmoWalletAttributesResponse] attr_accessor :attributes @@ -58,6 +63,7 @@ def self.names @_hash['name'] = 'name' @_hash['phone_number'] = 'phone_number' @_hash['address'] = 'address' + @_hash['return_flow'] = 'return_flow' @_hash['attributes'] = 'attributes' @_hash end @@ -71,6 +77,7 @@ def self.optionals name phone_number address + return_flow attributes ] end @@ -82,13 +89,14 @@ def self.nullables def initialize(email_address: SKIP, account_id: SKIP, user_name: SKIP, name: SKIP, phone_number: SKIP, address: SKIP, - attributes: SKIP) + return_flow: ReturnFlow::AUTO, attributes: SKIP) @email_address = email_address unless email_address == SKIP @account_id = account_id unless account_id == SKIP @user_name = user_name unless user_name == SKIP @name = name unless name == SKIP @phone_number = phone_number unless phone_number == SKIP @address = address unless address == SKIP + @return_flow = return_flow unless return_flow == SKIP @attributes = attributes unless attributes == SKIP end @@ -103,6 +111,7 @@ def self.from_hash(hash) name = Name.from_hash(hash['name']) if hash['name'] phone_number = PhoneNumber.from_hash(hash['phone_number']) if hash['phone_number'] address = Address.from_hash(hash['address']) if hash['address'] + return_flow = hash['return_flow'] ||= ReturnFlow::AUTO attributes = VenmoWalletAttributesResponse.from_hash(hash['attributes']) if hash['attributes'] @@ -113,6 +122,7 @@ def self.from_hash(hash) name: name, phone_number: phone_number, address: address, + return_flow: return_flow, attributes: attributes) end @@ -121,7 +131,7 @@ def to_s class_name = self.class.name.split('::').last "<#{class_name} email_address: #{@email_address}, account_id: #{@account_id}, user_name:"\ " #{@user_name}, name: #{@name}, phone_number: #{@phone_number}, address: #{@address},"\ - " attributes: #{@attributes}>" + " return_flow: #{@return_flow}, attributes: #{@attributes}>" end # Provides a debugging-friendly string with detailed object information. @@ -129,8 +139,8 @@ def inspect class_name = self.class.name.split('::').last "<#{class_name} email_address: #{@email_address.inspect}, account_id:"\ " #{@account_id.inspect}, user_name: #{@user_name.inspect}, name: #{@name.inspect},"\ - " phone_number: #{@phone_number.inspect}, address: #{@address.inspect}, attributes:"\ - " #{@attributes.inspect}>" + " phone_number: #{@phone_number.inspect}, address: #{@address.inspect}, return_flow:"\ + " #{@return_flow.inspect}, attributes: #{@attributes.inspect}>" end end end diff --git a/lib/paypal_server_sdk/models/venmo_wallet_vault_attributes.rb b/lib/paypal_server_sdk/models/venmo_wallet_vault_attributes.rb index e01a6d0..371dd5b 100644 --- a/lib/paypal_server_sdk/models/venmo_wallet_vault_attributes.rb +++ b/lib/paypal_server_sdk/models/venmo_wallet_vault_attributes.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # Resource consolidating common request and response attirbutes for vaulting diff --git a/lib/paypal_server_sdk/utilities/date_time_helper.rb b/lib/paypal_server_sdk/utilities/date_time_helper.rb index 8d45aab..fbf6a41 100644 --- a/lib/paypal_server_sdk/utilities/date_time_helper.rb +++ b/lib/paypal_server_sdk/utilities/date_time_helper.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). require 'date' module PaypalServerSdk diff --git a/lib/paypal_server_sdk/utilities/file_wrapper.rb b/lib/paypal_server_sdk/utilities/file_wrapper.rb index dfea1f4..780f09f 100644 --- a/lib/paypal_server_sdk/utilities/file_wrapper.rb +++ b/lib/paypal_server_sdk/utilities/file_wrapper.rb @@ -1,7 +1,7 @@ # paypal_server_sdk # -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). +# This file was automatically generated by APIMATIC v3.0 +# ( https://www.apimatic.io ). module PaypalServerSdk # A utility to allow users to set the content-type for files diff --git a/paypal_server_sdk.gemspec b/paypal_server_sdk.gemspec index 7d23add..e0cb07f 100644 --- a/paypal_server_sdk.gemspec +++ b/paypal_server_sdk.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'paypal-server-sdk' - s.version = '1.1.0' + s.version = '2.0.0' s.summary = 'PayPal\'s SDK for interacting with the REST APIs' s.description = '' s.authors = ['PayPal'] @@ -10,9 +10,9 @@ Gem::Specification.new do |s| s.metadata = { } - s.add_dependency('apimatic_core_interfaces', '~> 0.2.1') - s.add_dependency('apimatic_core', '~> 0.3.11') - s.add_dependency('apimatic_faraday_client_adapter', '~> 0.1.4') + s.add_dependency('apimatic_core_interfaces', '~> 0.2.3') + s.add_dependency('apimatic_core', '~> 0.3.20') + s.add_dependency('apimatic_faraday_client_adapter', '~> 0.1.6') s.required_ruby_version = ['>= 2.6'] s.files = Dir['{bin,lib,man,test,spec}/**/*', 'README*', 'LICENSE*'] s.require_paths = ['lib']