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,60 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # Representation of card details as received in the request.
8
+ class CardFromRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date
13
+ # and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
14
+ # @return [String]
15
+ attr_accessor :expiry
16
+
17
+ # The last digits of the payment card.
18
+ # @return [String]
19
+ attr_accessor :last_digits
20
+
21
+ # A mapping from model property names to API property names.
22
+ def self.names
23
+ @_hash = {} if @_hash.nil?
24
+ @_hash['expiry'] = 'expiry'
25
+ @_hash['last_digits'] = 'last_digits'
26
+ @_hash
27
+ end
28
+
29
+ # An array for optional fields
30
+ def self.optionals
31
+ %w[
32
+ expiry
33
+ last_digits
34
+ ]
35
+ end
36
+
37
+ # An array for nullable fields
38
+ def self.nullables
39
+ []
40
+ end
41
+
42
+ def initialize(expiry: SKIP, last_digits: SKIP)
43
+ @expiry = expiry unless expiry == SKIP
44
+ @last_digits = last_digits unless last_digits == SKIP
45
+ end
46
+
47
+ # Creates an instance of the object from a hash.
48
+ def self.from_hash(hash)
49
+ return nil unless hash
50
+
51
+ # Extract variables from the hash.
52
+ expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
53
+ last_digits = hash.key?('last_digits') ? hash['last_digits'] : SKIP
54
+
55
+ # Create object from extracted values.
56
+ CardFromRequest.new(expiry: expiry,
57
+ last_digits: last_digits)
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,166 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # Full representation of a Card Payment Token including network token.
8
+ class CardPaymentToken < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The card holder's name as it appears on the card.
13
+ # @return [String]
14
+ attr_accessor :name
15
+
16
+ # The last digits of the payment card.
17
+ # @return [String]
18
+ attr_accessor :last_digits
19
+
20
+ # The card network or brand. Applies to credit, debit, gift, and payment
21
+ # cards.
22
+ # @return [CardBrand]
23
+ attr_accessor :brand
24
+
25
+ # The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date
26
+ # and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
27
+ # @return [String]
28
+ attr_accessor :expiry
29
+
30
+ # Address request details.
31
+ # @return [AddressDetails]
32
+ attr_accessor :billing_address
33
+
34
+ # Verification status of Card.
35
+ # @return [String]
36
+ attr_accessor :verification_status
37
+
38
+ # Card Verification details including the authorization details and 3D
39
+ # SECURE details.
40
+ # @return [CardVerificationDetails]
41
+ attr_accessor :verification
42
+
43
+ # Previous network transaction reference including id in response.
44
+ # @return [NetworkTransactionReferenceEntity]
45
+ attr_accessor :network_transaction_reference
46
+
47
+ # Results of Authentication such as 3D Secure.
48
+ # @return [CardAuthenticationResponse]
49
+ attr_accessor :authentication_result
50
+
51
+ # Bank Identification Number (BIN) details used to fund a payment.
52
+ # @return [BinDetails]
53
+ attr_accessor :bin_details
54
+
55
+ # Type of card. i.e Credit, Debit and so on.
56
+ # @return [CardType]
57
+ attr_accessor :type
58
+
59
+ # Type of card. i.e Credit, Debit and so on.
60
+ # @return [Object]
61
+ attr_accessor :network_token
62
+
63
+ # A mapping from model property names to API property names.
64
+ def self.names
65
+ @_hash = {} if @_hash.nil?
66
+ @_hash['name'] = 'name'
67
+ @_hash['last_digits'] = 'last_digits'
68
+ @_hash['brand'] = 'brand'
69
+ @_hash['expiry'] = 'expiry'
70
+ @_hash['billing_address'] = 'billing_address'
71
+ @_hash['verification_status'] = 'verification_status'
72
+ @_hash['verification'] = 'verification'
73
+ @_hash['network_transaction_reference'] =
74
+ 'network_transaction_reference'
75
+ @_hash['authentication_result'] = 'authentication_result'
76
+ @_hash['bin_details'] = 'bin_details'
77
+ @_hash['type'] = 'type'
78
+ @_hash['network_token'] = 'network_token'
79
+ @_hash
80
+ end
81
+
82
+ # An array for optional fields
83
+ def self.optionals
84
+ %w[
85
+ name
86
+ last_digits
87
+ brand
88
+ expiry
89
+ billing_address
90
+ verification_status
91
+ verification
92
+ network_transaction_reference
93
+ authentication_result
94
+ bin_details
95
+ type
96
+ network_token
97
+ ]
98
+ end
99
+
100
+ # An array for nullable fields
101
+ def self.nullables
102
+ []
103
+ end
104
+
105
+ def initialize(name: SKIP, last_digits: SKIP, brand: SKIP, expiry: SKIP,
106
+ billing_address: SKIP, verification_status: SKIP,
107
+ verification: SKIP, network_transaction_reference: SKIP,
108
+ authentication_result: SKIP, bin_details: SKIP, type: SKIP,
109
+ network_token: SKIP)
110
+ @name = name unless name == SKIP
111
+ @last_digits = last_digits unless last_digits == SKIP
112
+ @brand = brand unless brand == SKIP
113
+ @expiry = expiry unless expiry == SKIP
114
+ @billing_address = billing_address unless billing_address == SKIP
115
+ @verification_status = verification_status unless verification_status == SKIP
116
+ @verification = verification unless verification == SKIP
117
+ unless network_transaction_reference == SKIP
118
+ @network_transaction_reference =
119
+ network_transaction_reference
120
+ end
121
+ @authentication_result = authentication_result unless authentication_result == SKIP
122
+ @bin_details = bin_details unless bin_details == SKIP
123
+ @type = type unless type == SKIP
124
+ @network_token = network_token unless network_token == SKIP
125
+ end
126
+
127
+ # Creates an instance of the object from a hash.
128
+ def self.from_hash(hash)
129
+ return nil unless hash
130
+
131
+ # Extract variables from the hash.
132
+ name = hash.key?('name') ? hash['name'] : SKIP
133
+ last_digits = hash.key?('last_digits') ? hash['last_digits'] : SKIP
134
+ brand = hash.key?('brand') ? hash['brand'] : SKIP
135
+ expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
136
+ billing_address = AddressDetails.from_hash(hash['billing_address']) if
137
+ hash['billing_address']
138
+ verification_status =
139
+ hash.key?('verification_status') ? hash['verification_status'] : SKIP
140
+ verification = CardVerificationDetails.from_hash(hash['verification']) if
141
+ hash['verification']
142
+ if hash['network_transaction_reference']
143
+ network_transaction_reference = NetworkTransactionReferenceEntity.from_hash(hash['network_transaction_reference'])
144
+ end
145
+ authentication_result = CardAuthenticationResponse.from_hash(hash['authentication_result']) if
146
+ hash['authentication_result']
147
+ bin_details = BinDetails.from_hash(hash['bin_details']) if hash['bin_details']
148
+ type = hash.key?('type') ? hash['type'] : SKIP
149
+ network_token = hash.key?('network_token') ? hash['network_token'] : SKIP
150
+
151
+ # Create object from extracted values.
152
+ CardPaymentToken.new(name: name,
153
+ last_digits: last_digits,
154
+ brand: brand,
155
+ expiry: expiry,
156
+ billing_address: billing_address,
157
+ verification_status: verification_status,
158
+ verification: verification,
159
+ network_transaction_reference: network_transaction_reference,
160
+ authentication_result: authentication_result,
161
+ bin_details: bin_details,
162
+ type: type,
163
+ network_token: network_token)
164
+ end
165
+ end
166
+ end
@@ -0,0 +1,176 @@
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 card to use to fund a payment. Can be a credit or debit
8
+ # card.<blockquote><strong>Note:</strong> Passing card number, cvv and expiry
9
+ # directly via the API requires <a
10
+ # href="https://www.pcisecuritystandards.org/pci_security/completing_self_asse
11
+ # ssment"> PCI SAQ D compliance</a>. <br>*PayPal offers a mechanism by which
12
+ # you do not have to take on the <strong>PCI SAQ D</strong> burden by using
13
+ # hosted fields - refer to <a
14
+ # href="https://developer.paypal.com/docs/checkout/advanced/integrate/">this
15
+ # Integration Guide</a>*.</blockquote>
16
+ class CardRequest < BaseModel
17
+ SKIP = Object.new
18
+ private_constant :SKIP
19
+
20
+ # The card holder's name as it appears on the card.
21
+ # @return [String]
22
+ attr_accessor :name
23
+
24
+ # The primary account number (PAN) for the payment card.
25
+ # @return [String]
26
+ attr_accessor :number
27
+
28
+ # The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date
29
+ # and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
30
+ # @return [String]
31
+ attr_accessor :expiry
32
+
33
+ # The three- or four-digit security code of the card. Also known as the CVV,
34
+ # CVC, CVN, CVE, or CID. This parameter cannot be present in the request
35
+ # when `payment_initiator=MERCHANT`.
36
+ # @return [String]
37
+ attr_accessor :security_code
38
+
39
+ # The portable international postal address. Maps to
40
+ # [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/
41
+ # wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls:
42
+ # the autocomplete
43
+ # attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-co
44
+ # ntrols-the-autocomplete-attribute).
45
+ # @return [Address]
46
+ attr_accessor :billing_address
47
+
48
+ # Additional attributes associated with the use of this card.
49
+ # @return [CardAttributes]
50
+ attr_accessor :attributes
51
+
52
+ # The PayPal-generated ID for the vaulted payment source. This ID should be
53
+ # stored on the merchant's server so the saved payment source can be used
54
+ # for future transactions.
55
+ # @return [String]
56
+ attr_accessor :vault_id
57
+
58
+ # The PayPal-generated, short-lived, one-time-use token, used to communicate
59
+ # payment information to PayPal for transaction processing.
60
+ # @return [String]
61
+ attr_accessor :single_use_token
62
+
63
+ # Provides additional details to process a payment using a `card` that has
64
+ # been stored or is intended to be stored (also referred to as
65
+ # stored_credential or card-on-file).<br/>Parameter
66
+ # compatibility:<br/><ul><li>`payment_type=ONE_TIME` is compatible only with
67
+ # `payment_initiator=CUSTOMER`.</li><li>`usage=FIRST` is compatible only
68
+ # with
69
+ # `payment_initiator=CUSTOMER`.</li><li>`previous_transaction_reference` or
70
+ # `previous_network_transaction_reference` is compatible only with
71
+ # `payment_initiator=MERCHANT`.</li><li>Only one of the parameters -
72
+ # `previous_transaction_reference` and
73
+ # `previous_network_transaction_reference` - can be present in the
74
+ # request.</li></ul>
75
+ # @return [CardStoredCredential]
76
+ attr_accessor :stored_credential
77
+
78
+ # The Third Party Network token used to fund a payment.
79
+ # @return [NetworkToken]
80
+ attr_accessor :network_token
81
+
82
+ # Customizes the payer experience during the 3DS Approval for payment.
83
+ # @return [CardExperienceContext]
84
+ attr_accessor :experience_context
85
+
86
+ # A mapping from model property names to API property names.
87
+ def self.names
88
+ @_hash = {} if @_hash.nil?
89
+ @_hash['name'] = 'name'
90
+ @_hash['number'] = 'number'
91
+ @_hash['expiry'] = 'expiry'
92
+ @_hash['security_code'] = 'security_code'
93
+ @_hash['billing_address'] = 'billing_address'
94
+ @_hash['attributes'] = 'attributes'
95
+ @_hash['vault_id'] = 'vault_id'
96
+ @_hash['single_use_token'] = 'single_use_token'
97
+ @_hash['stored_credential'] = 'stored_credential'
98
+ @_hash['network_token'] = 'network_token'
99
+ @_hash['experience_context'] = 'experience_context'
100
+ @_hash
101
+ end
102
+
103
+ # An array for optional fields
104
+ def self.optionals
105
+ %w[
106
+ name
107
+ number
108
+ expiry
109
+ security_code
110
+ billing_address
111
+ attributes
112
+ vault_id
113
+ single_use_token
114
+ stored_credential
115
+ network_token
116
+ experience_context
117
+ ]
118
+ end
119
+
120
+ # An array for nullable fields
121
+ def self.nullables
122
+ []
123
+ end
124
+
125
+ def initialize(name: SKIP, number: SKIP, expiry: SKIP, security_code: SKIP,
126
+ billing_address: SKIP, attributes: SKIP, vault_id: SKIP,
127
+ single_use_token: SKIP, stored_credential: SKIP,
128
+ network_token: SKIP, experience_context: SKIP)
129
+ @name = name unless name == SKIP
130
+ @number = number unless number == SKIP
131
+ @expiry = expiry unless expiry == SKIP
132
+ @security_code = security_code unless security_code == SKIP
133
+ @billing_address = billing_address unless billing_address == SKIP
134
+ @attributes = attributes unless attributes == SKIP
135
+ @vault_id = vault_id unless vault_id == SKIP
136
+ @single_use_token = single_use_token unless single_use_token == SKIP
137
+ @stored_credential = stored_credential unless stored_credential == SKIP
138
+ @network_token = network_token unless network_token == SKIP
139
+ @experience_context = experience_context unless experience_context == SKIP
140
+ end
141
+
142
+ # Creates an instance of the object from a hash.
143
+ def self.from_hash(hash)
144
+ return nil unless hash
145
+
146
+ # Extract variables from the hash.
147
+ name = hash.key?('name') ? hash['name'] : SKIP
148
+ number = hash.key?('number') ? hash['number'] : SKIP
149
+ expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
150
+ security_code = hash.key?('security_code') ? hash['security_code'] : SKIP
151
+ billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address']
152
+ attributes = CardAttributes.from_hash(hash['attributes']) if hash['attributes']
153
+ vault_id = hash.key?('vault_id') ? hash['vault_id'] : SKIP
154
+ single_use_token =
155
+ hash.key?('single_use_token') ? hash['single_use_token'] : SKIP
156
+ stored_credential = CardStoredCredential.from_hash(hash['stored_credential']) if
157
+ hash['stored_credential']
158
+ network_token = NetworkToken.from_hash(hash['network_token']) if hash['network_token']
159
+ experience_context = CardExperienceContext.from_hash(hash['experience_context']) if
160
+ hash['experience_context']
161
+
162
+ # Create object from extracted values.
163
+ CardRequest.new(name: name,
164
+ number: number,
165
+ expiry: expiry,
166
+ security_code: security_code,
167
+ billing_address: billing_address,
168
+ attributes: attributes,
169
+ vault_id: vault_id,
170
+ single_use_token: single_use_token,
171
+ stored_credential: stored_credential,
172
+ network_token: network_token,
173
+ experience_context: experience_context)
174
+ end
175
+ end
176
+ end
@@ -0,0 +1,139 @@
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 card to use to fund a payment. Card can be a credit or debit
8
+ # card.
9
+ class CardResponse < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # The card holder's name as it appears on the card.
14
+ # @return [String]
15
+ attr_accessor :name
16
+
17
+ # The last digits of the payment card.
18
+ # @return [String]
19
+ attr_accessor :last_digits
20
+
21
+ # The card network or brand. Applies to credit, debit, gift, and payment
22
+ # cards.
23
+ # @return [CardBrand]
24
+ attr_accessor :brand
25
+
26
+ # Array of brands or networks associated with the card.
27
+ # @return [Array[CardBrand]]
28
+ attr_accessor :available_networks
29
+
30
+ # Type of card. i.e Credit, Debit and so on.
31
+ # @return [CardType]
32
+ attr_accessor :type
33
+
34
+ # Results of Authentication such as 3D Secure.
35
+ # @return [AuthenticationResponse]
36
+ attr_accessor :authentication_result
37
+
38
+ # Additional attributes associated with the use of this card.
39
+ # @return [CardAttributesResponse]
40
+ attr_accessor :attributes
41
+
42
+ # Representation of card details as received in the request.
43
+ # @return [CardFromRequest]
44
+ attr_accessor :from_request
45
+
46
+ # The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date
47
+ # and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
48
+ # @return [String]
49
+ attr_accessor :expiry
50
+
51
+ # Bank Identification Number (BIN) details used to fund a payment.
52
+ # @return [BinDetails]
53
+ attr_accessor :bin_details
54
+
55
+ # A mapping from model property names to API property names.
56
+ def self.names
57
+ @_hash = {} if @_hash.nil?
58
+ @_hash['name'] = 'name'
59
+ @_hash['last_digits'] = 'last_digits'
60
+ @_hash['brand'] = 'brand'
61
+ @_hash['available_networks'] = 'available_networks'
62
+ @_hash['type'] = 'type'
63
+ @_hash['authentication_result'] = 'authentication_result'
64
+ @_hash['attributes'] = 'attributes'
65
+ @_hash['from_request'] = 'from_request'
66
+ @_hash['expiry'] = 'expiry'
67
+ @_hash['bin_details'] = 'bin_details'
68
+ @_hash
69
+ end
70
+
71
+ # An array for optional fields
72
+ def self.optionals
73
+ %w[
74
+ name
75
+ last_digits
76
+ brand
77
+ available_networks
78
+ type
79
+ authentication_result
80
+ attributes
81
+ from_request
82
+ expiry
83
+ bin_details
84
+ ]
85
+ end
86
+
87
+ # An array for nullable fields
88
+ def self.nullables
89
+ []
90
+ end
91
+
92
+ def initialize(name: SKIP, last_digits: SKIP, brand: SKIP,
93
+ available_networks: SKIP, type: SKIP,
94
+ authentication_result: SKIP, attributes: SKIP,
95
+ from_request: SKIP, expiry: SKIP, bin_details: SKIP)
96
+ @name = name unless name == SKIP
97
+ @last_digits = last_digits unless last_digits == SKIP
98
+ @brand = brand unless brand == SKIP
99
+ @available_networks = available_networks unless available_networks == SKIP
100
+ @type = type unless type == SKIP
101
+ @authentication_result = authentication_result unless authentication_result == SKIP
102
+ @attributes = attributes unless attributes == SKIP
103
+ @from_request = from_request unless from_request == SKIP
104
+ @expiry = expiry unless expiry == SKIP
105
+ @bin_details = bin_details unless bin_details == SKIP
106
+ end
107
+
108
+ # Creates an instance of the object from a hash.
109
+ def self.from_hash(hash)
110
+ return nil unless hash
111
+
112
+ # Extract variables from the hash.
113
+ name = hash.key?('name') ? hash['name'] : SKIP
114
+ last_digits = hash.key?('last_digits') ? hash['last_digits'] : SKIP
115
+ brand = hash.key?('brand') ? hash['brand'] : SKIP
116
+ available_networks =
117
+ hash.key?('available_networks') ? hash['available_networks'] : SKIP
118
+ type = hash.key?('type') ? hash['type'] : SKIP
119
+ authentication_result = AuthenticationResponse.from_hash(hash['authentication_result']) if
120
+ hash['authentication_result']
121
+ attributes = CardAttributesResponse.from_hash(hash['attributes']) if hash['attributes']
122
+ from_request = CardFromRequest.from_hash(hash['from_request']) if hash['from_request']
123
+ expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
124
+ bin_details = BinDetails.from_hash(hash['bin_details']) if hash['bin_details']
125
+
126
+ # Create object from extracted values.
127
+ CardResponse.new(name: name,
128
+ last_digits: last_digits,
129
+ brand: brand,
130
+ available_networks: available_networks,
131
+ type: type,
132
+ authentication_result: authentication_result,
133
+ attributes: attributes,
134
+ from_request: from_request,
135
+ expiry: expiry,
136
+ bin_details: bin_details)
137
+ end
138
+ end
139
+ end
@@ -0,0 +1,156 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # Full representation of a Card Payment Token.
8
+ class CardResponseEntity < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The card holder's name as it appears on the card.
13
+ # @return [String]
14
+ attr_accessor :name
15
+
16
+ # The last digits of the payment card.
17
+ # @return [String]
18
+ attr_accessor :last_digits
19
+
20
+ # The card network or brand. Applies to credit, debit, gift, and payment
21
+ # cards.
22
+ # @return [CardBrand]
23
+ attr_accessor :brand
24
+
25
+ # The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date
26
+ # and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
27
+ # @return [String]
28
+ attr_accessor :expiry
29
+
30
+ # Address request details.
31
+ # @return [AddressDetails]
32
+ attr_accessor :billing_address
33
+
34
+ # Verification status of Card.
35
+ # @return [String]
36
+ attr_accessor :verification_status
37
+
38
+ # Card Verification details including the authorization details and 3D
39
+ # SECURE details.
40
+ # @return [CardVerificationDetails]
41
+ attr_accessor :verification
42
+
43
+ # Previous network transaction reference including id in response.
44
+ # @return [NetworkTransactionReferenceEntity]
45
+ attr_accessor :network_transaction_reference
46
+
47
+ # Results of Authentication such as 3D Secure.
48
+ # @return [CardAuthenticationResponse]
49
+ attr_accessor :authentication_result
50
+
51
+ # Bank Identification Number (BIN) details used to fund a payment.
52
+ # @return [BinDetails]
53
+ attr_accessor :bin_details
54
+
55
+ # Type of card. i.e Credit, Debit and so on.
56
+ # @return [CardType]
57
+ attr_accessor :type
58
+
59
+ # A mapping from model property names to API property names.
60
+ def self.names
61
+ @_hash = {} if @_hash.nil?
62
+ @_hash['name'] = 'name'
63
+ @_hash['last_digits'] = 'last_digits'
64
+ @_hash['brand'] = 'brand'
65
+ @_hash['expiry'] = 'expiry'
66
+ @_hash['billing_address'] = 'billing_address'
67
+ @_hash['verification_status'] = 'verification_status'
68
+ @_hash['verification'] = 'verification'
69
+ @_hash['network_transaction_reference'] =
70
+ 'network_transaction_reference'
71
+ @_hash['authentication_result'] = 'authentication_result'
72
+ @_hash['bin_details'] = 'bin_details'
73
+ @_hash['type'] = 'type'
74
+ @_hash
75
+ end
76
+
77
+ # An array for optional fields
78
+ def self.optionals
79
+ %w[
80
+ name
81
+ last_digits
82
+ brand
83
+ expiry
84
+ billing_address
85
+ verification_status
86
+ verification
87
+ network_transaction_reference
88
+ authentication_result
89
+ bin_details
90
+ type
91
+ ]
92
+ end
93
+
94
+ # An array for nullable fields
95
+ def self.nullables
96
+ []
97
+ end
98
+
99
+ def initialize(name: SKIP, last_digits: SKIP, brand: SKIP, expiry: SKIP,
100
+ billing_address: SKIP, verification_status: SKIP,
101
+ verification: SKIP, network_transaction_reference: SKIP,
102
+ authentication_result: SKIP, bin_details: SKIP, type: SKIP)
103
+ @name = name unless name == SKIP
104
+ @last_digits = last_digits unless last_digits == SKIP
105
+ @brand = brand unless brand == SKIP
106
+ @expiry = expiry unless expiry == SKIP
107
+ @billing_address = billing_address unless billing_address == SKIP
108
+ @verification_status = verification_status unless verification_status == SKIP
109
+ @verification = verification unless verification == SKIP
110
+ unless network_transaction_reference == SKIP
111
+ @network_transaction_reference =
112
+ network_transaction_reference
113
+ end
114
+ @authentication_result = authentication_result unless authentication_result == SKIP
115
+ @bin_details = bin_details unless bin_details == SKIP
116
+ @type = type unless type == SKIP
117
+ end
118
+
119
+ # Creates an instance of the object from a hash.
120
+ def self.from_hash(hash)
121
+ return nil unless hash
122
+
123
+ # Extract variables from the hash.
124
+ name = hash.key?('name') ? hash['name'] : SKIP
125
+ last_digits = hash.key?('last_digits') ? hash['last_digits'] : SKIP
126
+ brand = hash.key?('brand') ? hash['brand'] : SKIP
127
+ expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
128
+ billing_address = AddressDetails.from_hash(hash['billing_address']) if
129
+ hash['billing_address']
130
+ verification_status =
131
+ hash.key?('verification_status') ? hash['verification_status'] : SKIP
132
+ verification = CardVerificationDetails.from_hash(hash['verification']) if
133
+ hash['verification']
134
+ if hash['network_transaction_reference']
135
+ network_transaction_reference = NetworkTransactionReferenceEntity.from_hash(hash['network_transaction_reference'])
136
+ end
137
+ authentication_result = CardAuthenticationResponse.from_hash(hash['authentication_result']) if
138
+ hash['authentication_result']
139
+ bin_details = BinDetails.from_hash(hash['bin_details']) if hash['bin_details']
140
+ type = hash.key?('type') ? hash['type'] : SKIP
141
+
142
+ # Create object from extracted values.
143
+ CardResponseEntity.new(name: name,
144
+ last_digits: last_digits,
145
+ brand: brand,
146
+ expiry: expiry,
147
+ billing_address: billing_address,
148
+ verification_status: verification_status,
149
+ verification: verification,
150
+ network_transaction_reference: network_transaction_reference,
151
+ authentication_result: authentication_result,
152
+ bin_details: bin_details,
153
+ type: type)
154
+ end
155
+ end
156
+ end