paypal-server-sdk 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +35 -0
  3. data/README.md +112 -0
  4. data/lib/paypal_server_sdk/api_helper.rb +10 -0
  5. data/lib/paypal_server_sdk/client.rb +85 -0
  6. data/lib/paypal_server_sdk/configuration.rb +109 -0
  7. data/lib/paypal_server_sdk/controllers/base_controller.rb +71 -0
  8. data/lib/paypal_server_sdk/controllers/o_auth_authorization_controller.rb +42 -0
  9. data/lib/paypal_server_sdk/controllers/orders_controller.rb +517 -0
  10. data/lib/paypal_server_sdk/controllers/payments_controller.rb +404 -0
  11. data/lib/paypal_server_sdk/controllers/vault_controller.rb +224 -0
  12. data/lib/paypal_server_sdk/exceptions/api_exception.rb +10 -0
  13. data/lib/paypal_server_sdk/exceptions/error_exception.rb +71 -0
  14. data/lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb +48 -0
  15. data/lib/paypal_server_sdk/http/api_response.rb +21 -0
  16. data/lib/paypal_server_sdk/http/auth/o_auth2.rb +136 -0
  17. data/lib/paypal_server_sdk/http/http_call_back.rb +10 -0
  18. data/lib/paypal_server_sdk/http/http_method_enum.rb +10 -0
  19. data/lib/paypal_server_sdk/http/http_request.rb +10 -0
  20. data/lib/paypal_server_sdk/http/http_response.rb +10 -0
  21. data/lib/paypal_server_sdk/logging/configuration/api_logging_configuration.rb +114 -0
  22. data/lib/paypal_server_sdk/logging/sdk_logger.rb +17 -0
  23. data/lib/paypal_server_sdk/models/activity_timestamps.rb +68 -0
  24. data/lib/paypal_server_sdk/models/address.rb +116 -0
  25. data/lib/paypal_server_sdk/models/address_details.rb +160 -0
  26. data/lib/paypal_server_sdk/models/amount_breakdown.rb +115 -0
  27. data/lib/paypal_server_sdk/models/amount_with_breakdown.rb +80 -0
  28. data/lib/paypal_server_sdk/models/apple_pay_attributes.rb +60 -0
  29. data/lib/paypal_server_sdk/models/apple_pay_attributes_response.rb +50 -0
  30. data/lib/paypal_server_sdk/models/apple_pay_card.rb +94 -0
  31. data/lib/paypal_server_sdk/models/apple_pay_card_response.rb +167 -0
  32. data/lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb +95 -0
  33. data/lib/paypal_server_sdk/models/apple_pay_payment_data.rb +83 -0
  34. data/lib/paypal_server_sdk/models/apple_pay_payment_data_type.rb +24 -0
  35. data/lib/paypal_server_sdk/models/apple_pay_payment_object.rb +114 -0
  36. data/lib/paypal_server_sdk/models/apple_pay_payment_token.rb +51 -0
  37. data/lib/paypal_server_sdk/models/apple_pay_request.rb +137 -0
  38. data/lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb +113 -0
  39. data/lib/paypal_server_sdk/models/assurance_details.rb +68 -0
  40. data/lib/paypal_server_sdk/models/authentication_response.rb +61 -0
  41. data/lib/paypal_server_sdk/models/authorization.rb +192 -0
  42. data/lib/paypal_server_sdk/models/authorization_incomplete_reason.rb +23 -0
  43. data/lib/paypal_server_sdk/models/authorization_status.rb +35 -0
  44. data/lib/paypal_server_sdk/models/authorization_status_details.rb +50 -0
  45. data/lib/paypal_server_sdk/models/authorization_status_with_details.rb +60 -0
  46. data/lib/paypal_server_sdk/models/authorization_with_additional_data.rb +205 -0
  47. data/lib/paypal_server_sdk/models/avs_code.rb +90 -0
  48. data/lib/paypal_server_sdk/models/bancontact_payment_object.rb +95 -0
  49. data/lib/paypal_server_sdk/models/bancontact_payment_request.rb +73 -0
  50. data/lib/paypal_server_sdk/models/base_model.rb +62 -0
  51. data/lib/paypal_server_sdk/models/bin_details.rb +88 -0
  52. data/lib/paypal_server_sdk/models/blik_experience_context.rb +122 -0
  53. data/lib/paypal_server_sdk/models/blik_level0_payment_object.rb +48 -0
  54. data/lib/paypal_server_sdk/models/blik_one_click_payment_object.rb +52 -0
  55. data/lib/paypal_server_sdk/models/blik_one_click_payment_request.rb +82 -0
  56. data/lib/paypal_server_sdk/models/blik_payment_object.rb +86 -0
  57. data/lib/paypal_server_sdk/models/blik_payment_request.rb +105 -0
  58. data/lib/paypal_server_sdk/models/capture.rb +228 -0
  59. data/lib/paypal_server_sdk/models/capture_incomplete_reason.rb +55 -0
  60. data/lib/paypal_server_sdk/models/capture_payment_instruction.rb +89 -0
  61. data/lib/paypal_server_sdk/models/capture_request.rb +108 -0
  62. data/lib/paypal_server_sdk/models/capture_status.rb +35 -0
  63. data/lib/paypal_server_sdk/models/capture_status_details.rb +50 -0
  64. data/lib/paypal_server_sdk/models/capture_status_with_details.rb +60 -0
  65. data/lib/paypal_server_sdk/models/captured_payment.rb +248 -0
  66. data/lib/paypal_server_sdk/models/card_attributes.rb +70 -0
  67. data/lib/paypal_server_sdk/models/card_attributes_response.rb +50 -0
  68. data/lib/paypal_server_sdk/models/card_authentication_response.rb +51 -0
  69. data/lib/paypal_server_sdk/models/card_brand.rb +93 -0
  70. data/lib/paypal_server_sdk/models/card_customer_information.rb +85 -0
  71. data/lib/paypal_server_sdk/models/card_experience_context.rb +59 -0
  72. data/lib/paypal_server_sdk/models/card_from_request.rb +60 -0
  73. data/lib/paypal_server_sdk/models/card_payment_token.rb +166 -0
  74. data/lib/paypal_server_sdk/models/card_request.rb +176 -0
  75. data/lib/paypal_server_sdk/models/card_response.rb +139 -0
  76. data/lib/paypal_server_sdk/models/card_response_entity.rb +156 -0
  77. data/lib/paypal_server_sdk/models/card_stored_credential.rb +95 -0
  78. data/lib/paypal_server_sdk/models/card_supplementary_data.rb +71 -0
  79. data/lib/paypal_server_sdk/models/card_type.rb +32 -0
  80. data/lib/paypal_server_sdk/models/card_vault_response.rb +86 -0
  81. data/lib/paypal_server_sdk/models/card_verification.rb +51 -0
  82. data/lib/paypal_server_sdk/models/card_verification_details.rb +111 -0
  83. data/lib/paypal_server_sdk/models/card_verification_method.rb +29 -0
  84. data/lib/paypal_server_sdk/models/card_verification_processor_response.rb +62 -0
  85. data/lib/paypal_server_sdk/models/checkout_payment_intent.rb +24 -0
  86. data/lib/paypal_server_sdk/models/cobranded_card.rb +70 -0
  87. data/lib/paypal_server_sdk/models/confirm_order_request.rb +74 -0
  88. data/lib/paypal_server_sdk/models/customer_information.rb +72 -0
  89. data/lib/paypal_server_sdk/models/customer_request.rb +62 -0
  90. data/lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb +105 -0
  91. data/lib/paypal_server_sdk/models/cvv_code.rb +60 -0
  92. data/lib/paypal_server_sdk/models/disbursement_mode.rb +23 -0
  93. data/lib/paypal_server_sdk/models/dispute_category.rb +23 -0
  94. data/lib/paypal_server_sdk/models/eci_flag.rb +39 -0
  95. data/lib/paypal_server_sdk/models/enrollment_status.rb +29 -0
  96. data/lib/paypal_server_sdk/models/eps_payment_object.rb +74 -0
  97. data/lib/paypal_server_sdk/models/eps_payment_request.rb +73 -0
  98. data/lib/paypal_server_sdk/models/error_details.rb +110 -0
  99. data/lib/paypal_server_sdk/models/exchange_rate.rb +75 -0
  100. data/lib/paypal_server_sdk/models/experience_context.rb +98 -0
  101. data/lib/paypal_server_sdk/models/fullfillment_type.rb +31 -0
  102. data/lib/paypal_server_sdk/models/giropay_payment_object.rb +74 -0
  103. data/lib/paypal_server_sdk/models/giropay_payment_request.rb +73 -0
  104. data/lib/paypal_server_sdk/models/google_pay_authentication_method.rb +23 -0
  105. data/lib/paypal_server_sdk/models/google_pay_card_attributes.rb +51 -0
  106. data/lib/paypal_server_sdk/models/google_pay_card_response.rb +104 -0
  107. data/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb +105 -0
  108. data/lib/paypal_server_sdk/models/google_pay_payment_method.rb +20 -0
  109. data/lib/paypal_server_sdk/models/google_pay_request.rb +118 -0
  110. data/lib/paypal_server_sdk/models/google_pay_request_card.rb +84 -0
  111. data/lib/paypal_server_sdk/models/google_pay_wallet_response.rb +85 -0
  112. data/lib/paypal_server_sdk/models/ideal_payment_object.rb +85 -0
  113. data/lib/paypal_server_sdk/models/ideal_payment_request.rb +83 -0
  114. data/lib/paypal_server_sdk/models/item.rb +134 -0
  115. data/lib/paypal_server_sdk/models/item_category.rb +26 -0
  116. data/lib/paypal_server_sdk/models/level2_card_processing_data.rb +66 -0
  117. data/lib/paypal_server_sdk/models/level3_card_processing_data.rb +120 -0
  118. data/lib/paypal_server_sdk/models/liability_shift_indicator.rb +26 -0
  119. data/lib/paypal_server_sdk/models/line_item.rb +177 -0
  120. data/lib/paypal_server_sdk/models/link_description.rb +75 -0
  121. data/lib/paypal_server_sdk/models/link_http_method.rb +41 -0
  122. data/lib/paypal_server_sdk/models/money.rb +62 -0
  123. data/lib/paypal_server_sdk/models/my_bank_payment_object.rb +85 -0
  124. data/lib/paypal_server_sdk/models/my_bank_payment_request.rb +73 -0
  125. data/lib/paypal_server_sdk/models/name.rb +61 -0
  126. data/lib/paypal_server_sdk/models/net_amount_breakdown_item.rb +73 -0
  127. data/lib/paypal_server_sdk/models/network_token.rb +95 -0
  128. data/lib/paypal_server_sdk/models/network_transaction_reference.rb +90 -0
  129. data/lib/paypal_server_sdk/models/network_transaction_reference_entity.rb +88 -0
  130. data/lib/paypal_server_sdk/models/o_auth_provider_error.rb +45 -0
  131. data/lib/paypal_server_sdk/models/o_auth_token.rb +106 -0
  132. data/lib/paypal_server_sdk/models/order.rb +178 -0
  133. data/lib/paypal_server_sdk/models/order_application_context.rb +193 -0
  134. data/lib/paypal_server_sdk/models/order_application_context_landing_page.rb +32 -0
  135. data/lib/paypal_server_sdk/models/order_application_context_shipping_preference.rb +34 -0
  136. data/lib/paypal_server_sdk/models/order_application_context_user_action.rb +29 -0
  137. data/lib/paypal_server_sdk/models/order_authorize_request.rb +51 -0
  138. data/lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb +104 -0
  139. data/lib/paypal_server_sdk/models/order_authorize_response.rb +171 -0
  140. data/lib/paypal_server_sdk/models/order_authorize_response_payment_source.rb +88 -0
  141. data/lib/paypal_server_sdk/models/order_capture_request.rb +51 -0
  142. data/lib/paypal_server_sdk/models/order_capture_request_payment_source.rb +104 -0
  143. data/lib/paypal_server_sdk/models/order_confirm_application_context.rb +109 -0
  144. data/lib/paypal_server_sdk/models/order_request.rb +103 -0
  145. data/lib/paypal_server_sdk/models/order_status.rb +35 -0
  146. data/lib/paypal_server_sdk/models/order_tracker_item.rb +99 -0
  147. data/lib/paypal_server_sdk/models/order_tracker_request.rb +116 -0
  148. data/lib/paypal_server_sdk/models/order_tracker_response.rb +122 -0
  149. data/lib/paypal_server_sdk/models/order_tracker_status.rb +23 -0
  150. data/lib/paypal_server_sdk/models/p24_payment_object.rb +108 -0
  151. data/lib/paypal_server_sdk/models/p24_payment_request.rb +85 -0
  152. data/lib/paypal_server_sdk/models/pa_res_status.rb +42 -0
  153. data/lib/paypal_server_sdk/models/patch.rb +83 -0
  154. data/lib/paypal_server_sdk/models/patch_op.rb +35 -0
  155. data/lib/paypal_server_sdk/models/pay_pal_experience_landing_page.rb +26 -0
  156. data/lib/paypal_server_sdk/models/pay_pal_experience_user_action.rb +24 -0
  157. data/lib/paypal_server_sdk/models/pay_pal_payment_token.rb +180 -0
  158. data/lib/paypal_server_sdk/models/pay_pal_payment_token_customer_type.rb +25 -0
  159. data/lib/paypal_server_sdk/models/pay_pal_payment_token_usage_pattern.rb +35 -0
  160. data/lib/paypal_server_sdk/models/pay_pal_payment_token_usage_type.rb +23 -0
  161. data/lib/paypal_server_sdk/models/pay_pal_wallet.rb +158 -0
  162. data/lib/paypal_server_sdk/models/pay_pal_wallet_account_verification_status.rb +24 -0
  163. data/lib/paypal_server_sdk/models/pay_pal_wallet_attributes.rb +59 -0
  164. data/lib/paypal_server_sdk/models/pay_pal_wallet_attributes_response.rb +70 -0
  165. data/lib/paypal_server_sdk/models/pay_pal_wallet_customer.rb +85 -0
  166. data/lib/paypal_server_sdk/models/pay_pal_wallet_customer_request.rb +85 -0
  167. data/lib/paypal_server_sdk/models/pay_pal_wallet_experience_context.rb +140 -0
  168. data/lib/paypal_server_sdk/models/pay_pal_wallet_response.rb +166 -0
  169. data/lib/paypal_server_sdk/models/pay_pal_wallet_vault_instruction.rb +115 -0
  170. data/lib/paypal_server_sdk/models/pay_pal_wallet_vault_response.rb +86 -0
  171. data/lib/paypal_server_sdk/models/pay_pal_wallet_vault_status.rb +26 -0
  172. data/lib/paypal_server_sdk/models/payee.rb +65 -0
  173. data/lib/paypal_server_sdk/models/payee_base.rb +64 -0
  174. data/lib/paypal_server_sdk/models/payee_payment_method_preference.rb +23 -0
  175. data/lib/paypal_server_sdk/models/payer.rb +120 -0
  176. data/lib/paypal_server_sdk/models/payer_base.rb +64 -0
  177. data/lib/paypal_server_sdk/models/payment_advice_code.rb +30 -0
  178. data/lib/paypal_server_sdk/models/payment_authorization.rb +212 -0
  179. data/lib/paypal_server_sdk/models/payment_collection.rb +99 -0
  180. data/lib/paypal_server_sdk/models/payment_initiator.rb +23 -0
  181. data/lib/paypal_server_sdk/models/payment_instruction.rb +105 -0
  182. data/lib/paypal_server_sdk/models/payment_method_preference.rb +72 -0
  183. data/lib/paypal_server_sdk/models/payment_source.rb +187 -0
  184. data/lib/paypal_server_sdk/models/payment_source_response.rb +171 -0
  185. data/lib/paypal_server_sdk/models/payment_supplementary_data.rb +50 -0
  186. data/lib/paypal_server_sdk/models/payment_token_request.rb +60 -0
  187. data/lib/paypal_server_sdk/models/payment_token_request_card.rb +125 -0
  188. data/lib/paypal_server_sdk/models/payment_token_request_payment_source.rb +59 -0
  189. data/lib/paypal_server_sdk/models/payment_token_response.rb +87 -0
  190. data/lib/paypal_server_sdk/models/payment_token_response_payment_source.rb +87 -0
  191. data/lib/paypal_server_sdk/models/phone.rb +77 -0
  192. data/lib/paypal_server_sdk/models/phone_number.rb +54 -0
  193. data/lib/paypal_server_sdk/models/phone_number_with_country_code.rb +66 -0
  194. data/lib/paypal_server_sdk/models/phone_type.rb +32 -0
  195. data/lib/paypal_server_sdk/models/phone_with_type.rb +59 -0
  196. data/lib/paypal_server_sdk/models/platform_fee.rb +63 -0
  197. data/lib/paypal_server_sdk/models/processing_instruction.rb +23 -0
  198. data/lib/paypal_server_sdk/models/processor_response.rb +83 -0
  199. data/lib/paypal_server_sdk/models/processor_response_code.rb +479 -0
  200. data/lib/paypal_server_sdk/models/purchase_unit.rb +227 -0
  201. data/lib/paypal_server_sdk/models/purchase_unit_request.rb +193 -0
  202. data/lib/paypal_server_sdk/models/reauthorize_request.rb +62 -0
  203. data/lib/paypal_server_sdk/models/refund.rb +195 -0
  204. data/lib/paypal_server_sdk/models/refund_incomplete_reason.rb +20 -0
  205. data/lib/paypal_server_sdk/models/refund_payment_instruction.rb +68 -0
  206. data/lib/paypal_server_sdk/models/refund_platform_fee.rb +52 -0
  207. data/lib/paypal_server_sdk/models/refund_request.rb +100 -0
  208. data/lib/paypal_server_sdk/models/refund_status.rb +29 -0
  209. data/lib/paypal_server_sdk/models/refund_status_details.rb +50 -0
  210. data/lib/paypal_server_sdk/models/refund_status_with_details.rb +60 -0
  211. data/lib/paypal_server_sdk/models/related_identifiers.rb +69 -0
  212. data/lib/paypal_server_sdk/models/seller_payable_breakdown.rb +156 -0
  213. data/lib/paypal_server_sdk/models/seller_protection.rb +65 -0
  214. data/lib/paypal_server_sdk/models/seller_protection_status.rb +29 -0
  215. data/lib/paypal_server_sdk/models/seller_receivable_breakdown.rb +129 -0
  216. data/lib/paypal_server_sdk/models/setup_token_card_experience_context.rb +103 -0
  217. data/lib/paypal_server_sdk/models/setup_token_request.rb +60 -0
  218. data/lib/paypal_server_sdk/models/setup_token_request_card.rb +141 -0
  219. data/lib/paypal_server_sdk/models/setup_token_request_payment_source.rb +77 -0
  220. data/lib/paypal_server_sdk/models/setup_token_response.rb +106 -0
  221. data/lib/paypal_server_sdk/models/setup_token_response_card.rb +156 -0
  222. data/lib/paypal_server_sdk/models/setup_token_response_payment_source.rb +68 -0
  223. data/lib/paypal_server_sdk/models/shipment_carrier.rb +3852 -0
  224. data/lib/paypal_server_sdk/models/shipping_details.rb +106 -0
  225. data/lib/paypal_server_sdk/models/shipping_name.rb +50 -0
  226. data/lib/paypal_server_sdk/models/shipping_option.rb +94 -0
  227. data/lib/paypal_server_sdk/models/shipping_preference.rb +26 -0
  228. data/lib/paypal_server_sdk/models/shipping_type.rb +29 -0
  229. data/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb +124 -0
  230. data/lib/paypal_server_sdk/models/sofort_payment_object.rb +85 -0
  231. data/lib/paypal_server_sdk/models/sofort_payment_request.rb +73 -0
  232. data/lib/paypal_server_sdk/models/standard_entry_class_code.rb +36 -0
  233. data/lib/paypal_server_sdk/models/store_in_vault_instruction.rb +20 -0
  234. data/lib/paypal_server_sdk/models/stored_payment_source.rb +95 -0
  235. data/lib/paypal_server_sdk/models/stored_payment_source_payment_type.rb +26 -0
  236. data/lib/paypal_server_sdk/models/stored_payment_source_usage_type.rb +27 -0
  237. data/lib/paypal_server_sdk/models/supplementary_data.rb +58 -0
  238. data/lib/paypal_server_sdk/models/supplementary_purchase_data.rb +63 -0
  239. data/lib/paypal_server_sdk/models/tax_id_type.rb +23 -0
  240. data/lib/paypal_server_sdk/models/tax_info.rb +57 -0
  241. data/lib/paypal_server_sdk/models/three_d_secure_authentication_response.rb +62 -0
  242. data/lib/paypal_server_sdk/models/token.rb +56 -0
  243. data/lib/paypal_server_sdk/models/token_request_type.rb +23 -0
  244. data/lib/paypal_server_sdk/models/token_type.rb +20 -0
  245. data/lib/paypal_server_sdk/models/trustly_payment_object.rb +85 -0
  246. data/lib/paypal_server_sdk/models/trustly_payment_request.rb +73 -0
  247. data/lib/paypal_server_sdk/models/universal_product_code.rb +56 -0
  248. data/lib/paypal_server_sdk/models/upc_type.rb +38 -0
  249. data/lib/paypal_server_sdk/models/vault_customer.rb +50 -0
  250. data/lib/paypal_server_sdk/models/vault_experience_context.rb +112 -0
  251. data/lib/paypal_server_sdk/models/vault_instruction.rb +50 -0
  252. data/lib/paypal_server_sdk/models/vault_instruction_base.rb +52 -0
  253. data/lib/paypal_server_sdk/models/vault_pay_pal_wallet_request.rb +115 -0
  254. data/lib/paypal_server_sdk/models/vault_response.rb +86 -0
  255. data/lib/paypal_server_sdk/models/vault_status.rb +26 -0
  256. data/lib/paypal_server_sdk/models/vault_token_request.rb +56 -0
  257. data/lib/paypal_server_sdk/models/vault_venmo_experience_context.rb +73 -0
  258. data/lib/paypal_server_sdk/models/vault_venmo_request.rb +115 -0
  259. data/lib/paypal_server_sdk/models/vaulted_digital_wallet.rb +106 -0
  260. data/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb +75 -0
  261. data/lib/paypal_server_sdk/models/venmo_payment_token.rb +169 -0
  262. data/lib/paypal_server_sdk/models/venmo_payment_token_customer_type.rb +25 -0
  263. data/lib/paypal_server_sdk/models/venmo_payment_token_usage_pattern.rb +35 -0
  264. data/lib/paypal_server_sdk/models/venmo_payment_token_usage_type.rb +23 -0
  265. data/lib/paypal_server_sdk/models/venmo_wallet_additional_attributes.rb +60 -0
  266. data/lib/paypal_server_sdk/models/venmo_wallet_attributes_response.rb +50 -0
  267. data/lib/paypal_server_sdk/models/venmo_wallet_customer_information.rb +63 -0
  268. data/lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb +65 -0
  269. data/lib/paypal_server_sdk/models/venmo_wallet_request.rb +89 -0
  270. data/lib/paypal_server_sdk/models/venmo_wallet_response.rb +120 -0
  271. data/lib/paypal_server_sdk/models/venmo_wallet_vault_attributes.rb +114 -0
  272. data/lib/paypal_server_sdk/utilities/date_time_helper.rb +11 -0
  273. data/lib/paypal_server_sdk/utilities/file_wrapper.rb +16 -0
  274. data/lib/paypal_server_sdk.rb +306 -0
  275. metadata +357 -0
@@ -0,0 +1,205 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # The authorization with additional payment details, such as risk assessment
8
+ # and processor response. These details are populated only for certain payment
9
+ # methods.
10
+ class AuthorizationWithAdditionalData < BaseModel
11
+ SKIP = Object.new
12
+ private_constant :SKIP
13
+
14
+ # The status for the authorized payment.
15
+ # @return [AuthorizationStatus]
16
+ attr_accessor :status
17
+
18
+ # The details of the authorized payment status.
19
+ # @return [AuthorizationStatusDetails]
20
+ attr_accessor :status_details
21
+
22
+ # The PayPal-generated ID for the authorized payment.
23
+ # @return [String]
24
+ attr_accessor :id
25
+
26
+ # The currency and amount for a financial transaction, such as a balance or
27
+ # payment due.
28
+ # @return [Money]
29
+ attr_accessor :amount
30
+
31
+ # The API caller-provided external invoice number for this order. Appears in
32
+ # both the payer's transaction history and the emails that the payer
33
+ # receives.
34
+ # @return [String]
35
+ attr_accessor :invoice_id
36
+
37
+ # The API caller-provided external ID. Used to reconcile API
38
+ # caller-initiated transactions with PayPal transactions. Appears in
39
+ # transaction and settlement reports.
40
+ # @return [String]
41
+ attr_accessor :custom_id
42
+
43
+ # Reference values used by the card network to identify a transaction.
44
+ # @return [NetworkTransactionReference]
45
+ attr_accessor :network_transaction_reference
46
+
47
+ # The level of protection offered as defined by [PayPal Seller Protection
48
+ # for
49
+ # Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protectio
50
+ # n).
51
+ # @return [SellerProtection]
52
+ attr_accessor :seller_protection
53
+
54
+ # The date and time, in [Internet date and time
55
+ # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
56
+ # required while fractional seconds are
57
+ # optional.<blockquote><strong>Note:</strong> The regular expression
58
+ # provides guidance but does not reject all invalid dates.</blockquote>
59
+ # @return [String]
60
+ attr_accessor :expiration_time
61
+
62
+ # An array of related [HATEOAS
63
+ # links](/docs/api/reference/api-responses/#hateoas-links).
64
+ # @return [Array[LinkDescription]]
65
+ attr_accessor :links
66
+
67
+ # The date and time, in [Internet date and time
68
+ # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
69
+ # required while fractional seconds are
70
+ # optional.<blockquote><strong>Note:</strong> The regular expression
71
+ # provides guidance but does not reject all invalid dates.</blockquote>
72
+ # @return [String]
73
+ attr_accessor :create_time
74
+
75
+ # The date and time, in [Internet date and time
76
+ # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
77
+ # required while fractional seconds are
78
+ # optional.<blockquote><strong>Note:</strong> The regular expression
79
+ # provides guidance but does not reject all invalid dates.</blockquote>
80
+ # @return [String]
81
+ attr_accessor :update_time
82
+
83
+ # The processor response information for payment requests, such as direct
84
+ # credit card transactions.
85
+ # @return [ProcessorResponse]
86
+ attr_accessor :processor_response
87
+
88
+ # A mapping from model property names to API property names.
89
+ def self.names
90
+ @_hash = {} if @_hash.nil?
91
+ @_hash['status'] = 'status'
92
+ @_hash['status_details'] = 'status_details'
93
+ @_hash['id'] = 'id'
94
+ @_hash['amount'] = 'amount'
95
+ @_hash['invoice_id'] = 'invoice_id'
96
+ @_hash['custom_id'] = 'custom_id'
97
+ @_hash['network_transaction_reference'] =
98
+ 'network_transaction_reference'
99
+ @_hash['seller_protection'] = 'seller_protection'
100
+ @_hash['expiration_time'] = 'expiration_time'
101
+ @_hash['links'] = 'links'
102
+ @_hash['create_time'] = 'create_time'
103
+ @_hash['update_time'] = 'update_time'
104
+ @_hash['processor_response'] = 'processor_response'
105
+ @_hash
106
+ end
107
+
108
+ # An array for optional fields
109
+ def self.optionals
110
+ %w[
111
+ status
112
+ status_details
113
+ id
114
+ amount
115
+ invoice_id
116
+ custom_id
117
+ network_transaction_reference
118
+ seller_protection
119
+ expiration_time
120
+ links
121
+ create_time
122
+ update_time
123
+ processor_response
124
+ ]
125
+ end
126
+
127
+ # An array for nullable fields
128
+ def self.nullables
129
+ []
130
+ end
131
+
132
+ def initialize(status: SKIP, status_details: SKIP, id: SKIP, amount: SKIP,
133
+ invoice_id: SKIP, custom_id: SKIP,
134
+ network_transaction_reference: SKIP, seller_protection: SKIP,
135
+ expiration_time: SKIP, links: SKIP, create_time: SKIP,
136
+ update_time: SKIP, processor_response: SKIP)
137
+ @status = status unless status == SKIP
138
+ @status_details = status_details unless status_details == SKIP
139
+ @id = id unless id == SKIP
140
+ @amount = amount unless amount == SKIP
141
+ @invoice_id = invoice_id unless invoice_id == SKIP
142
+ @custom_id = custom_id unless custom_id == SKIP
143
+ unless network_transaction_reference == SKIP
144
+ @network_transaction_reference =
145
+ network_transaction_reference
146
+ end
147
+ @seller_protection = seller_protection unless seller_protection == SKIP
148
+ @expiration_time = expiration_time unless expiration_time == SKIP
149
+ @links = links unless links == SKIP
150
+ @create_time = create_time unless create_time == SKIP
151
+ @update_time = update_time unless update_time == SKIP
152
+ @processor_response = processor_response unless processor_response == SKIP
153
+ end
154
+
155
+ # Creates an instance of the object from a hash.
156
+ def self.from_hash(hash)
157
+ return nil unless hash
158
+
159
+ # Extract variables from the hash.
160
+ status = hash.key?('status') ? hash['status'] : SKIP
161
+ status_details = AuthorizationStatusDetails.from_hash(hash['status_details']) if
162
+ hash['status_details']
163
+ id = hash.key?('id') ? hash['id'] : SKIP
164
+ amount = Money.from_hash(hash['amount']) if hash['amount']
165
+ invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP
166
+ custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP
167
+ if hash['network_transaction_reference']
168
+ network_transaction_reference = NetworkTransactionReference.from_hash(hash['network_transaction_reference'])
169
+ end
170
+ seller_protection = SellerProtection.from_hash(hash['seller_protection']) if
171
+ hash['seller_protection']
172
+ expiration_time =
173
+ hash.key?('expiration_time') ? hash['expiration_time'] : SKIP
174
+ # Parameter is an array, so we need to iterate through it
175
+ links = nil
176
+ unless hash['links'].nil?
177
+ links = []
178
+ hash['links'].each do |structure|
179
+ links << (LinkDescription.from_hash(structure) if structure)
180
+ end
181
+ end
182
+
183
+ links = SKIP unless hash.key?('links')
184
+ create_time = hash.key?('create_time') ? hash['create_time'] : SKIP
185
+ update_time = hash.key?('update_time') ? hash['update_time'] : SKIP
186
+ processor_response = ProcessorResponse.from_hash(hash['processor_response']) if
187
+ hash['processor_response']
188
+
189
+ # Create object from extracted values.
190
+ AuthorizationWithAdditionalData.new(status: status,
191
+ status_details: status_details,
192
+ id: id,
193
+ amount: amount,
194
+ invoice_id: invoice_id,
195
+ custom_id: custom_id,
196
+ network_transaction_reference: network_transaction_reference,
197
+ seller_protection: seller_protection,
198
+ expiration_time: expiration_time,
199
+ links: links,
200
+ create_time: create_time,
201
+ update_time: update_time,
202
+ processor_response: processor_response)
203
+ end
204
+ end
205
+ end
@@ -0,0 +1,90 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # The address verification code for Visa, Discover, Mastercard, or American
8
+ # Express transactions.
9
+ class AVSCode
10
+ AVS_CODE = [
11
+ # TODO: Write general description for A
12
+ A = 'A'.freeze,
13
+
14
+ # TODO: Write general description for B
15
+ B = 'B'.freeze,
16
+
17
+ # TODO: Write general description for C
18
+ C = 'C'.freeze,
19
+
20
+ # TODO: Write general description for D
21
+ D = 'D'.freeze,
22
+
23
+ # TODO: Write general description for E
24
+ E = 'E'.freeze,
25
+
26
+ # TODO: Write general description for F
27
+ F = 'F'.freeze,
28
+
29
+ # TODO: Write general description for G
30
+ G = 'G'.freeze,
31
+
32
+ # TODO: Write general description for I
33
+ I = 'I'.freeze,
34
+
35
+ # TODO: Write general description for M
36
+ M = 'M'.freeze,
37
+
38
+ # TODO: Write general description for N
39
+ N = 'N'.freeze,
40
+
41
+ # TODO: Write general description for P
42
+ P = 'P'.freeze,
43
+
44
+ # TODO: Write general description for R
45
+ R = 'R'.freeze,
46
+
47
+ # TODO: Write general description for S
48
+ S = 'S'.freeze,
49
+
50
+ # TODO: Write general description for U
51
+ U = 'U'.freeze,
52
+
53
+ # TODO: Write general description for W
54
+ W = 'W'.freeze,
55
+
56
+ # TODO: Write general description for X
57
+ X = 'X'.freeze,
58
+
59
+ # TODO: Write general description for Y
60
+ Y = 'Y'.freeze,
61
+
62
+ # TODO: Write general description for Z
63
+ Z = 'Z'.freeze,
64
+
65
+ # TODO: Write general description for NULL
66
+ NULL = 'Null'.freeze,
67
+
68
+ # TODO: Write general description for ENUM_0
69
+ ENUM_0 = '0'.freeze,
70
+
71
+ # TODO: Write general description for ENUM_1
72
+ ENUM_1 = '1'.freeze,
73
+
74
+ # TODO: Write general description for ENUM_2
75
+ ENUM_2 = '2'.freeze,
76
+
77
+ # TODO: Write general description for ENUM_3
78
+ ENUM_3 = '3'.freeze,
79
+
80
+ # TODO: Write general description for ENUM_4
81
+ ENUM_4 = '4'.freeze
82
+ ].freeze
83
+
84
+ def self.validate(value)
85
+ return false if value.nil?
86
+
87
+ true
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,95 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # Information used to pay Bancontact.
8
+ class BancontactPaymentObject < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The full name representation like Mr J Smith.
13
+ # @return [String]
14
+ attr_accessor :name
15
+
16
+ # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
17
+ # that identifies the country or region.<blockquote><strong>Note:</strong>
18
+ # The country code for Great Britain is <code>GB</code> and not
19
+ # <code>UK</code> as used in the top-level domain names for that country.
20
+ # Use the `C2` country code for China worldwide for comparable uncontrolled
21
+ # price (CUP) method, bank card, and cross-border transactions.</blockquote>
22
+ # @return [String]
23
+ attr_accessor :country_code
24
+
25
+ # The business identification code (BIC). In payments systems, a BIC is used
26
+ # to identify a specific business, most commonly a bank.
27
+ # @return [String]
28
+ attr_accessor :bic
29
+
30
+ # The last characters of the IBAN used to pay.
31
+ # @return [String]
32
+ attr_accessor :iban_last_chars
33
+
34
+ # The last digits of the card used to fund the Bancontact payment.
35
+ # @return [String]
36
+ attr_accessor :card_last_digits
37
+
38
+ # A mapping from model property names to API property names.
39
+ def self.names
40
+ @_hash = {} if @_hash.nil?
41
+ @_hash['name'] = 'name'
42
+ @_hash['country_code'] = 'country_code'
43
+ @_hash['bic'] = 'bic'
44
+ @_hash['iban_last_chars'] = 'iban_last_chars'
45
+ @_hash['card_last_digits'] = 'card_last_digits'
46
+ @_hash
47
+ end
48
+
49
+ # An array for optional fields
50
+ def self.optionals
51
+ %w[
52
+ name
53
+ country_code
54
+ bic
55
+ iban_last_chars
56
+ card_last_digits
57
+ ]
58
+ end
59
+
60
+ # An array for nullable fields
61
+ def self.nullables
62
+ []
63
+ end
64
+
65
+ def initialize(name: SKIP, country_code: SKIP, bic: SKIP,
66
+ iban_last_chars: SKIP, card_last_digits: SKIP)
67
+ @name = name unless name == SKIP
68
+ @country_code = country_code unless country_code == SKIP
69
+ @bic = bic unless bic == SKIP
70
+ @iban_last_chars = iban_last_chars unless iban_last_chars == SKIP
71
+ @card_last_digits = card_last_digits unless card_last_digits == SKIP
72
+ end
73
+
74
+ # Creates an instance of the object from a hash.
75
+ def self.from_hash(hash)
76
+ return nil unless hash
77
+
78
+ # Extract variables from the hash.
79
+ name = hash.key?('name') ? hash['name'] : SKIP
80
+ country_code = hash.key?('country_code') ? hash['country_code'] : SKIP
81
+ bic = hash.key?('bic') ? hash['bic'] : SKIP
82
+ iban_last_chars =
83
+ hash.key?('iban_last_chars') ? hash['iban_last_chars'] : SKIP
84
+ card_last_digits =
85
+ hash.key?('card_last_digits') ? hash['card_last_digits'] : SKIP
86
+
87
+ # Create object from extracted values.
88
+ BancontactPaymentObject.new(name: name,
89
+ country_code: country_code,
90
+ bic: bic,
91
+ iban_last_chars: iban_last_chars,
92
+ card_last_digits: card_last_digits)
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,73 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # Information needed to pay using Bancontact.
8
+ class BancontactPaymentRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The full name representation like Mr J Smith.
13
+ # @return [String]
14
+ attr_accessor :name
15
+
16
+ # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
17
+ # that identifies the country or region.<blockquote><strong>Note:</strong>
18
+ # The country code for Great Britain is <code>GB</code> and not
19
+ # <code>UK</code> as used in the top-level domain names for that country.
20
+ # Use the `C2` country code for China worldwide for comparable uncontrolled
21
+ # price (CUP) method, bank card, and cross-border transactions.</blockquote>
22
+ # @return [String]
23
+ attr_accessor :country_code
24
+
25
+ # Customizes the payer experience during the approval process for the
26
+ # payment.
27
+ # @return [ExperienceContext]
28
+ attr_accessor :experience_context
29
+
30
+ # A mapping from model property names to API property names.
31
+ def self.names
32
+ @_hash = {} if @_hash.nil?
33
+ @_hash['name'] = 'name'
34
+ @_hash['country_code'] = 'country_code'
35
+ @_hash['experience_context'] = 'experience_context'
36
+ @_hash
37
+ end
38
+
39
+ # An array for optional fields
40
+ def self.optionals
41
+ %w[
42
+ experience_context
43
+ ]
44
+ end
45
+
46
+ # An array for nullable fields
47
+ def self.nullables
48
+ []
49
+ end
50
+
51
+ def initialize(name:, country_code:, experience_context: SKIP)
52
+ @name = name
53
+ @country_code = country_code
54
+ @experience_context = experience_context unless experience_context == SKIP
55
+ end
56
+
57
+ # Creates an instance of the object from a hash.
58
+ def self.from_hash(hash)
59
+ return nil unless hash
60
+
61
+ # Extract variables from the hash.
62
+ name = hash.key?('name') ? hash['name'] : nil
63
+ country_code = hash.key?('country_code') ? hash['country_code'] : nil
64
+ experience_context = ExperienceContext.from_hash(hash['experience_context']) if
65
+ hash['experience_context']
66
+
67
+ # Create object from extracted values.
68
+ BancontactPaymentRequest.new(name: name,
69
+ country_code: country_code,
70
+ experience_context: experience_context)
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,62 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # Base model.
8
+ class BaseModel < CoreLibrary::BaseModel
9
+ # Returns a Hash representation of the current object.
10
+ def to_hash
11
+ # validating the model being serialized
12
+ self.class.validate(self) if self.class.respond_to?(:validate)
13
+
14
+ hash = {}
15
+ instance_variables.each do |name|
16
+ value = instance_variable_get(name)
17
+ name = name[1..]
18
+ key = self.class.names.key?(name) ? self.class.names[name] : name
19
+ optional_fields = self.class.optionals
20
+ nullable_fields = self.class.nullables
21
+ if value.nil?
22
+ next unless nullable_fields.include?(name)
23
+
24
+ if !optional_fields.include?(name) && !nullable_fields.include?(name)
25
+ raise ArgumentError,
26
+ "`#{name}` cannot be nil in `#{self.class}`. Please specify a valid value."
27
+ end
28
+ end
29
+
30
+ hash[key] = nil
31
+ unless value.nil?
32
+ if respond_to?("to_custom_#{name}")
33
+ if (value.instance_of? Array) || (value.instance_of? Hash)
34
+ params = [hash, key]
35
+ hash[key] = send("to_custom_#{name}", *params)
36
+ else
37
+ hash[key] = send("to_custom_#{name}")
38
+ end
39
+ elsif respond_to?("to_union_type_#{name}")
40
+ hash[key] = send("to_union_type_#{name}")
41
+ elsif value.instance_of? Array
42
+ hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
43
+ elsif value.instance_of? Hash
44
+ hash[key] = {}
45
+ value.each do |k, v|
46
+ hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
47
+ end
48
+ else
49
+ hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
50
+ end
51
+ end
52
+ end
53
+ hash
54
+ end
55
+
56
+ # Returns a JSON representation of the curent object.
57
+ def to_json(options = {})
58
+ hash = to_hash
59
+ hash.to_json(options)
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,88 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # Bank Identification Number (BIN) details used to fund a payment.
8
+ class BinDetails < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The Bank Identification Number (BIN) signifies the number that is being
13
+ # used to identify the granular level details (except the PII information)
14
+ # of the card.
15
+ # @return [String]
16
+ attr_accessor :bin
17
+
18
+ # The issuer of the card instrument.
19
+ # @return [String]
20
+ attr_accessor :issuing_bank
21
+
22
+ # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
23
+ # that identifies the country or region.<blockquote><strong>Note:</strong>
24
+ # The country code for Great Britain is <code>GB</code> and not
25
+ # <code>UK</code> as used in the top-level domain names for that country.
26
+ # Use the `C2` country code for China worldwide for comparable uncontrolled
27
+ # price (CUP) method, bank card, and cross-border transactions.</blockquote>
28
+ # @return [String]
29
+ attr_accessor :bin_country_code
30
+
31
+ # The type of card product assigned to the BIN by the issuer. These values
32
+ # are defined by the issuer and may change over time. Some examples include:
33
+ # PREPAID_GIFT, CONSUMER, CORPORATE.
34
+ # @return [Array[String]]
35
+ attr_accessor :products
36
+
37
+ # A mapping from model property names to API property names.
38
+ def self.names
39
+ @_hash = {} if @_hash.nil?
40
+ @_hash['bin'] = 'bin'
41
+ @_hash['issuing_bank'] = 'issuing_bank'
42
+ @_hash['bin_country_code'] = 'bin_country_code'
43
+ @_hash['products'] = 'products'
44
+ @_hash
45
+ end
46
+
47
+ # An array for optional fields
48
+ def self.optionals
49
+ %w[
50
+ bin
51
+ issuing_bank
52
+ bin_country_code
53
+ products
54
+ ]
55
+ end
56
+
57
+ # An array for nullable fields
58
+ def self.nullables
59
+ []
60
+ end
61
+
62
+ def initialize(bin: SKIP, issuing_bank: SKIP, bin_country_code: SKIP,
63
+ products: SKIP)
64
+ @bin = bin unless bin == SKIP
65
+ @issuing_bank = issuing_bank unless issuing_bank == SKIP
66
+ @bin_country_code = bin_country_code unless bin_country_code == SKIP
67
+ @products = products unless products == SKIP
68
+ end
69
+
70
+ # Creates an instance of the object from a hash.
71
+ def self.from_hash(hash)
72
+ return nil unless hash
73
+
74
+ # Extract variables from the hash.
75
+ bin = hash.key?('bin') ? hash['bin'] : SKIP
76
+ issuing_bank = hash.key?('issuing_bank') ? hash['issuing_bank'] : SKIP
77
+ bin_country_code =
78
+ hash.key?('bin_country_code') ? hash['bin_country_code'] : SKIP
79
+ products = hash.key?('products') ? hash['products'] : SKIP
80
+
81
+ # Create object from extracted values.
82
+ BinDetails.new(bin: bin,
83
+ issuing_bank: issuing_bank,
84
+ bin_country_code: bin_country_code,
85
+ products: products)
86
+ end
87
+ end
88
+ end