paypal-server-sdk 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +34 -34
  3. data/README.md +19 -30
  4. data/lib/paypal_server_sdk/controllers/base_controller.rb +1 -1
  5. data/lib/paypal_server_sdk/controllers/orders_controller.rb +228 -234
  6. data/lib/paypal_server_sdk/controllers/payments_controller.rb +139 -91
  7. data/lib/paypal_server_sdk/controllers/vault_controller.rb +57 -57
  8. data/lib/paypal_server_sdk/exceptions/api_exception.rb +11 -0
  9. data/lib/paypal_server_sdk/exceptions/error_exception.rb +14 -0
  10. data/lib/paypal_server_sdk/exceptions/o_auth_provider_exception.rb +14 -0
  11. data/lib/paypal_server_sdk/models/activity_timestamps.rb +17 -6
  12. data/lib/paypal_server_sdk/models/address.rb +24 -9
  13. data/lib/paypal_server_sdk/models/amount_breakdown.rb +17 -0
  14. data/lib/paypal_server_sdk/models/amount_with_breakdown.rb +22 -9
  15. data/lib/paypal_server_sdk/models/apple_pay_attributes.rb +12 -0
  16. data/lib/paypal_server_sdk/models/apple_pay_attributes_response.rb +12 -0
  17. data/lib/paypal_server_sdk/models/apple_pay_card.rb +14 -0
  18. data/lib/paypal_server_sdk/models/apple_pay_card_response.rb +48 -6
  19. data/lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb +16 -0
  20. data/lib/paypal_server_sdk/models/apple_pay_payment_data.rb +14 -0
  21. data/lib/paypal_server_sdk/models/apple_pay_payment_data_type.rb +6 -2
  22. data/lib/paypal_server_sdk/models/apple_pay_payment_object.rb +43 -7
  23. data/lib/paypal_server_sdk/models/apple_pay_payment_token.rb +12 -0
  24. data/lib/paypal_server_sdk/models/apple_pay_request.rb +27 -13
  25. data/lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb +15 -0
  26. data/lib/paypal_server_sdk/models/assurance_details.rb +14 -0
  27. data/lib/paypal_server_sdk/models/authentication_response.rb +13 -0
  28. data/lib/paypal_server_sdk/models/authorization.rb +28 -9
  29. data/lib/paypal_server_sdk/models/authorization_incomplete_reason.rb +2 -2
  30. data/lib/paypal_server_sdk/models/authorization_status.rb +12 -6
  31. data/lib/paypal_server_sdk/models/authorization_status_details.rb +12 -0
  32. data/lib/paypal_server_sdk/models/authorization_status_with_details.rb +12 -0
  33. data/lib/paypal_server_sdk/models/authorization_with_additional_data.rb +29 -9
  34. data/lib/paypal_server_sdk/models/avs_code.rb +102 -71
  35. data/lib/paypal_server_sdk/models/bancontact_payment_object.rb +19 -5
  36. data/lib/paypal_server_sdk/models/bancontact_payment_request.rb +18 -5
  37. data/lib/paypal_server_sdk/models/base_model.rb +76 -28
  38. data/lib/paypal_server_sdk/models/billing_cycle.rb +129 -0
  39. data/lib/paypal_server_sdk/models/bin_details.rb +18 -5
  40. data/lib/paypal_server_sdk/models/blik_experience_context.rb +17 -0
  41. data/lib/paypal_server_sdk/models/blik_level0_payment_object.rb +12 -0
  42. data/lib/paypal_server_sdk/models/blik_one_click_payment_object.rb +12 -0
  43. data/lib/paypal_server_sdk/models/blik_one_click_payment_request.rb +15 -0
  44. data/lib/paypal_server_sdk/models/blik_payment_object.rb +22 -10
  45. data/lib/paypal_server_sdk/models/blik_payment_request.rb +24 -10
  46. data/lib/paypal_server_sdk/models/callback_configuration.rb +75 -0
  47. data/lib/paypal_server_sdk/models/callback_events.rb +27 -0
  48. data/lib/paypal_server_sdk/models/capture_incomplete_reason.rb +22 -14
  49. data/lib/paypal_server_sdk/models/capture_payment_instruction.rb +15 -0
  50. data/lib/paypal_server_sdk/models/capture_request.rb +17 -0
  51. data/lib/paypal_server_sdk/models/capture_status.rb +10 -6
  52. data/lib/paypal_server_sdk/models/capture_status_details.rb +12 -0
  53. data/lib/paypal_server_sdk/models/capture_status_with_details.rb +12 -0
  54. data/lib/paypal_server_sdk/models/captured_payment.rb +36 -10
  55. data/lib/paypal_server_sdk/models/card_attributes.rb +13 -0
  56. data/lib/paypal_server_sdk/models/card_attributes_response.rb +12 -0
  57. data/lib/paypal_server_sdk/models/card_authentication_response.rb +14 -2
  58. data/lib/paypal_server_sdk/models/card_brand.rb +29 -25
  59. data/lib/paypal_server_sdk/models/card_customer_information.rb +18 -5
  60. data/lib/paypal_server_sdk/models/card_experience_context.rb +12 -0
  61. data/lib/paypal_server_sdk/models/card_from_request.rb +12 -0
  62. data/lib/paypal_server_sdk/models/{card_response_entity.rb → card_payment_token_entity.rb} +37 -15
  63. data/lib/paypal_server_sdk/models/card_request.rb +32 -17
  64. data/lib/paypal_server_sdk/models/card_response.rb +43 -2
  65. data/lib/paypal_server_sdk/models/{address_details.rb → card_response_address.rb} +33 -57
  66. data/lib/paypal_server_sdk/models/card_stored_credential.rb +23 -7
  67. data/lib/paypal_server_sdk/models/card_supplementary_data.rb +13 -5
  68. data/lib/paypal_server_sdk/models/card_type.rb +5 -5
  69. data/lib/paypal_server_sdk/models/card_vault_response.rb +13 -0
  70. data/lib/paypal_server_sdk/models/card_verification.rb +16 -3
  71. data/lib/paypal_server_sdk/models/card_verification_details.rb +40 -11
  72. data/lib/paypal_server_sdk/models/card_verification_processor_response.rb +12 -0
  73. data/lib/paypal_server_sdk/models/card_verification_status.rb +23 -0
  74. data/lib/paypal_server_sdk/models/checkout_payment_intent.rb +10 -2
  75. data/lib/paypal_server_sdk/models/cobranded_card.rb +13 -0
  76. data/lib/paypal_server_sdk/models/confirm_order_request.rb +15 -15
  77. data/lib/paypal_server_sdk/models/{customer_request.rb → customer.rb} +18 -4
  78. data/lib/paypal_server_sdk/models/customer_information.rb +17 -5
  79. data/lib/paypal_server_sdk/models/customer_response.rb +76 -0
  80. data/lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb +21 -4
  81. data/lib/paypal_server_sdk/models/cvv_code.rb +35 -27
  82. data/lib/paypal_server_sdk/models/disbursement_mode.rb +5 -2
  83. data/lib/paypal_server_sdk/models/dispute_category.rb +2 -2
  84. data/lib/paypal_server_sdk/models/eci_flag.rb +6 -8
  85. data/lib/paypal_server_sdk/models/enrollment_status.rb +11 -8
  86. data/lib/paypal_server_sdk/models/eps_payment_object.rb +17 -5
  87. data/lib/paypal_server_sdk/models/eps_payment_request.rb +18 -5
  88. data/lib/paypal_server_sdk/models/error_details.rb +15 -0
  89. data/lib/paypal_server_sdk/models/exchange_rate.rb +14 -0
  90. data/lib/paypal_server_sdk/models/experience_context.rb +15 -0
  91. data/lib/paypal_server_sdk/models/fulfillment_type.rb +36 -0
  92. data/lib/paypal_server_sdk/models/giropay_payment_object.rb +17 -5
  93. data/lib/paypal_server_sdk/models/giropay_payment_request.rb +18 -5
  94. data/lib/paypal_server_sdk/models/google_pay_authentication_method.rb +8 -2
  95. data/lib/paypal_server_sdk/models/google_pay_card.rb +128 -0
  96. data/lib/paypal_server_sdk/models/google_pay_card_response.rb +16 -0
  97. data/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb +28 -2
  98. data/lib/paypal_server_sdk/models/google_pay_payment_method.rb +1 -1
  99. data/lib/paypal_server_sdk/models/google_pay_request.rb +22 -17
  100. data/lib/paypal_server_sdk/models/google_pay_request_card.rb +14 -0
  101. data/lib/paypal_server_sdk/models/google_pay_wallet_response.rb +18 -5
  102. data/lib/paypal_server_sdk/models/ideal_payment_object.rb +18 -5
  103. data/lib/paypal_server_sdk/models/ideal_payment_request.rb +18 -5
  104. data/lib/paypal_server_sdk/models/item.rb +17 -0
  105. data/lib/paypal_server_sdk/models/item_category.rb +6 -3
  106. data/lib/paypal_server_sdk/models/level2_card_processing_data.rb +12 -0
  107. data/lib/paypal_server_sdk/models/level3_card_processing_data.rb +17 -0
  108. data/lib/paypal_server_sdk/models/liability_shift_indicator.rb +3 -3
  109. data/lib/paypal_server_sdk/models/line_item.rb +21 -0
  110. data/lib/paypal_server_sdk/models/link_description.rb +12 -0
  111. data/lib/paypal_server_sdk/models/money.rb +16 -4
  112. data/lib/paypal_server_sdk/models/mybank_payment_object.rb +18 -5
  113. data/lib/paypal_server_sdk/models/mybank_payment_request.rb +18 -5
  114. data/lib/paypal_server_sdk/models/name.rb +12 -0
  115. data/lib/paypal_server_sdk/models/net_amount_breakdown_item.rb +14 -0
  116. data/lib/paypal_server_sdk/models/network_token.rb +15 -0
  117. data/lib/paypal_server_sdk/models/network_transaction_reference.rb +14 -0
  118. data/lib/paypal_server_sdk/models/network_transaction_reference_entity.rb +15 -3
  119. data/lib/paypal_server_sdk/models/one_time_charge.rb +118 -0
  120. data/lib/paypal_server_sdk/models/order.rb +28 -25
  121. data/lib/paypal_server_sdk/models/order_application_context.rb +40 -25
  122. data/lib/paypal_server_sdk/models/order_application_context_landing_page.rb +10 -3
  123. data/lib/paypal_server_sdk/models/order_application_context_shipping_preference.rb +14 -10
  124. data/lib/paypal_server_sdk/models/order_application_context_user_action.rb +11 -6
  125. data/lib/paypal_server_sdk/models/order_authorize_request.rb +12 -0
  126. data/lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb +20 -9
  127. data/lib/paypal_server_sdk/models/order_authorize_response.rb +26 -23
  128. data/lib/paypal_server_sdk/models/order_authorize_response_payment_source.rb +14 -0
  129. data/lib/paypal_server_sdk/models/order_capture_request.rb +12 -0
  130. data/lib/paypal_server_sdk/models/order_capture_request_payment_source.rb +20 -9
  131. data/lib/paypal_server_sdk/models/order_confirm_application_context.rb +21 -8
  132. data/lib/paypal_server_sdk/models/order_request.rb +18 -4
  133. data/lib/paypal_server_sdk/models/order_status.rb +19 -6
  134. data/lib/paypal_server_sdk/models/order_tracker_item.rb +15 -0
  135. data/lib/paypal_server_sdk/models/order_tracker_request.rb +22 -5
  136. data/lib/paypal_server_sdk/models/order_tracker_response.rb +19 -6
  137. data/lib/paypal_server_sdk/models/order_tracker_status.rb +5 -2
  138. data/lib/paypal_server_sdk/models/order_update_callback_error_response.rb +89 -0
  139. data/lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb +81 -0
  140. data/lib/paypal_server_sdk/models/order_update_callback_request.rb +111 -0
  141. data/lib/paypal_server_sdk/models/order_update_callback_response.rb +72 -0
  142. data/lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb +107 -0
  143. data/lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb +93 -0
  144. data/lib/paypal_server_sdk/models/{capture.rb → orders_capture.rb} +46 -22
  145. data/lib/paypal_server_sdk/models/orders_card_verification_method.rb +51 -0
  146. data/lib/paypal_server_sdk/models/p24_payment_object.rb +24 -10
  147. data/lib/paypal_server_sdk/models/p24_payment_request.rb +22 -10
  148. data/lib/paypal_server_sdk/models/pa_res_status.rb +16 -16
  149. data/lib/paypal_server_sdk/models/participant_metadata.rb +64 -0
  150. data/lib/paypal_server_sdk/models/patch.rb +20 -10
  151. data/lib/paypal_server_sdk/models/patch_op.rb +43 -6
  152. data/lib/paypal_server_sdk/models/payee_base.rb +17 -5
  153. data/lib/paypal_server_sdk/models/payee_payment_method_preference.rb +4 -2
  154. data/lib/paypal_server_sdk/models/payer.rb +20 -5
  155. data/lib/paypal_server_sdk/models/payer_base.rb +16 -5
  156. data/lib/paypal_server_sdk/models/payment_advice_code.rb +53 -8
  157. data/lib/paypal_server_sdk/models/payment_authorization.rb +32 -11
  158. data/lib/paypal_server_sdk/models/payment_collection.rb +16 -2
  159. data/lib/paypal_server_sdk/models/payment_initiator.rb +5 -2
  160. data/lib/paypal_server_sdk/models/payment_instruction.rb +16 -0
  161. data/lib/paypal_server_sdk/models/payment_method_preference.rb +14 -0
  162. data/lib/paypal_server_sdk/models/payment_source.rb +25 -9
  163. data/lib/paypal_server_sdk/models/payment_source_response.rb +19 -0
  164. data/lib/paypal_server_sdk/models/payment_supplementary_data.rb +12 -0
  165. data/lib/paypal_server_sdk/models/payment_token_request.rb +17 -3
  166. data/lib/paypal_server_sdk/models/payment_token_request_card.rb +17 -22
  167. data/lib/paypal_server_sdk/models/payment_token_request_payment_source.rb +12 -0
  168. data/lib/paypal_server_sdk/models/payment_token_response.rb +18 -3
  169. data/lib/paypal_server_sdk/models/payment_token_response_payment_source.rb +18 -14
  170. data/lib/paypal_server_sdk/models/payment_token_status.rb +36 -0
  171. data/lib/paypal_server_sdk/models/payments_capture.rb +252 -0
  172. data/lib/paypal_server_sdk/models/payments_payment_advice_code.rb +42 -0
  173. data/lib/paypal_server_sdk/models/payments_processor_response.rb +98 -0
  174. data/lib/paypal_server_sdk/models/paypal_experience_landing_page.rb +11 -3
  175. data/lib/paypal_server_sdk/models/paypal_experience_user_action.rb +9 -4
  176. data/lib/paypal_server_sdk/models/paypal_payment_token.rb +38 -8
  177. data/lib/paypal_server_sdk/models/paypal_payment_token_customer_type.rb +7 -3
  178. data/lib/paypal_server_sdk/models/paypal_payment_token_usage_type.rb +7 -3
  179. data/lib/paypal_server_sdk/models/paypal_wallet.rb +41 -11
  180. data/lib/paypal_server_sdk/models/paypal_wallet_account_verification_status.rb +6 -2
  181. data/lib/paypal_server_sdk/models/paypal_wallet_attributes.rb +12 -0
  182. data/lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb +12 -0
  183. data/lib/paypal_server_sdk/models/paypal_wallet_context_shipping_preference.rb +31 -0
  184. data/lib/paypal_server_sdk/models/paypal_wallet_customer.rb +18 -5
  185. data/lib/paypal_server_sdk/models/paypal_wallet_customer_request.rb +18 -5
  186. data/lib/paypal_server_sdk/models/paypal_wallet_experience_context.rb +45 -12
  187. data/lib/paypal_server_sdk/models/paypal_wallet_response.rb +39 -7
  188. data/lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb +98 -0
  189. data/lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb +18 -1
  190. data/lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb +13 -0
  191. data/lib/paypal_server_sdk/models/paypal_wallet_vault_status.rb +8 -3
  192. data/lib/paypal_server_sdk/models/phone.rb +14 -0
  193. data/lib/paypal_server_sdk/models/phone_number.rb +12 -0
  194. data/lib/paypal_server_sdk/models/phone_number_with_country_code.rb +15 -0
  195. data/lib/paypal_server_sdk/models/phone_with_type.rb +13 -0
  196. data/lib/paypal_server_sdk/models/plan.rb +102 -0
  197. data/lib/paypal_server_sdk/models/platform_fee.rb +12 -0
  198. data/lib/paypal_server_sdk/models/pricing_model.rb +28 -0
  199. data/lib/paypal_server_sdk/models/pricing_scheme.rb +84 -0
  200. data/lib/paypal_server_sdk/models/processor_response.rb +15 -0
  201. data/lib/paypal_server_sdk/models/processor_response_code.rb +312 -308
  202. data/lib/paypal_server_sdk/models/purchase_unit.rb +43 -25
  203. data/lib/paypal_server_sdk/models/purchase_unit_request.rb +36 -20
  204. data/lib/paypal_server_sdk/models/reauthorize_request.rb +19 -8
  205. data/lib/paypal_server_sdk/models/refund.rb +25 -6
  206. data/lib/paypal_server_sdk/models/refund_incomplete_reason.rb +2 -1
  207. data/lib/paypal_server_sdk/models/refund_payment_instruction.rb +12 -0
  208. data/lib/paypal_server_sdk/models/refund_platform_fee.rb +12 -0
  209. data/lib/paypal_server_sdk/models/refund_request.rb +17 -2
  210. data/lib/paypal_server_sdk/models/refund_status.rb +4 -4
  211. data/lib/paypal_server_sdk/models/refund_status_details.rb +12 -0
  212. data/lib/paypal_server_sdk/models/refund_status_with_details.rb +12 -0
  213. data/lib/paypal_server_sdk/models/related_identifiers.rb +14 -0
  214. data/lib/paypal_server_sdk/models/risk_supplementary_data.rb +63 -0
  215. data/lib/paypal_server_sdk/models/seller_payable_breakdown.rb +21 -0
  216. data/lib/paypal_server_sdk/models/seller_protection.rb +13 -0
  217. data/lib/paypal_server_sdk/models/seller_protection_status.rb +6 -3
  218. data/lib/paypal_server_sdk/models/seller_receivable_breakdown.rb +18 -0
  219. data/lib/paypal_server_sdk/models/setup_token_card_experience_context.rb +21 -5
  220. data/lib/paypal_server_sdk/models/setup_token_request.rb +17 -3
  221. data/lib/paypal_server_sdk/models/setup_token_request_card.rb +20 -18
  222. data/lib/paypal_server_sdk/models/setup_token_request_payment_source.rb +13 -0
  223. data/lib/paypal_server_sdk/models/setup_token_response.rb +23 -16
  224. data/lib/paypal_server_sdk/models/setup_token_response_card.rb +25 -3
  225. data/lib/paypal_server_sdk/models/setup_token_response_payment_source.rb +13 -0
  226. data/lib/paypal_server_sdk/models/shipment_carrier.rb +1594 -1295
  227. data/lib/paypal_server_sdk/models/shipping_details.rb +30 -3
  228. data/lib/paypal_server_sdk/models/shipping_name.rb +12 -0
  229. data/lib/paypal_server_sdk/models/shipping_option.rb +14 -0
  230. data/lib/paypal_server_sdk/models/shipping_options_purchase_unit.rb +102 -0
  231. data/lib/paypal_server_sdk/models/shipping_preference.rb +6 -3
  232. data/lib/paypal_server_sdk/models/shipping_type.rb +12 -4
  233. data/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb +31 -3
  234. data/lib/paypal_server_sdk/models/sofort_payment_object.rb +18 -5
  235. data/lib/paypal_server_sdk/models/sofort_payment_request.rb +18 -5
  236. data/lib/paypal_server_sdk/models/standard_entry_class_code.rb +12 -4
  237. data/lib/paypal_server_sdk/models/store_in_vault_instruction.rb +2 -1
  238. data/lib/paypal_server_sdk/models/stored_payment_source.rb +23 -7
  239. data/lib/paypal_server_sdk/models/stored_payment_source_payment_type.rb +6 -3
  240. data/lib/paypal_server_sdk/models/stored_payment_source_usage_type.rb +6 -3
  241. data/lib/paypal_server_sdk/models/supplementary_data.rb +25 -7
  242. data/lib/paypal_server_sdk/models/supplementary_purchase_data.rb +13 -0
  243. data/lib/paypal_server_sdk/models/tax_id_type.rb +2 -2
  244. data/lib/paypal_server_sdk/models/tax_info.rb +12 -0
  245. data/lib/paypal_server_sdk/models/tenure_type.rb +28 -0
  246. data/lib/paypal_server_sdk/models/three_d_secure_authentication_response.rb +14 -0
  247. data/lib/paypal_server_sdk/models/three_d_secure_card_authentication_response.rb +89 -0
  248. data/lib/paypal_server_sdk/models/token.rb +12 -0
  249. data/lib/paypal_server_sdk/models/token_type.rb +2 -1
  250. data/lib/paypal_server_sdk/models/trustly_payment_object.rb +31 -6
  251. data/lib/paypal_server_sdk/models/trustly_payment_request.rb +30 -6
  252. data/lib/paypal_server_sdk/models/universal_product_code.rb +12 -0
  253. data/lib/paypal_server_sdk/models/upc_type.rb +14 -14
  254. data/lib/paypal_server_sdk/models/usage_pattern.rb +72 -0
  255. data/lib/paypal_server_sdk/models/vault_card_verification_method.rb +39 -0
  256. data/lib/paypal_server_sdk/models/vault_customer.rb +12 -0
  257. data/lib/paypal_server_sdk/models/vault_experience_context.rb +26 -7
  258. data/lib/paypal_server_sdk/models/vault_instruction.rb +12 -0
  259. data/lib/paypal_server_sdk/models/vault_instruction_action.rb +26 -0
  260. data/lib/paypal_server_sdk/models/vault_instruction_base.rb +12 -0
  261. data/lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb +43 -4
  262. data/lib/paypal_server_sdk/models/vault_response.rb +13 -0
  263. data/lib/paypal_server_sdk/models/vault_response_customer.rb +86 -0
  264. data/lib/paypal_server_sdk/models/vault_status.rb +8 -3
  265. data/lib/paypal_server_sdk/models/vault_token_request.rb +13 -1
  266. data/lib/paypal_server_sdk/models/vault_token_request_type.rb +20 -0
  267. data/lib/paypal_server_sdk/models/vault_venmo_experience_context.rb +24 -6
  268. data/lib/paypal_server_sdk/models/vault_venmo_request.rb +31 -3
  269. data/lib/paypal_server_sdk/models/vaulted_digital_wallet.rb +29 -3
  270. data/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb +27 -2
  271. data/lib/paypal_server_sdk/models/venmo_payment_token.rb +37 -8
  272. data/lib/paypal_server_sdk/models/venmo_payment_token_customer_type.rb +4 -2
  273. data/lib/paypal_server_sdk/models/venmo_payment_token_usage_pattern.rb +12 -6
  274. data/lib/paypal_server_sdk/models/venmo_payment_token_usage_type.rb +5 -2
  275. data/lib/paypal_server_sdk/models/venmo_wallet_additional_attributes.rb +12 -0
  276. data/lib/paypal_server_sdk/models/venmo_wallet_attributes_response.rb +12 -0
  277. data/lib/paypal_server_sdk/models/venmo_wallet_customer_information.rb +16 -5
  278. data/lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb +34 -5
  279. data/lib/paypal_server_sdk/models/venmo_wallet_request.rb +21 -8
  280. data/lib/paypal_server_sdk/models/venmo_wallet_response.rb +21 -5
  281. data/lib/paypal_server_sdk/models/venmo_wallet_vault_attributes.rb +17 -0
  282. data/lib/paypal_server_sdk/utilities/file_wrapper.rb +14 -2
  283. data/lib/paypal_server_sdk.rb +183 -152
  284. metadata +42 -16
  285. data/lib/paypal_server_sdk/models/card_payment_token.rb +0 -166
  286. data/lib/paypal_server_sdk/models/card_verification_method.rb +0 -29
  287. data/lib/paypal_server_sdk/models/fullfillment_type.rb +0 -31
  288. data/lib/paypal_server_sdk/models/google_pay_card_attributes.rb +0 -51
  289. data/lib/paypal_server_sdk/models/payee.rb +0 -65
  290. data/lib/paypal_server_sdk/models/paypal_payment_token_usage_pattern.rb +0 -35
  291. data/lib/paypal_server_sdk/models/processing_instruction.rb +0 -23
  292. data/lib/paypal_server_sdk/models/token_request_type.rb +0 -23
@@ -72,22 +72,20 @@ module PaypalServerSdk
72
72
 
73
73
  # The processor response information for payment requests, such as direct
74
74
  # credit card transactions.
75
- # @return [ProcessorResponse]
75
+ # @return [PaymentsProcessorResponse]
76
76
  attr_accessor :processor_response
77
77
 
78
78
  # The date and time, in [Internet date and time
79
79
  # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
80
- # required while fractional seconds are
81
- # optional.<blockquote><strong>Note:</strong> The regular expression
82
- # provides guidance but does not reject all invalid dates.</blockquote>
80
+ # required while fractional seconds are optional. Note: The regular
81
+ # expression provides guidance but does not reject all invalid dates.
83
82
  # @return [String]
84
83
  attr_accessor :create_time
85
84
 
86
85
  # The date and time, in [Internet date and time
87
86
  # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
88
- # required while fractional seconds are
89
- # optional.<blockquote><strong>Note:</strong> The regular expression
90
- # provides guidance but does not reject all invalid dates.</blockquote>
87
+ # required while fractional seconds are optional. Note: The regular
88
+ # expression provides guidance but does not reject all invalid dates.
91
89
  # @return [String]
92
90
  attr_accessor :update_time
93
91
 
@@ -97,7 +95,7 @@ module PaypalServerSdk
97
95
 
98
96
  # The details for the merchant who receives the funds and fulfills the
99
97
  # order. The merchant is also known as the payee.
100
- # @return [Payee]
98
+ # @return [PayeeBase]
101
99
  attr_accessor :payee
102
100
 
103
101
  # A mapping from model property names to API property names.
@@ -217,13 +215,13 @@ module PaypalServerSdk
217
215
  end
218
216
 
219
217
  links = SKIP unless hash.key?('links')
220
- processor_response = ProcessorResponse.from_hash(hash['processor_response']) if
218
+ processor_response = PaymentsProcessorResponse.from_hash(hash['processor_response']) if
221
219
  hash['processor_response']
222
220
  create_time = hash.key?('create_time') ? hash['create_time'] : SKIP
223
221
  update_time = hash.key?('update_time') ? hash['update_time'] : SKIP
224
222
  supplementary_data = PaymentSupplementaryData.from_hash(hash['supplementary_data']) if
225
223
  hash['supplementary_data']
226
- payee = Payee.from_hash(hash['payee']) if hash['payee']
224
+ payee = PayeeBase.from_hash(hash['payee']) if hash['payee']
227
225
 
228
226
  # Create object from extracted values.
229
227
  CapturedPayment.new(status: status,
@@ -244,5 +242,33 @@ module PaypalServerSdk
244
242
  supplementary_data: supplementary_data,
245
243
  payee: payee)
246
244
  end
245
+
246
+ # Provides a human-readable string representation of the object.
247
+ def to_s
248
+ class_name = self.class.name.split('::').last
249
+ "<#{class_name} status: #{@status}, status_details: #{@status_details}, id: #{@id}, amount:"\
250
+ " #{@amount}, invoice_id: #{@invoice_id}, custom_id: #{@custom_id},"\
251
+ " network_transaction_reference: #{@network_transaction_reference}, seller_protection:"\
252
+ " #{@seller_protection}, final_capture: #{@final_capture}, seller_receivable_breakdown:"\
253
+ " #{@seller_receivable_breakdown}, disbursement_mode: #{@disbursement_mode}, links:"\
254
+ " #{@links}, processor_response: #{@processor_response}, create_time: #{@create_time},"\
255
+ " update_time: #{@update_time}, supplementary_data: #{@supplementary_data}, payee:"\
256
+ " #{@payee}>"
257
+ end
258
+
259
+ # Provides a debugging-friendly string with detailed object information.
260
+ def inspect
261
+ class_name = self.class.name.split('::').last
262
+ "<#{class_name} status: #{@status.inspect}, status_details: #{@status_details.inspect}, id:"\
263
+ " #{@id.inspect}, amount: #{@amount.inspect}, invoice_id: #{@invoice_id.inspect}, custom_id:"\
264
+ " #{@custom_id.inspect}, network_transaction_reference:"\
265
+ " #{@network_transaction_reference.inspect}, seller_protection:"\
266
+ " #{@seller_protection.inspect}, final_capture: #{@final_capture.inspect},"\
267
+ " seller_receivable_breakdown: #{@seller_receivable_breakdown.inspect}, disbursement_mode:"\
268
+ " #{@disbursement_mode.inspect}, links: #{@links.inspect}, processor_response:"\
269
+ " #{@processor_response.inspect}, create_time: #{@create_time.inspect}, update_time:"\
270
+ " #{@update_time.inspect}, supplementary_data: #{@supplementary_data.inspect}, payee:"\
271
+ " #{@payee.inspect}>"
272
+ end
247
273
  end
248
274
  end
@@ -66,5 +66,18 @@ module PaypalServerSdk
66
66
  vault: vault,
67
67
  verification: verification)
68
68
  end
69
+
70
+ # Provides a human-readable string representation of the object.
71
+ def to_s
72
+ class_name = self.class.name.split('::').last
73
+ "<#{class_name} customer: #{@customer}, vault: #{@vault}, verification: #{@verification}>"
74
+ end
75
+
76
+ # Provides a debugging-friendly string with detailed object information.
77
+ def inspect
78
+ class_name = self.class.name.split('::').last
79
+ "<#{class_name} customer: #{@customer.inspect}, vault: #{@vault.inspect}, verification:"\
80
+ " #{@verification.inspect}>"
81
+ end
69
82
  end
70
83
  end
@@ -46,5 +46,17 @@ module PaypalServerSdk
46
46
  # Create object from extracted values.
47
47
  CardAttributesResponse.new(vault: vault)
48
48
  end
49
+
50
+ # Provides a human-readable string representation of the object.
51
+ def to_s
52
+ class_name = self.class.name.split('::').last
53
+ "<#{class_name} vault: #{@vault}>"
54
+ end
55
+
56
+ # Provides a debugging-friendly string with detailed object information.
57
+ def inspect
58
+ class_name = self.class.name.split('::').last
59
+ "<#{class_name} vault: #{@vault.inspect}>"
60
+ end
49
61
  end
50
62
  end
@@ -10,7 +10,7 @@ module PaypalServerSdk
10
10
  private_constant :SKIP
11
11
 
12
12
  # Results of 3D Secure Authentication.
13
- # @return [ThreeDSecureAuthenticationResponse]
13
+ # @return [ThreeDSecureCardAuthenticationResponse]
14
14
  attr_accessor :three_d_secure
15
15
 
16
16
  # A mapping from model property names to API property names.
@@ -41,11 +41,23 @@ module PaypalServerSdk
41
41
  return nil unless hash
42
42
 
43
43
  # Extract variables from the hash.
44
- three_d_secure = ThreeDSecureAuthenticationResponse.from_hash(hash['three_d_secure']) if
44
+ three_d_secure = ThreeDSecureCardAuthenticationResponse.from_hash(hash['three_d_secure']) if
45
45
  hash['three_d_secure']
46
46
 
47
47
  # Create object from extracted values.
48
48
  CardAuthenticationResponse.new(three_d_secure: three_d_secure)
49
49
  end
50
+
51
+ # Provides a human-readable string representation of the object.
52
+ def to_s
53
+ class_name = self.class.name.split('::').last
54
+ "<#{class_name} three_d_secure: #{@three_d_secure}>"
55
+ end
56
+
57
+ # Provides a debugging-friendly string with detailed object information.
58
+ def inspect
59
+ class_name = self.class.name.split('::').last
60
+ "<#{class_name} three_d_secure: #{@three_d_secure.inspect}>"
61
+ end
50
62
  end
51
63
  end
@@ -8,79 +8,83 @@ module PaypalServerSdk
8
8
  # cards.
9
9
  class CardBrand
10
10
  CARD_BRAND = [
11
- # TODO: Write general description for VISA
11
+ # Visa card.
12
12
  VISA = 'VISA'.freeze,
13
13
 
14
- # TODO: Write general description for MASTERCARD
14
+ # Mastecard card.
15
15
  MASTERCARD = 'MASTERCARD'.freeze,
16
16
 
17
- # TODO: Write general description for DISCOVER
17
+ # Discover card.
18
18
  DISCOVER = 'DISCOVER'.freeze,
19
19
 
20
- # TODO: Write general description for AMEX
20
+ # American Express card.
21
21
  AMEX = 'AMEX'.freeze,
22
22
 
23
- # TODO: Write general description for SOLO
23
+ # Solo debit card.
24
24
  SOLO = 'SOLO'.freeze,
25
25
 
26
- # TODO: Write general description for JCB
26
+ # Japan Credit Bureau card.
27
27
  JCB = 'JCB'.freeze,
28
28
 
29
- # TODO: Write general description for STAR
29
+ # Military Star card.
30
30
  STAR = 'STAR'.freeze,
31
31
 
32
- # TODO: Write general description for DELTA
32
+ # Delta Airlines card.
33
33
  DELTA = 'DELTA'.freeze,
34
34
 
35
- # TODO: Write general description for SWITCH
35
+ # Switch credit card.
36
36
  SWITCH = 'SWITCH'.freeze,
37
37
 
38
- # TODO: Write general description for MAESTRO
38
+ # Maestro credit card.
39
39
  MAESTRO = 'MAESTRO'.freeze,
40
40
 
41
- # TODO: Write general description for CB_NATIONALE
41
+ # Carte Bancaire (CB) credit card.
42
42
  CB_NATIONALE = 'CB_NATIONALE'.freeze,
43
43
 
44
- # TODO: Write general description for CONFIGOGA
44
+ # Configoga credit card.
45
45
  CONFIGOGA = 'CONFIGOGA'.freeze,
46
46
 
47
- # TODO: Write general description for CONFIDIS
47
+ # Confidis credit card.
48
48
  CONFIDIS = 'CONFIDIS'.freeze,
49
49
 
50
- # TODO: Write general description for ELECTRON
50
+ # Visa Electron credit card.
51
51
  ELECTRON = 'ELECTRON'.freeze,
52
52
 
53
- # TODO: Write general description for CETELEM
53
+ # Cetelem credit card.
54
54
  CETELEM = 'CETELEM'.freeze,
55
55
 
56
- # TODO: Write general description for CHINA_UNION_PAY
56
+ # China union pay credit card.
57
57
  CHINA_UNION_PAY = 'CHINA_UNION_PAY'.freeze,
58
58
 
59
- # TODO: Write general description for DINERS
59
+ # The Diners Club International banking and payment services capability
60
+ # network owned by Discover Financial Services (DFS), one of the most
61
+ # recognized brands in US financial services.
60
62
  DINERS = 'DINERS'.freeze,
61
63
 
62
- # TODO: Write general description for ELO
64
+ # The Brazilian Elo card payment network.
63
65
  ELO = 'ELO'.freeze,
64
66
 
65
- # TODO: Write general description for HIPER
67
+ # The Hiper - Ingenico ePayment network.
66
68
  HIPER = 'HIPER'.freeze,
67
69
 
68
- # TODO: Write general description for HIPERCARD
70
+ # The Brazilian Hipercard payment network that's widely accepted in the
71
+ # retail market.
69
72
  HIPERCARD = 'HIPERCARD'.freeze,
70
73
 
71
- # TODO: Write general description for RUPAY
74
+ # The RuPay payment network.
72
75
  RUPAY = 'RUPAY'.freeze,
73
76
 
74
- # TODO: Write general description for GE
77
+ # The GE Credit Union 3Point card payment network.
75
78
  GE = 'GE'.freeze,
76
79
 
77
- # TODO: Write general description for SYNCHRONY
80
+ # The Synchrony Financial (SYF) payment network.
78
81
  SYNCHRONY = 'SYNCHRONY'.freeze,
79
82
 
80
- # TODO: Write general description for EFTPOS
83
+ # The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card payment
84
+ # network.
81
85
  EFTPOS = 'EFTPOS'.freeze,
82
86
 
83
- # TODO: Write general description for UNKNOWN
87
+ # UNKNOWN payment network.
84
88
  UNKNOWN = 'UNKNOWN'.freeze
85
89
  ].freeze
86
90
 
@@ -13,11 +13,10 @@ module PaypalServerSdk
13
13
  # @return [String]
14
14
  attr_accessor :id
15
15
 
16
- # The internationalized email address.<blockquote><strong>Note:</strong> Up
17
- # to 64 characters are allowed before and 255 characters are allowed after
18
- # the <code>@</code> sign. However, the generally accepted maximum length
19
- # for an email address is 254 characters. The pattern verifies that an
20
- # unquoted <code>@</code> sign exists.</blockquote>
16
+ # The internationalized email address. Note: Up to 64 characters are allowed
17
+ # before and 255 characters are allowed after the @ sign. However, the
18
+ # generally accepted maximum length for an email address is 254 characters.
19
+ # The pattern verifies that an unquoted @ sign exists.
21
20
  # @return [String]
22
21
  attr_accessor :email_address
23
22
 
@@ -81,5 +80,19 @@ module PaypalServerSdk
81
80
  phone: phone,
82
81
  merchant_customer_id: merchant_customer_id)
83
82
  end
83
+
84
+ # Provides a human-readable string representation of the object.
85
+ def to_s
86
+ class_name = self.class.name.split('::').last
87
+ "<#{class_name} id: #{@id}, email_address: #{@email_address}, phone: #{@phone},"\
88
+ " merchant_customer_id: #{@merchant_customer_id}>"
89
+ end
90
+
91
+ # Provides a debugging-friendly string with detailed object information.
92
+ def inspect
93
+ class_name = self.class.name.split('::').last
94
+ "<#{class_name} id: #{@id.inspect}, email_address: #{@email_address.inspect}, phone:"\
95
+ " #{@phone.inspect}, merchant_customer_id: #{@merchant_customer_id.inspect}>"
96
+ end
84
97
  end
85
98
  end
@@ -55,5 +55,17 @@ module PaypalServerSdk
55
55
  CardExperienceContext.new(return_url: return_url,
56
56
  cancel_url: cancel_url)
57
57
  end
58
+
59
+ # Provides a human-readable string representation of the object.
60
+ def to_s
61
+ class_name = self.class.name.split('::').last
62
+ "<#{class_name} return_url: #{@return_url}, cancel_url: #{@cancel_url}>"
63
+ end
64
+
65
+ # Provides a debugging-friendly string with detailed object information.
66
+ def inspect
67
+ class_name = self.class.name.split('::').last
68
+ "<#{class_name} return_url: #{@return_url.inspect}, cancel_url: #{@cancel_url.inspect}>"
69
+ end
58
70
  end
59
71
  end
@@ -56,5 +56,17 @@ module PaypalServerSdk
56
56
  CardFromRequest.new(expiry: expiry,
57
57
  last_digits: last_digits)
58
58
  end
59
+
60
+ # Provides a human-readable string representation of the object.
61
+ def to_s
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} expiry: #{@expiry}, last_digits: #{@last_digits}>"
64
+ end
65
+
66
+ # Provides a debugging-friendly string with detailed object information.
67
+ def inspect
68
+ class_name = self.class.name.split('::').last
69
+ "<#{class_name} expiry: #{@expiry.inspect}, last_digits: #{@last_digits.inspect}>"
70
+ end
59
71
  end
60
72
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  module PaypalServerSdk
7
7
  # Full representation of a Card Payment Token.
8
- class CardResponseEntity < BaseModel
8
+ class CardPaymentTokenEntity < BaseModel
9
9
  SKIP = Object.new
10
10
  private_constant :SKIP
11
11
 
@@ -28,11 +28,11 @@ module PaypalServerSdk
28
28
  attr_accessor :expiry
29
29
 
30
30
  # Address request details.
31
- # @return [AddressDetails]
31
+ # @return [CardResponseAddress]
32
32
  attr_accessor :billing_address
33
33
 
34
34
  # Verification status of Card.
35
- # @return [String]
35
+ # @return [CardVerificationStatus]
36
36
  attr_accessor :verification_status
37
37
 
38
38
  # Card Verification details including the authorization details and 3D
@@ -125,7 +125,7 @@ module PaypalServerSdk
125
125
  last_digits = hash.key?('last_digits') ? hash['last_digits'] : SKIP
126
126
  brand = hash.key?('brand') ? hash['brand'] : SKIP
127
127
  expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
128
- billing_address = AddressDetails.from_hash(hash['billing_address']) if
128
+ billing_address = CardResponseAddress.from_hash(hash['billing_address']) if
129
129
  hash['billing_address']
130
130
  verification_status =
131
131
  hash.key?('verification_status') ? hash['verification_status'] : SKIP
@@ -140,17 +140,39 @@ module PaypalServerSdk
140
140
  type = hash.key?('type') ? hash['type'] : SKIP
141
141
 
142
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)
143
+ CardPaymentTokenEntity.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
+
156
+ # Provides a human-readable string representation of the object.
157
+ def to_s
158
+ class_name = self.class.name.split('::').last
159
+ "<#{class_name} name: #{@name}, last_digits: #{@last_digits}, brand: #{@brand}, expiry:"\
160
+ " #{@expiry}, billing_address: #{@billing_address}, verification_status:"\
161
+ " #{@verification_status}, verification: #{@verification}, network_transaction_reference:"\
162
+ " #{@network_transaction_reference}, authentication_result: #{@authentication_result},"\
163
+ " bin_details: #{@bin_details}, type: #{@type}>"
164
+ end
165
+
166
+ # Provides a debugging-friendly string with detailed object information.
167
+ def inspect
168
+ class_name = self.class.name.split('::').last
169
+ "<#{class_name} name: #{@name.inspect}, last_digits: #{@last_digits.inspect}, brand:"\
170
+ " #{@brand.inspect}, expiry: #{@expiry.inspect}, billing_address:"\
171
+ " #{@billing_address.inspect}, verification_status: #{@verification_status.inspect},"\
172
+ " verification: #{@verification.inspect}, network_transaction_reference:"\
173
+ " #{@network_transaction_reference.inspect}, authentication_result:"\
174
+ " #{@authentication_result.inspect}, bin_details: #{@bin_details.inspect}, type:"\
175
+ " #{@type.inspect}>"
154
176
  end
155
177
  end
156
178
  end
@@ -4,15 +4,11 @@
4
4
  # ( https://apimatic.io ).
5
5
 
6
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>
7
+ # The payment card to use to fund a payment. Can be a credit or debit card.
8
+ # Note: Passing card number, cvv and expiry directly via the API requires PCI
9
+ # SAQ D compliance. *PayPal offers a mechanism by which you do not have to
10
+ # take on the PCI SAQ D burden by using hosted fields - refer to this
11
+ # Integration Guide*.
16
12
  class CardRequest < BaseModel
17
13
  SKIP = Object.new
18
14
  private_constant :SKIP
@@ -62,16 +58,14 @@ module PaypalServerSdk
62
58
 
63
59
  # Provides additional details to process a payment using a `card` that has
64
60
  # 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
61
+ # stored_credential or card-on-file). Parameter compatibility:
62
+ # `payment_type=ONE_TIME` is compatible only with
63
+ # `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with
64
+ # `payment_initiator=CUSTOMER`. `previous_transaction_reference` or
70
65
  # `previous_network_transaction_reference` is compatible only with
71
- # `payment_initiator=MERCHANT`.</li><li>Only one of the parameters -
66
+ # `payment_initiator=MERCHANT`. Only one of the parameters -
72
67
  # `previous_transaction_reference` and
73
- # `previous_network_transaction_reference` - can be present in the
74
- # request.</li></ul>
68
+ # `previous_network_transaction_reference` - can be present in the request.
75
69
  # @return [CardStoredCredential]
76
70
  attr_accessor :stored_credential
77
71
 
@@ -172,5 +166,26 @@ module PaypalServerSdk
172
166
  network_token: network_token,
173
167
  experience_context: experience_context)
174
168
  end
169
+
170
+ # Provides a human-readable string representation of the object.
171
+ def to_s
172
+ class_name = self.class.name.split('::').last
173
+ "<#{class_name} name: #{@name}, number: #{@number}, expiry: #{@expiry}, security_code:"\
174
+ " #{@security_code}, billing_address: #{@billing_address}, attributes: #{@attributes},"\
175
+ " vault_id: #{@vault_id}, single_use_token: #{@single_use_token}, stored_credential:"\
176
+ " #{@stored_credential}, network_token: #{@network_token}, experience_context:"\
177
+ " #{@experience_context}>"
178
+ end
179
+
180
+ # Provides a debugging-friendly string with detailed object information.
181
+ def inspect
182
+ class_name = self.class.name.split('::').last
183
+ "<#{class_name} name: #{@name.inspect}, number: #{@number.inspect}, expiry:"\
184
+ " #{@expiry.inspect}, security_code: #{@security_code.inspect}, billing_address:"\
185
+ " #{@billing_address.inspect}, attributes: #{@attributes.inspect}, vault_id:"\
186
+ " #{@vault_id.inspect}, single_use_token: #{@single_use_token.inspect}, stored_credential:"\
187
+ " #{@stored_credential.inspect}, network_token: #{@network_token.inspect},"\
188
+ " experience_context: #{@experience_context.inspect}>"
189
+ end
175
190
  end
176
191
  end
@@ -52,6 +52,19 @@ module PaypalServerSdk
52
52
  # @return [BinDetails]
53
53
  attr_accessor :bin_details
54
54
 
55
+ # Provides additional details to process a payment using a `card` that has
56
+ # been stored or is intended to be stored (also referred to as
57
+ # stored_credential or card-on-file). Parameter compatibility:
58
+ # `payment_type=ONE_TIME` is compatible only with
59
+ # `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with
60
+ # `payment_initiator=CUSTOMER`. `previous_transaction_reference` or
61
+ # `previous_network_transaction_reference` is compatible only with
62
+ # `payment_initiator=MERCHANT`. Only one of the parameters -
63
+ # `previous_transaction_reference` and
64
+ # `previous_network_transaction_reference` - can be present in the request.
65
+ # @return [CardStoredCredential]
66
+ attr_accessor :stored_credential
67
+
55
68
  # A mapping from model property names to API property names.
56
69
  def self.names
57
70
  @_hash = {} if @_hash.nil?
@@ -65,6 +78,7 @@ module PaypalServerSdk
65
78
  @_hash['from_request'] = 'from_request'
66
79
  @_hash['expiry'] = 'expiry'
67
80
  @_hash['bin_details'] = 'bin_details'
81
+ @_hash['stored_credential'] = 'stored_credential'
68
82
  @_hash
69
83
  end
70
84
 
@@ -81,6 +95,7 @@ module PaypalServerSdk
81
95
  from_request
82
96
  expiry
83
97
  bin_details
98
+ stored_credential
84
99
  ]
85
100
  end
86
101
 
@@ -92,7 +107,8 @@ module PaypalServerSdk
92
107
  def initialize(name: SKIP, last_digits: SKIP, brand: SKIP,
93
108
  available_networks: SKIP, type: SKIP,
94
109
  authentication_result: SKIP, attributes: SKIP,
95
- from_request: SKIP, expiry: SKIP, bin_details: SKIP)
110
+ from_request: SKIP, expiry: SKIP, bin_details: SKIP,
111
+ stored_credential: SKIP)
96
112
  @name = name unless name == SKIP
97
113
  @last_digits = last_digits unless last_digits == SKIP
98
114
  @brand = brand unless brand == SKIP
@@ -103,6 +119,7 @@ module PaypalServerSdk
103
119
  @from_request = from_request unless from_request == SKIP
104
120
  @expiry = expiry unless expiry == SKIP
105
121
  @bin_details = bin_details unless bin_details == SKIP
122
+ @stored_credential = stored_credential unless stored_credential == SKIP
106
123
  end
107
124
 
108
125
  # Creates an instance of the object from a hash.
@@ -122,6 +139,8 @@ module PaypalServerSdk
122
139
  from_request = CardFromRequest.from_hash(hash['from_request']) if hash['from_request']
123
140
  expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
124
141
  bin_details = BinDetails.from_hash(hash['bin_details']) if hash['bin_details']
142
+ stored_credential = CardStoredCredential.from_hash(hash['stored_credential']) if
143
+ hash['stored_credential']
125
144
 
126
145
  # Create object from extracted values.
127
146
  CardResponse.new(name: name,
@@ -133,7 +152,29 @@ module PaypalServerSdk
133
152
  attributes: attributes,
134
153
  from_request: from_request,
135
154
  expiry: expiry,
136
- bin_details: bin_details)
155
+ bin_details: bin_details,
156
+ stored_credential: stored_credential)
157
+ end
158
+
159
+ # Provides a human-readable string representation of the object.
160
+ def to_s
161
+ class_name = self.class.name.split('::').last
162
+ "<#{class_name} name: #{@name}, last_digits: #{@last_digits}, brand: #{@brand},"\
163
+ " available_networks: #{@available_networks}, type: #{@type}, authentication_result:"\
164
+ " #{@authentication_result}, attributes: #{@attributes}, from_request: #{@from_request},"\
165
+ " expiry: #{@expiry}, bin_details: #{@bin_details}, stored_credential:"\
166
+ " #{@stored_credential}>"
167
+ end
168
+
169
+ # Provides a debugging-friendly string with detailed object information.
170
+ def inspect
171
+ class_name = self.class.name.split('::').last
172
+ "<#{class_name} name: #{@name.inspect}, last_digits: #{@last_digits.inspect}, brand:"\
173
+ " #{@brand.inspect}, available_networks: #{@available_networks.inspect}, type:"\
174
+ " #{@type.inspect}, authentication_result: #{@authentication_result.inspect}, attributes:"\
175
+ " #{@attributes.inspect}, from_request: #{@from_request.inspect}, expiry:"\
176
+ " #{@expiry.inspect}, bin_details: #{@bin_details.inspect}, stored_credential:"\
177
+ " #{@stored_credential.inspect}>"
137
178
  end
138
179
  end
139
180
  end