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,212 @@
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 authorized payment transaction.
8
+ class PaymentAuthorization < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The status for the authorized payment.
13
+ # @return [AuthorizationStatus]
14
+ attr_accessor :status
15
+
16
+ # The details of the authorized payment status.
17
+ # @return [AuthorizationStatusDetails]
18
+ attr_accessor :status_details
19
+
20
+ # The PayPal-generated ID for the authorized payment.
21
+ # @return [String]
22
+ attr_accessor :id
23
+
24
+ # The currency and amount for a financial transaction, such as a balance or
25
+ # payment due.
26
+ # @return [Money]
27
+ attr_accessor :amount
28
+
29
+ # The API caller-provided external invoice number for this order. Appears in
30
+ # both the payer's transaction history and the emails that the payer
31
+ # receives.
32
+ # @return [String]
33
+ attr_accessor :invoice_id
34
+
35
+ # The API caller-provided external ID. Used to reconcile API
36
+ # caller-initiated transactions with PayPal transactions. Appears in
37
+ # transaction and settlement reports.
38
+ # @return [String]
39
+ attr_accessor :custom_id
40
+
41
+ # Reference values used by the card network to identify a transaction.
42
+ # @return [NetworkTransactionReference]
43
+ attr_accessor :network_transaction_reference
44
+
45
+ # The level of protection offered as defined by [PayPal Seller Protection
46
+ # for
47
+ # Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protectio
48
+ # n).
49
+ # @return [SellerProtection]
50
+ attr_accessor :seller_protection
51
+
52
+ # The date and time, in [Internet date and time
53
+ # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
54
+ # required while fractional seconds are
55
+ # optional.<blockquote><strong>Note:</strong> The regular expression
56
+ # provides guidance but does not reject all invalid dates.</blockquote>
57
+ # @return [String]
58
+ attr_accessor :expiration_time
59
+
60
+ # An array of related [HATEOAS
61
+ # links](/docs/api/reference/api-responses/#hateoas-links).
62
+ # @return [Array[LinkDescription]]
63
+ attr_accessor :links
64
+
65
+ # The date and time, in [Internet date and time
66
+ # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
67
+ # required while fractional seconds are
68
+ # optional.<blockquote><strong>Note:</strong> The regular expression
69
+ # provides guidance but does not reject all invalid dates.</blockquote>
70
+ # @return [String]
71
+ attr_accessor :create_time
72
+
73
+ # The date and time, in [Internet date and time
74
+ # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
75
+ # required while fractional seconds are
76
+ # optional.<blockquote><strong>Note:</strong> The regular expression
77
+ # provides guidance but does not reject all invalid dates.</blockquote>
78
+ # @return [String]
79
+ attr_accessor :update_time
80
+
81
+ # The supplementary data.
82
+ # @return [PaymentSupplementaryData]
83
+ attr_accessor :supplementary_data
84
+
85
+ # The details for the merchant who receives the funds and fulfills the
86
+ # order. The merchant is also known as the payee.
87
+ # @return [Payee]
88
+ attr_accessor :payee
89
+
90
+ # A mapping from model property names to API property names.
91
+ def self.names
92
+ @_hash = {} if @_hash.nil?
93
+ @_hash['status'] = 'status'
94
+ @_hash['status_details'] = 'status_details'
95
+ @_hash['id'] = 'id'
96
+ @_hash['amount'] = 'amount'
97
+ @_hash['invoice_id'] = 'invoice_id'
98
+ @_hash['custom_id'] = 'custom_id'
99
+ @_hash['network_transaction_reference'] =
100
+ 'network_transaction_reference'
101
+ @_hash['seller_protection'] = 'seller_protection'
102
+ @_hash['expiration_time'] = 'expiration_time'
103
+ @_hash['links'] = 'links'
104
+ @_hash['create_time'] = 'create_time'
105
+ @_hash['update_time'] = 'update_time'
106
+ @_hash['supplementary_data'] = 'supplementary_data'
107
+ @_hash['payee'] = 'payee'
108
+ @_hash
109
+ end
110
+
111
+ # An array for optional fields
112
+ def self.optionals
113
+ %w[
114
+ status
115
+ status_details
116
+ id
117
+ amount
118
+ invoice_id
119
+ custom_id
120
+ network_transaction_reference
121
+ seller_protection
122
+ expiration_time
123
+ links
124
+ create_time
125
+ update_time
126
+ supplementary_data
127
+ payee
128
+ ]
129
+ end
130
+
131
+ # An array for nullable fields
132
+ def self.nullables
133
+ []
134
+ end
135
+
136
+ def initialize(status: SKIP, status_details: SKIP, id: SKIP, amount: SKIP,
137
+ invoice_id: SKIP, custom_id: SKIP,
138
+ network_transaction_reference: SKIP, seller_protection: SKIP,
139
+ expiration_time: SKIP, links: SKIP, create_time: SKIP,
140
+ update_time: SKIP, supplementary_data: SKIP, payee: SKIP)
141
+ @status = status unless status == SKIP
142
+ @status_details = status_details unless status_details == SKIP
143
+ @id = id unless id == SKIP
144
+ @amount = amount unless amount == SKIP
145
+ @invoice_id = invoice_id unless invoice_id == SKIP
146
+ @custom_id = custom_id unless custom_id == SKIP
147
+ unless network_transaction_reference == SKIP
148
+ @network_transaction_reference =
149
+ network_transaction_reference
150
+ end
151
+ @seller_protection = seller_protection unless seller_protection == SKIP
152
+ @expiration_time = expiration_time unless expiration_time == SKIP
153
+ @links = links unless links == SKIP
154
+ @create_time = create_time unless create_time == SKIP
155
+ @update_time = update_time unless update_time == SKIP
156
+ @supplementary_data = supplementary_data unless supplementary_data == SKIP
157
+ @payee = payee unless payee == SKIP
158
+ end
159
+
160
+ # Creates an instance of the object from a hash.
161
+ def self.from_hash(hash)
162
+ return nil unless hash
163
+
164
+ # Extract variables from the hash.
165
+ status = hash.key?('status') ? hash['status'] : SKIP
166
+ status_details = AuthorizationStatusDetails.from_hash(hash['status_details']) if
167
+ hash['status_details']
168
+ id = hash.key?('id') ? hash['id'] : SKIP
169
+ amount = Money.from_hash(hash['amount']) if hash['amount']
170
+ invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP
171
+ custom_id = hash.key?('custom_id') ? hash['custom_id'] : SKIP
172
+ if hash['network_transaction_reference']
173
+ network_transaction_reference = NetworkTransactionReference.from_hash(hash['network_transaction_reference'])
174
+ end
175
+ seller_protection = SellerProtection.from_hash(hash['seller_protection']) if
176
+ hash['seller_protection']
177
+ expiration_time =
178
+ hash.key?('expiration_time') ? hash['expiration_time'] : SKIP
179
+ # Parameter is an array, so we need to iterate through it
180
+ links = nil
181
+ unless hash['links'].nil?
182
+ links = []
183
+ hash['links'].each do |structure|
184
+ links << (LinkDescription.from_hash(structure) if structure)
185
+ end
186
+ end
187
+
188
+ links = SKIP unless hash.key?('links')
189
+ create_time = hash.key?('create_time') ? hash['create_time'] : SKIP
190
+ update_time = hash.key?('update_time') ? hash['update_time'] : SKIP
191
+ supplementary_data = PaymentSupplementaryData.from_hash(hash['supplementary_data']) if
192
+ hash['supplementary_data']
193
+ payee = Payee.from_hash(hash['payee']) if hash['payee']
194
+
195
+ # Create object from extracted values.
196
+ PaymentAuthorization.new(status: status,
197
+ status_details: status_details,
198
+ id: id,
199
+ amount: amount,
200
+ invoice_id: invoice_id,
201
+ custom_id: custom_id,
202
+ network_transaction_reference: network_transaction_reference,
203
+ seller_protection: seller_protection,
204
+ expiration_time: expiration_time,
205
+ links: links,
206
+ create_time: create_time,
207
+ update_time: update_time,
208
+ supplementary_data: supplementary_data,
209
+ payee: payee)
210
+ end
211
+ end
212
+ end
@@ -0,0 +1,99 @@
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 collection of payments, or transactions, for a purchase unit in an
8
+ # order. For example, authorized payments, captured payments, and refunds.
9
+ class PaymentCollection < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # An array of authorized payments for a purchase unit. A purchase unit can
14
+ # have zero or more authorized payments.
15
+ # @return [Array[AuthorizationWithAdditionalData]]
16
+ attr_accessor :authorizations
17
+
18
+ # An array of captured payments for a purchase unit. A purchase unit can
19
+ # have zero or more captured payments.
20
+ # @return [Array[Capture]]
21
+ attr_accessor :captures
22
+
23
+ # An array of refunds for a purchase unit. A purchase unit can have zero or
24
+ # more refunds.
25
+ # @return [Array[Refund]]
26
+ attr_accessor :refunds
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['authorizations'] = 'authorizations'
32
+ @_hash['captures'] = 'captures'
33
+ @_hash['refunds'] = 'refunds'
34
+ @_hash
35
+ end
36
+
37
+ # An array for optional fields
38
+ def self.optionals
39
+ %w[
40
+ authorizations
41
+ captures
42
+ refunds
43
+ ]
44
+ end
45
+
46
+ # An array for nullable fields
47
+ def self.nullables
48
+ []
49
+ end
50
+
51
+ def initialize(authorizations: SKIP, captures: SKIP, refunds: SKIP)
52
+ @authorizations = authorizations unless authorizations == SKIP
53
+ @captures = captures unless captures == SKIP
54
+ @refunds = refunds unless refunds == 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
+ # Parameter is an array, so we need to iterate through it
63
+ authorizations = nil
64
+ unless hash['authorizations'].nil?
65
+ authorizations = []
66
+ hash['authorizations'].each do |structure|
67
+ authorizations << (AuthorizationWithAdditionalData.from_hash(structure) if structure)
68
+ end
69
+ end
70
+
71
+ authorizations = SKIP unless hash.key?('authorizations')
72
+ # Parameter is an array, so we need to iterate through it
73
+ captures = nil
74
+ unless hash['captures'].nil?
75
+ captures = []
76
+ hash['captures'].each do |structure|
77
+ captures << (Capture.from_hash(structure) if structure)
78
+ end
79
+ end
80
+
81
+ captures = SKIP unless hash.key?('captures')
82
+ # Parameter is an array, so we need to iterate through it
83
+ refunds = nil
84
+ unless hash['refunds'].nil?
85
+ refunds = []
86
+ hash['refunds'].each do |structure|
87
+ refunds << (Refund.from_hash(structure) if structure)
88
+ end
89
+ end
90
+
91
+ refunds = SKIP unless hash.key?('refunds')
92
+
93
+ # Create object from extracted values.
94
+ PaymentCollection.new(authorizations: authorizations,
95
+ captures: captures,
96
+ refunds: refunds)
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,23 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # The person or party who initiated or triggered the payment.
8
+ class PaymentInitiator
9
+ PAYMENT_INITIATOR = [
10
+ # TODO: Write general description for CUSTOMER
11
+ CUSTOMER = 'CUSTOMER'.freeze,
12
+
13
+ # TODO: Write general description for MERCHANT
14
+ MERCHANT = 'MERCHANT'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ true
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,105 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # Any additional payment instructions to be consider during payment
8
+ # processing. This processing instruction is applicable for Capturing an order
9
+ # or Authorizing an Order.
10
+ class PaymentInstruction < BaseModel
11
+ SKIP = Object.new
12
+ private_constant :SKIP
13
+
14
+ # An array of various fees, commissions, tips, or donations. This field is
15
+ # only applicable to merchants that been enabled for PayPal Complete
16
+ # Payments Platform for Marketplaces and Platforms capability.
17
+ # @return [Array[PlatformFee]]
18
+ attr_accessor :platform_fees
19
+
20
+ # The funds that are held on behalf of the merchant.
21
+ # @return [DisbursementMode]
22
+ attr_accessor :disbursement_mode
23
+
24
+ # This field is only enabled for selected merchants/partners to use and
25
+ # provides the ability to trigger a specific pricing rate/plan for a payment
26
+ # transaction. The list of eligible 'payee_pricing_tier_id' would be
27
+ # provided to you by your Account Manager. Specifying values other than the
28
+ # one provided to you by your account manager would result in an error.
29
+ # @return [String]
30
+ attr_accessor :payee_pricing_tier_id
31
+
32
+ # FX identifier generated returned by PayPal to be used for payment
33
+ # processing in order to honor FX rate (for eligible integrations) to be
34
+ # used when amount is settled/received into the payee account.
35
+ # @return [String]
36
+ attr_accessor :payee_receivable_fx_rate_id
37
+
38
+ # A mapping from model property names to API property names.
39
+ def self.names
40
+ @_hash = {} if @_hash.nil?
41
+ @_hash['platform_fees'] = 'platform_fees'
42
+ @_hash['disbursement_mode'] = 'disbursement_mode'
43
+ @_hash['payee_pricing_tier_id'] = 'payee_pricing_tier_id'
44
+ @_hash['payee_receivable_fx_rate_id'] = 'payee_receivable_fx_rate_id'
45
+ @_hash
46
+ end
47
+
48
+ # An array for optional fields
49
+ def self.optionals
50
+ %w[
51
+ platform_fees
52
+ disbursement_mode
53
+ payee_pricing_tier_id
54
+ payee_receivable_fx_rate_id
55
+ ]
56
+ end
57
+
58
+ # An array for nullable fields
59
+ def self.nullables
60
+ []
61
+ end
62
+
63
+ def initialize(platform_fees: SKIP,
64
+ disbursement_mode: DisbursementMode::INSTANT,
65
+ payee_pricing_tier_id: SKIP,
66
+ payee_receivable_fx_rate_id: SKIP)
67
+ @platform_fees = platform_fees unless platform_fees == SKIP
68
+ @disbursement_mode = disbursement_mode unless disbursement_mode == SKIP
69
+ @payee_pricing_tier_id = payee_pricing_tier_id unless payee_pricing_tier_id == SKIP
70
+ unless payee_receivable_fx_rate_id == SKIP
71
+ @payee_receivable_fx_rate_id =
72
+ payee_receivable_fx_rate_id
73
+ end
74
+ end
75
+
76
+ # Creates an instance of the object from a hash.
77
+ def self.from_hash(hash)
78
+ return nil unless hash
79
+
80
+ # Extract variables from the hash.
81
+ # Parameter is an array, so we need to iterate through it
82
+ platform_fees = nil
83
+ unless hash['platform_fees'].nil?
84
+ platform_fees = []
85
+ hash['platform_fees'].each do |structure|
86
+ platform_fees << (PlatformFee.from_hash(structure) if structure)
87
+ end
88
+ end
89
+
90
+ platform_fees = SKIP unless hash.key?('platform_fees')
91
+ disbursement_mode =
92
+ hash['disbursement_mode'] ||= DisbursementMode::INSTANT
93
+ payee_pricing_tier_id =
94
+ hash.key?('payee_pricing_tier_id') ? hash['payee_pricing_tier_id'] : SKIP
95
+ payee_receivable_fx_rate_id =
96
+ hash.key?('payee_receivable_fx_rate_id') ? hash['payee_receivable_fx_rate_id'] : SKIP
97
+
98
+ # Create object from extracted values.
99
+ PaymentInstruction.new(platform_fees: platform_fees,
100
+ disbursement_mode: disbursement_mode,
101
+ payee_pricing_tier_id: payee_pricing_tier_id,
102
+ payee_receivable_fx_rate_id: payee_receivable_fx_rate_id)
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,72 @@
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 customer and merchant payment preferences.
8
+ class PaymentMethodPreference < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The merchant-preferred payment methods.
13
+ # @return [PayeePaymentMethodPreference]
14
+ attr_accessor :payee_preferred
15
+
16
+ # NACHA (the regulatory body governing the ACH network) requires that API
17
+ # callers (merchants, partners) obtain the consumer’s explicit authorization
18
+ # before initiating a transaction. To stay compliant, you’ll need to make
19
+ # sure that you retain a compliant authorization for each transaction that
20
+ # you originate to the ACH Network using this API. ACH transactions are
21
+ # categorized (using SEC codes) by how you capture authorization from the
22
+ # Receiver (the person whose bank account is being debited or credited).
23
+ # PayPal supports the following SEC codes.
24
+ # @return [StandardEntryClassCode]
25
+ attr_accessor :standard_entry_class_code
26
+
27
+ # A mapping from model property names to API property names.
28
+ def self.names
29
+ @_hash = {} if @_hash.nil?
30
+ @_hash['payee_preferred'] = 'payee_preferred'
31
+ @_hash['standard_entry_class_code'] = 'standard_entry_class_code'
32
+ @_hash
33
+ end
34
+
35
+ # An array for optional fields
36
+ def self.optionals
37
+ %w[
38
+ payee_preferred
39
+ standard_entry_class_code
40
+ ]
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(payee_preferred: PayeePaymentMethodPreference::UNRESTRICTED,
49
+ standard_entry_class_code: StandardEntryClassCode::WEB)
50
+ @payee_preferred = payee_preferred unless payee_preferred == SKIP
51
+ unless standard_entry_class_code == SKIP
52
+ @standard_entry_class_code =
53
+ standard_entry_class_code
54
+ end
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
+ payee_preferred =
63
+ hash['payee_preferred'] ||= PayeePaymentMethodPreference::UNRESTRICTED
64
+ standard_entry_class_code =
65
+ hash['standard_entry_class_code'] ||= StandardEntryClassCode::WEB
66
+
67
+ # Create object from extracted values.
68
+ PaymentMethodPreference.new(payee_preferred: payee_preferred,
69
+ standard_entry_class_code: standard_entry_class_code)
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,187 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # The payment source definition.
8
+ class PaymentSource < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The payment card to use to fund a payment. Can be a credit or debit
13
+ # card.<blockquote><strong>Note:</strong> Passing card number, cvv and
14
+ # expiry directly via the API requires <a
15
+ # href="https://www.pcisecuritystandards.org/pci_security/completing_self_as
16
+ # sessment"> PCI SAQ D compliance</a>. <br>*PayPal offers a mechanism by
17
+ # which you do not have to take on the <strong>PCI SAQ D</strong> burden by
18
+ # using hosted fields - refer to <a
19
+ # href="https://developer.paypal.com/docs/checkout/advanced/integrate/">this
20
+ # Integration Guide</a>*.</blockquote>
21
+ # @return [CardRequest]
22
+ attr_accessor :card
23
+
24
+ # The tokenized payment source to fund a payment.
25
+ # @return [Token]
26
+ attr_accessor :token
27
+
28
+ # A resource that identifies a PayPal Wallet is used for payment.
29
+ # @return [PayPalWallet]
30
+ attr_accessor :paypal
31
+
32
+ # Information needed to pay using Bancontact.
33
+ # @return [BancontactPaymentRequest]
34
+ attr_accessor :bancontact
35
+
36
+ # Information needed to pay using BLIK.
37
+ # @return [BLIKPaymentRequest]
38
+ attr_accessor :blik
39
+
40
+ # Information needed to pay using eps.
41
+ # @return [EPSPaymentRequest]
42
+ attr_accessor :eps
43
+
44
+ # Information needed to pay using giropay.
45
+ # @return [GiropayPaymentRequest]
46
+ attr_accessor :giropay
47
+
48
+ # Information needed to pay using iDEAL.
49
+ # @return [IDEALPaymentRequest]
50
+ attr_accessor :ideal
51
+
52
+ # Information needed to pay using MyBank.
53
+ # @return [MyBankPaymentRequest]
54
+ attr_accessor :mybank
55
+
56
+ # Information needed to pay using P24 (Przelewy24).
57
+ # @return [P24PaymentRequest]
58
+ attr_accessor :p24
59
+
60
+ # Information needed to pay using Sofort.
61
+ # @return [SofortPaymentRequest]
62
+ attr_accessor :sofort
63
+
64
+ # Information needed to pay using Trustly.
65
+ # @return [TrustlyPaymentRequest]
66
+ attr_accessor :trustly
67
+
68
+ # Information needed to pay using ApplePay.
69
+ # @return [ApplePayRequest]
70
+ attr_accessor :apple_pay
71
+
72
+ # Information needed to pay using Google Pay.
73
+ # @return [GooglePayRequest]
74
+ attr_accessor :google_pay
75
+
76
+ # Information needed to pay using Venmo.
77
+ # @return [VenmoWalletRequest]
78
+ attr_accessor :venmo
79
+
80
+ # A mapping from model property names to API property names.
81
+ def self.names
82
+ @_hash = {} if @_hash.nil?
83
+ @_hash['card'] = 'card'
84
+ @_hash['token'] = 'token'
85
+ @_hash['paypal'] = 'paypal'
86
+ @_hash['bancontact'] = 'bancontact'
87
+ @_hash['blik'] = 'blik'
88
+ @_hash['eps'] = 'eps'
89
+ @_hash['giropay'] = 'giropay'
90
+ @_hash['ideal'] = 'ideal'
91
+ @_hash['mybank'] = 'mybank'
92
+ @_hash['p24'] = 'p24'
93
+ @_hash['sofort'] = 'sofort'
94
+ @_hash['trustly'] = 'trustly'
95
+ @_hash['apple_pay'] = 'apple_pay'
96
+ @_hash['google_pay'] = 'google_pay'
97
+ @_hash['venmo'] = 'venmo'
98
+ @_hash
99
+ end
100
+
101
+ # An array for optional fields
102
+ def self.optionals
103
+ %w[
104
+ card
105
+ token
106
+ paypal
107
+ bancontact
108
+ blik
109
+ eps
110
+ giropay
111
+ ideal
112
+ mybank
113
+ p24
114
+ sofort
115
+ trustly
116
+ apple_pay
117
+ google_pay
118
+ venmo
119
+ ]
120
+ end
121
+
122
+ # An array for nullable fields
123
+ def self.nullables
124
+ []
125
+ end
126
+
127
+ def initialize(card: SKIP, token: SKIP, paypal: SKIP, bancontact: SKIP,
128
+ blik: SKIP, eps: SKIP, giropay: SKIP, ideal: SKIP,
129
+ mybank: SKIP, p24: SKIP, sofort: SKIP, trustly: SKIP,
130
+ apple_pay: SKIP, google_pay: SKIP, venmo: SKIP)
131
+ @card = card unless card == SKIP
132
+ @token = token unless token == SKIP
133
+ @paypal = paypal unless paypal == SKIP
134
+ @bancontact = bancontact unless bancontact == SKIP
135
+ @blik = blik unless blik == SKIP
136
+ @eps = eps unless eps == SKIP
137
+ @giropay = giropay unless giropay == SKIP
138
+ @ideal = ideal unless ideal == SKIP
139
+ @mybank = mybank unless mybank == SKIP
140
+ @p24 = p24 unless p24 == SKIP
141
+ @sofort = sofort unless sofort == SKIP
142
+ @trustly = trustly unless trustly == SKIP
143
+ @apple_pay = apple_pay unless apple_pay == SKIP
144
+ @google_pay = google_pay unless google_pay == SKIP
145
+ @venmo = venmo unless venmo == SKIP
146
+ end
147
+
148
+ # Creates an instance of the object from a hash.
149
+ def self.from_hash(hash)
150
+ return nil unless hash
151
+
152
+ # Extract variables from the hash.
153
+ card = CardRequest.from_hash(hash['card']) if hash['card']
154
+ token = Token.from_hash(hash['token']) if hash['token']
155
+ paypal = PayPalWallet.from_hash(hash['paypal']) if hash['paypal']
156
+ bancontact = BancontactPaymentRequest.from_hash(hash['bancontact']) if hash['bancontact']
157
+ blik = BLIKPaymentRequest.from_hash(hash['blik']) if hash['blik']
158
+ eps = EPSPaymentRequest.from_hash(hash['eps']) if hash['eps']
159
+ giropay = GiropayPaymentRequest.from_hash(hash['giropay']) if hash['giropay']
160
+ ideal = IDEALPaymentRequest.from_hash(hash['ideal']) if hash['ideal']
161
+ mybank = MyBankPaymentRequest.from_hash(hash['mybank']) if hash['mybank']
162
+ p24 = P24PaymentRequest.from_hash(hash['p24']) if hash['p24']
163
+ sofort = SofortPaymentRequest.from_hash(hash['sofort']) if hash['sofort']
164
+ trustly = TrustlyPaymentRequest.from_hash(hash['trustly']) if hash['trustly']
165
+ apple_pay = ApplePayRequest.from_hash(hash['apple_pay']) if hash['apple_pay']
166
+ google_pay = GooglePayRequest.from_hash(hash['google_pay']) if hash['google_pay']
167
+ venmo = VenmoWalletRequest.from_hash(hash['venmo']) if hash['venmo']
168
+
169
+ # Create object from extracted values.
170
+ PaymentSource.new(card: card,
171
+ token: token,
172
+ paypal: paypal,
173
+ bancontact: bancontact,
174
+ blik: blik,
175
+ eps: eps,
176
+ giropay: giropay,
177
+ ideal: ideal,
178
+ mybank: mybank,
179
+ p24: p24,
180
+ sofort: sofort,
181
+ trustly: trustly,
182
+ apple_pay: apple_pay,
183
+ google_pay: google_pay,
184
+ venmo: venmo)
185
+ end
186
+ end
187
+ end