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,167 @@
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 Card from Apple Pay Wallet used to fund the payment.
8
+ class ApplePayCardResponse < 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
+ # Array of brands or networks associated with the card.
26
+ # @return [Array[CardBrand]]
27
+ attr_accessor :available_networks
28
+
29
+ # Type of card. i.e Credit, Debit and so on.
30
+ # @return [CardType]
31
+ attr_accessor :type
32
+
33
+ # Results of Authentication such as 3D Secure.
34
+ # @return [AuthenticationResponse]
35
+ attr_accessor :authentication_result
36
+
37
+ # Additional attributes associated with the use of this card.
38
+ # @return [CardAttributesResponse]
39
+ attr_accessor :attributes
40
+
41
+ # Representation of card details as received in the request.
42
+ # @return [CardFromRequest]
43
+ attr_accessor :from_request
44
+
45
+ # The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date
46
+ # and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
47
+ # @return [String]
48
+ attr_accessor :expiry
49
+
50
+ # Bank Identification Number (BIN) details used to fund a payment.
51
+ # @return [BinDetails]
52
+ attr_accessor :bin_details
53
+
54
+ # The portable international postal address. Maps to
55
+ # [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/
56
+ # wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls:
57
+ # the autocomplete
58
+ # attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-co
59
+ # ntrols-the-autocomplete-attribute).
60
+ # @return [Address]
61
+ attr_accessor :billing_address
62
+
63
+ # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
64
+ # that identifies the country or region.<blockquote><strong>Note:</strong>
65
+ # The country code for Great Britain is <code>GB</code> and not
66
+ # <code>UK</code> as used in the top-level domain names for that country.
67
+ # Use the `C2` country code for China worldwide for comparable uncontrolled
68
+ # price (CUP) method, bank card, and cross-border transactions.</blockquote>
69
+ # @return [String]
70
+ attr_accessor :country_code
71
+
72
+ # A mapping from model property names to API property names.
73
+ def self.names
74
+ @_hash = {} if @_hash.nil?
75
+ @_hash['name'] = 'name'
76
+ @_hash['last_digits'] = 'last_digits'
77
+ @_hash['brand'] = 'brand'
78
+ @_hash['available_networks'] = 'available_networks'
79
+ @_hash['type'] = 'type'
80
+ @_hash['authentication_result'] = 'authentication_result'
81
+ @_hash['attributes'] = 'attributes'
82
+ @_hash['from_request'] = 'from_request'
83
+ @_hash['expiry'] = 'expiry'
84
+ @_hash['bin_details'] = 'bin_details'
85
+ @_hash['billing_address'] = 'billing_address'
86
+ @_hash['country_code'] = 'country_code'
87
+ @_hash
88
+ end
89
+
90
+ # An array for optional fields
91
+ def self.optionals
92
+ %w[
93
+ name
94
+ last_digits
95
+ brand
96
+ available_networks
97
+ type
98
+ authentication_result
99
+ attributes
100
+ from_request
101
+ expiry
102
+ bin_details
103
+ billing_address
104
+ country_code
105
+ ]
106
+ end
107
+
108
+ # An array for nullable fields
109
+ def self.nullables
110
+ []
111
+ end
112
+
113
+ def initialize(name: SKIP, last_digits: SKIP, brand: SKIP,
114
+ available_networks: SKIP, type: SKIP,
115
+ authentication_result: SKIP, attributes: SKIP,
116
+ from_request: SKIP, expiry: SKIP, bin_details: SKIP,
117
+ billing_address: SKIP, country_code: SKIP)
118
+ @name = name unless name == SKIP
119
+ @last_digits = last_digits unless last_digits == SKIP
120
+ @brand = brand unless brand == SKIP
121
+ @available_networks = available_networks unless available_networks == SKIP
122
+ @type = type unless type == SKIP
123
+ @authentication_result = authentication_result unless authentication_result == SKIP
124
+ @attributes = attributes unless attributes == SKIP
125
+ @from_request = from_request unless from_request == SKIP
126
+ @expiry = expiry unless expiry == SKIP
127
+ @bin_details = bin_details unless bin_details == SKIP
128
+ @billing_address = billing_address unless billing_address == SKIP
129
+ @country_code = country_code unless country_code == SKIP
130
+ end
131
+
132
+ # Creates an instance of the object from a hash.
133
+ def self.from_hash(hash)
134
+ return nil unless hash
135
+
136
+ # Extract variables from the hash.
137
+ name = hash.key?('name') ? hash['name'] : SKIP
138
+ last_digits = hash.key?('last_digits') ? hash['last_digits'] : SKIP
139
+ brand = hash.key?('brand') ? hash['brand'] : SKIP
140
+ available_networks =
141
+ hash.key?('available_networks') ? hash['available_networks'] : SKIP
142
+ type = hash.key?('type') ? hash['type'] : SKIP
143
+ authentication_result = AuthenticationResponse.from_hash(hash['authentication_result']) if
144
+ hash['authentication_result']
145
+ attributes = CardAttributesResponse.from_hash(hash['attributes']) if hash['attributes']
146
+ from_request = CardFromRequest.from_hash(hash['from_request']) if hash['from_request']
147
+ expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
148
+ bin_details = BinDetails.from_hash(hash['bin_details']) if hash['bin_details']
149
+ billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address']
150
+ country_code = hash.key?('country_code') ? hash['country_code'] : SKIP
151
+
152
+ # Create object from extracted values.
153
+ ApplePayCardResponse.new(name: name,
154
+ last_digits: last_digits,
155
+ brand: brand,
156
+ available_networks: available_networks,
157
+ type: type,
158
+ authentication_result: authentication_result,
159
+ attributes: attributes,
160
+ from_request: from_request,
161
+ expiry: expiry,
162
+ bin_details: bin_details,
163
+ billing_address: billing_address,
164
+ country_code: country_code)
165
+ end
166
+ end
167
+ 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 about the Payment data obtained by decrypting Apple Pay token.
8
+ class ApplePayDecryptedTokenData < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The currency and amount for a financial transaction, such as a balance or
13
+ # payment due.
14
+ # @return [Money]
15
+ attr_accessor :transaction_amount
16
+
17
+ # The payment card to use to fund a payment. Can be a credit or debit card.
18
+ # @return [ApplePayTokenizedCard]
19
+ attr_accessor :tokenized_card
20
+
21
+ # Apple Pay Hex-encoded device manufacturer identifier. The pattern is
22
+ # defined by an external party and supports Unicode.
23
+ # @return [String]
24
+ attr_accessor :device_manufacturer_id
25
+
26
+ # Indicates the type of payment data passed, in case of Non China the
27
+ # payment data is 3DSECURE and for China it is EMV.
28
+ # @return [ApplePayPaymentDataType]
29
+ attr_accessor :payment_data_type
30
+
31
+ # Information about the decrypted apple pay payment data for the token like
32
+ # cryptogram, eci indicator.
33
+ # @return [ApplePayPaymentData]
34
+ attr_accessor :payment_data
35
+
36
+ # A mapping from model property names to API property names.
37
+ def self.names
38
+ @_hash = {} if @_hash.nil?
39
+ @_hash['transaction_amount'] = 'transaction_amount'
40
+ @_hash['tokenized_card'] = 'tokenized_card'
41
+ @_hash['device_manufacturer_id'] = 'device_manufacturer_id'
42
+ @_hash['payment_data_type'] = 'payment_data_type'
43
+ @_hash['payment_data'] = 'payment_data'
44
+ @_hash
45
+ end
46
+
47
+ # An array for optional fields
48
+ def self.optionals
49
+ %w[
50
+ transaction_amount
51
+ device_manufacturer_id
52
+ payment_data_type
53
+ payment_data
54
+ ]
55
+ end
56
+
57
+ # An array for nullable fields
58
+ def self.nullables
59
+ []
60
+ end
61
+
62
+ def initialize(tokenized_card:, transaction_amount: SKIP,
63
+ device_manufacturer_id: SKIP, payment_data_type: SKIP,
64
+ payment_data: SKIP)
65
+ @transaction_amount = transaction_amount unless transaction_amount == SKIP
66
+ @tokenized_card = tokenized_card
67
+ @device_manufacturer_id = device_manufacturer_id unless device_manufacturer_id == SKIP
68
+ @payment_data_type = payment_data_type unless payment_data_type == SKIP
69
+ @payment_data = payment_data unless payment_data == SKIP
70
+ end
71
+
72
+ # Creates an instance of the object from a hash.
73
+ def self.from_hash(hash)
74
+ return nil unless hash
75
+
76
+ # Extract variables from the hash.
77
+ tokenized_card = ApplePayTokenizedCard.from_hash(hash['tokenized_card']) if
78
+ hash['tokenized_card']
79
+ transaction_amount = Money.from_hash(hash['transaction_amount']) if
80
+ hash['transaction_amount']
81
+ device_manufacturer_id =
82
+ hash.key?('device_manufacturer_id') ? hash['device_manufacturer_id'] : SKIP
83
+ payment_data_type =
84
+ hash.key?('payment_data_type') ? hash['payment_data_type'] : SKIP
85
+ payment_data = ApplePayPaymentData.from_hash(hash['payment_data']) if hash['payment_data']
86
+
87
+ # Create object from extracted values.
88
+ ApplePayDecryptedTokenData.new(tokenized_card: tokenized_card,
89
+ transaction_amount: transaction_amount,
90
+ device_manufacturer_id: device_manufacturer_id,
91
+ payment_data_type: payment_data_type,
92
+ payment_data: payment_data)
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,83 @@
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 about the decrypted apple pay payment data for the token like
8
+ # cryptogram, eci indicator.
9
+ class ApplePayPaymentData < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Online payment cryptogram, as defined by 3D Secure. The pattern is defined
14
+ # by an external party and supports Unicode.
15
+ # @return [String]
16
+ attr_accessor :cryptogram
17
+
18
+ # ECI indicator, as defined by 3- Secure. The pattern is defined by an
19
+ # external party and supports Unicode.
20
+ # @return [String]
21
+ attr_accessor :eci_indicator
22
+
23
+ # Encoded Apple Pay EMV Payment Structure used for payments in China. The
24
+ # pattern is defined by an external party and supports Unicode.
25
+ # @return [String]
26
+ attr_accessor :emv_data
27
+
28
+ # Bank Key encrypted Apple Pay PIN. The pattern is defined by an external
29
+ # party and supports Unicode.
30
+ # @return [String]
31
+ attr_accessor :pin
32
+
33
+ # A mapping from model property names to API property names.
34
+ def self.names
35
+ @_hash = {} if @_hash.nil?
36
+ @_hash['cryptogram'] = 'cryptogram'
37
+ @_hash['eci_indicator'] = 'eci_indicator'
38
+ @_hash['emv_data'] = 'emv_data'
39
+ @_hash['pin'] = 'pin'
40
+ @_hash
41
+ end
42
+
43
+ # An array for optional fields
44
+ def self.optionals
45
+ %w[
46
+ cryptogram
47
+ eci_indicator
48
+ emv_data
49
+ pin
50
+ ]
51
+ end
52
+
53
+ # An array for nullable fields
54
+ def self.nullables
55
+ []
56
+ end
57
+
58
+ def initialize(cryptogram: SKIP, eci_indicator: SKIP, emv_data: SKIP,
59
+ pin: SKIP)
60
+ @cryptogram = cryptogram unless cryptogram == SKIP
61
+ @eci_indicator = eci_indicator unless eci_indicator == SKIP
62
+ @emv_data = emv_data unless emv_data == SKIP
63
+ @pin = pin unless pin == SKIP
64
+ end
65
+
66
+ # Creates an instance of the object from a hash.
67
+ def self.from_hash(hash)
68
+ return nil unless hash
69
+
70
+ # Extract variables from the hash.
71
+ cryptogram = hash.key?('cryptogram') ? hash['cryptogram'] : SKIP
72
+ eci_indicator = hash.key?('eci_indicator') ? hash['eci_indicator'] : SKIP
73
+ emv_data = hash.key?('emv_data') ? hash['emv_data'] : SKIP
74
+ pin = hash.key?('pin') ? hash['pin'] : SKIP
75
+
76
+ # Create object from extracted values.
77
+ ApplePayPaymentData.new(cryptogram: cryptogram,
78
+ eci_indicator: eci_indicator,
79
+ emv_data: emv_data,
80
+ pin: pin)
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,24 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # Indicates the type of payment data passed, in case of Non China the payment
8
+ # data is 3DSECURE and for China it is EMV.
9
+ class ApplePayPaymentDataType
10
+ APPLE_PAY_PAYMENT_DATA_TYPE = [
11
+ # TODO: Write general description for ENUM_3DSECURE
12
+ ENUM_3DSECURE = '3DSECURE'.freeze,
13
+
14
+ # TODO: Write general description for EMV
15
+ EMV = 'EMV'.freeze
16
+ ].freeze
17
+
18
+ def self.validate(value)
19
+ return false if value.nil?
20
+
21
+ true
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,114 @@
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 ApplePay.
8
+ class ApplePayPaymentObject < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # ApplePay transaction identifier, this will be the unique identifier for
13
+ # this transaction provided by Apple. The pattern is defined by an external
14
+ # party and supports Unicode.
15
+ # @return [String]
16
+ attr_accessor :id
17
+
18
+ # Encrypted ApplePay token, containing card information. This token would be
19
+ # base64encoded. The pattern is defined by an external party and supports
20
+ # Unicode.
21
+ # @return [String]
22
+ attr_accessor :token
23
+
24
+ # The full name representation like Mr J Smith.
25
+ # @return [String]
26
+ attr_accessor :name
27
+
28
+ # The internationalized email address.<blockquote><strong>Note:</strong> Up
29
+ # to 64 characters are allowed before and 255 characters are allowed after
30
+ # the <code>@</code> sign. However, the generally accepted maximum length
31
+ # for an email address is 254 characters. The pattern verifies that an
32
+ # unquoted <code>@</code> sign exists.</blockquote>
33
+ # @return [String]
34
+ attr_accessor :email_address
35
+
36
+ # The phone number in its canonical international [E.164 numbering plan
37
+ # format](https://www.itu.int/rec/T-REC-E.164/en).
38
+ # @return [PhoneNumber]
39
+ attr_accessor :phone_number
40
+
41
+ # The Card from Apple Pay Wallet used to fund the payment.
42
+ # @return [ApplePayCardResponse]
43
+ attr_accessor :card
44
+
45
+ # Additional attributes associated with the use of Apple Pay.
46
+ # @return [ApplePayAttributesResponse]
47
+ attr_accessor :attributes
48
+
49
+ # A mapping from model property names to API property names.
50
+ def self.names
51
+ @_hash = {} if @_hash.nil?
52
+ @_hash['id'] = 'id'
53
+ @_hash['token'] = 'token'
54
+ @_hash['name'] = 'name'
55
+ @_hash['email_address'] = 'email_address'
56
+ @_hash['phone_number'] = 'phone_number'
57
+ @_hash['card'] = 'card'
58
+ @_hash['attributes'] = 'attributes'
59
+ @_hash
60
+ end
61
+
62
+ # An array for optional fields
63
+ def self.optionals
64
+ %w[
65
+ id
66
+ token
67
+ name
68
+ email_address
69
+ phone_number
70
+ card
71
+ attributes
72
+ ]
73
+ end
74
+
75
+ # An array for nullable fields
76
+ def self.nullables
77
+ []
78
+ end
79
+
80
+ def initialize(id: SKIP, token: SKIP, name: SKIP, email_address: SKIP,
81
+ phone_number: SKIP, card: SKIP, attributes: SKIP)
82
+ @id = id unless id == SKIP
83
+ @token = token unless token == SKIP
84
+ @name = name unless name == SKIP
85
+ @email_address = email_address unless email_address == SKIP
86
+ @phone_number = phone_number unless phone_number == SKIP
87
+ @card = card unless card == SKIP
88
+ @attributes = attributes unless attributes == SKIP
89
+ end
90
+
91
+ # Creates an instance of the object from a hash.
92
+ def self.from_hash(hash)
93
+ return nil unless hash
94
+
95
+ # Extract variables from the hash.
96
+ id = hash.key?('id') ? hash['id'] : SKIP
97
+ token = hash.key?('token') ? hash['token'] : SKIP
98
+ name = hash.key?('name') ? hash['name'] : SKIP
99
+ email_address = hash.key?('email_address') ? hash['email_address'] : SKIP
100
+ phone_number = PhoneNumber.from_hash(hash['phone_number']) if hash['phone_number']
101
+ card = ApplePayCardResponse.from_hash(hash['card']) if hash['card']
102
+ attributes = ApplePayAttributesResponse.from_hash(hash['attributes']) if hash['attributes']
103
+
104
+ # Create object from extracted values.
105
+ ApplePayPaymentObject.new(id: id,
106
+ token: token,
107
+ name: name,
108
+ email_address: email_address,
109
+ phone_number: phone_number,
110
+ card: card,
111
+ attributes: attributes)
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,51 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # A resource representing a response for Apple Pay.
8
+ class ApplePayPaymentToken < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The payment card to be used to fund a payment. Can be a credit or debit
13
+ # card.
14
+ # @return [ApplePayCard]
15
+ attr_accessor :card
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['card'] = 'card'
21
+ @_hash
22
+ end
23
+
24
+ # An array for optional fields
25
+ def self.optionals
26
+ %w[
27
+ card
28
+ ]
29
+ end
30
+
31
+ # An array for nullable fields
32
+ def self.nullables
33
+ []
34
+ end
35
+
36
+ def initialize(card: SKIP)
37
+ @card = card unless card == SKIP
38
+ end
39
+
40
+ # Creates an instance of the object from a hash.
41
+ def self.from_hash(hash)
42
+ return nil unless hash
43
+
44
+ # Extract variables from the hash.
45
+ card = ApplePayCard.from_hash(hash['card']) if hash['card']
46
+
47
+ # Create object from extracted values.
48
+ ApplePayPaymentToken.new(card: card)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,137 @@
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 ApplePay.
8
+ class ApplePayRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # ApplePay transaction identifier, this will be the unique identifier for
13
+ # this transaction provided by Apple. The pattern is defined by an external
14
+ # party and supports Unicode.
15
+ # @return [String]
16
+ attr_accessor :id
17
+
18
+ # The full name representation like Mr J Smith.
19
+ # @return [String]
20
+ attr_accessor :name
21
+
22
+ # The internationalized email address.<blockquote><strong>Note:</strong> Up
23
+ # to 64 characters are allowed before and 255 characters are allowed after
24
+ # the <code>@</code> sign. However, the generally accepted maximum length
25
+ # for an email address is 254 characters. The pattern verifies that an
26
+ # unquoted <code>@</code> sign exists.</blockquote>
27
+ # @return [String]
28
+ attr_accessor :email_address
29
+
30
+ # The phone number in its canonical international [E.164 numbering plan
31
+ # format](https://www.itu.int/rec/T-REC-E.164/en).
32
+ # @return [PhoneNumber]
33
+ attr_accessor :phone_number
34
+
35
+ # Information about the Payment data obtained by decrypting Apple Pay token.
36
+ # @return [ApplePayDecryptedTokenData]
37
+ attr_accessor :decrypted_token
38
+
39
+ # Provides additional details to process a payment using a `card` that has
40
+ # been stored or is intended to be stored (also referred to as
41
+ # stored_credential or card-on-file).<br/>Parameter
42
+ # compatibility:<br/><ul><li>`payment_type=ONE_TIME` is compatible only with
43
+ # `payment_initiator=CUSTOMER`.</li><li>`usage=FIRST` is compatible only
44
+ # with
45
+ # `payment_initiator=CUSTOMER`.</li><li>`previous_transaction_reference` or
46
+ # `previous_network_transaction_reference` is compatible only with
47
+ # `payment_initiator=MERCHANT`.</li><li>Only one of the parameters -
48
+ # `previous_transaction_reference` and
49
+ # `previous_network_transaction_reference` - can be present in the
50
+ # request.</li></ul>
51
+ # @return [CardStoredCredential]
52
+ attr_accessor :stored_credential
53
+
54
+ # The PayPal-generated ID for the vaulted payment source. This ID should be
55
+ # stored on the merchant's server so the saved payment source can be used
56
+ # for future transactions.
57
+ # @return [String]
58
+ attr_accessor :vault_id
59
+
60
+ # Additional attributes associated with apple pay.
61
+ # @return [ApplePayAttributes]
62
+ attr_accessor :attributes
63
+
64
+ # A mapping from model property names to API property names.
65
+ def self.names
66
+ @_hash = {} if @_hash.nil?
67
+ @_hash['id'] = 'id'
68
+ @_hash['name'] = 'name'
69
+ @_hash['email_address'] = 'email_address'
70
+ @_hash['phone_number'] = 'phone_number'
71
+ @_hash['decrypted_token'] = 'decrypted_token'
72
+ @_hash['stored_credential'] = 'stored_credential'
73
+ @_hash['vault_id'] = 'vault_id'
74
+ @_hash['attributes'] = 'attributes'
75
+ @_hash
76
+ end
77
+
78
+ # An array for optional fields
79
+ def self.optionals
80
+ %w[
81
+ id
82
+ name
83
+ email_address
84
+ phone_number
85
+ decrypted_token
86
+ stored_credential
87
+ vault_id
88
+ attributes
89
+ ]
90
+ end
91
+
92
+ # An array for nullable fields
93
+ def self.nullables
94
+ []
95
+ end
96
+
97
+ def initialize(id: SKIP, name: SKIP, email_address: SKIP,
98
+ phone_number: SKIP, decrypted_token: SKIP,
99
+ stored_credential: SKIP, vault_id: SKIP, attributes: SKIP)
100
+ @id = id unless id == SKIP
101
+ @name = name unless name == SKIP
102
+ @email_address = email_address unless email_address == SKIP
103
+ @phone_number = phone_number unless phone_number == SKIP
104
+ @decrypted_token = decrypted_token unless decrypted_token == SKIP
105
+ @stored_credential = stored_credential unless stored_credential == SKIP
106
+ @vault_id = vault_id unless vault_id == SKIP
107
+ @attributes = attributes unless attributes == SKIP
108
+ end
109
+
110
+ # Creates an instance of the object from a hash.
111
+ def self.from_hash(hash)
112
+ return nil unless hash
113
+
114
+ # Extract variables from the hash.
115
+ id = hash.key?('id') ? hash['id'] : SKIP
116
+ name = hash.key?('name') ? hash['name'] : SKIP
117
+ email_address = hash.key?('email_address') ? hash['email_address'] : SKIP
118
+ phone_number = PhoneNumber.from_hash(hash['phone_number']) if hash['phone_number']
119
+ decrypted_token = ApplePayDecryptedTokenData.from_hash(hash['decrypted_token']) if
120
+ hash['decrypted_token']
121
+ stored_credential = CardStoredCredential.from_hash(hash['stored_credential']) if
122
+ hash['stored_credential']
123
+ vault_id = hash.key?('vault_id') ? hash['vault_id'] : SKIP
124
+ attributes = ApplePayAttributes.from_hash(hash['attributes']) if hash['attributes']
125
+
126
+ # Create object from extracted values.
127
+ ApplePayRequest.new(id: id,
128
+ name: name,
129
+ email_address: email_address,
130
+ phone_number: phone_number,
131
+ decrypted_token: decrypted_token,
132
+ stored_credential: stored_credential,
133
+ vault_id: vault_id,
134
+ attributes: attributes)
135
+ end
136
+ end
137
+ end