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
@@ -12,17 +12,15 @@ module PaypalServerSdk
12
12
 
13
13
  # The date and time, in [Internet date and time
14
14
  # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
15
- # required while fractional seconds are
16
- # optional.<blockquote><strong>Note:</strong> The regular expression
17
- # provides guidance but does not reject all invalid dates.</blockquote>
15
+ # required while fractional seconds are optional. Note: The regular
16
+ # expression provides guidance but does not reject all invalid dates.
18
17
  # @return [String]
19
18
  attr_accessor :create_time
20
19
 
21
20
  # The date and time, in [Internet date and time
22
21
  # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
23
- # required while fractional seconds are
24
- # optional.<blockquote><strong>Note:</strong> The regular expression
25
- # provides guidance but does not reject all invalid dates.</blockquote>
22
+ # required while fractional seconds are optional. Note: The regular
23
+ # expression provides guidance but does not reject all invalid dates.
26
24
  # @return [String]
27
25
  attr_accessor :update_time
28
26
 
@@ -64,5 +62,18 @@ module PaypalServerSdk
64
62
  ActivityTimestamps.new(create_time: create_time,
65
63
  update_time: update_time)
66
64
  end
65
+
66
+ # Provides a human-readable string representation of the object.
67
+ def to_s
68
+ class_name = self.class.name.split('::').last
69
+ "<#{class_name} create_time: #{@create_time}, update_time: #{@update_time}>"
70
+ end
71
+
72
+ # Provides a debugging-friendly string with detailed object information.
73
+ def inspect
74
+ class_name = self.class.name.split('::').last
75
+ "<#{class_name} create_time: #{@create_time.inspect}, update_time:"\
76
+ " #{@update_time.inspect}>"
77
+ end
67
78
  end
68
79
  end
@@ -30,10 +30,9 @@ module PaypalServerSdk
30
30
 
31
31
  # The highest-level sub-division in a country, which is usually a province,
32
32
  # state, or ISO-3166-2 subdivision. This data is formatted for postal
33
- # delivery, for example, `CA` and not `California`. Value, by country,
34
- # is:<ul><li>UK. A county.</li><li>US. A state.</li><li>Canada. A
35
- # province.</li><li>Japan. A prefecture.</li><li>Switzerland. A
36
- # *kanton*.</li></ul>
33
+ # delivery, for example, `CA` and not `California`. Value, by country, is:
34
+ # UK. A county. US. A state. Canada. A province. Japan. A prefecture.
35
+ # Switzerland. A *kanton*.
37
36
  # @return [String]
38
37
  attr_accessor :admin_area_1
39
38
 
@@ -44,11 +43,10 @@ module PaypalServerSdk
44
43
  attr_accessor :postal_code
45
44
 
46
45
  # The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that
47
- # identifies the country or region.<blockquote><strong>Note:</strong> The
48
- # country code for Great Britain is <code>GB</code> and not <code>UK</code>
49
- # as used in the top-level domain names for that country. Use the `C2`
50
- # country code for China worldwide for comparable uncontrolled price (CUP)
51
- # method, bank card, and cross-border transactions.</blockquote>
46
+ # identifies the country or region. Note: The country code for Great Britain
47
+ # is GB and not UK as used in the top-level domain names for that country.
48
+ # Use the `C2` country code for China worldwide for comparable uncontrolled
49
+ # price (CUP) method, bank card, and cross-border transactions.
52
50
  # @return [String]
53
51
  attr_accessor :country_code
54
52
 
@@ -112,5 +110,22 @@ module PaypalServerSdk
112
110
  admin_area_1: admin_area_1,
113
111
  postal_code: postal_code)
114
112
  end
113
+
114
+ # Provides a human-readable string representation of the object.
115
+ def to_s
116
+ class_name = self.class.name.split('::').last
117
+ "<#{class_name} address_line_1: #{@address_line_1}, address_line_2: #{@address_line_2},"\
118
+ " admin_area_2: #{@admin_area_2}, admin_area_1: #{@admin_area_1}, postal_code:"\
119
+ " #{@postal_code}, country_code: #{@country_code}>"
120
+ end
121
+
122
+ # Provides a debugging-friendly string with detailed object information.
123
+ def inspect
124
+ class_name = self.class.name.split('::').last
125
+ "<#{class_name} address_line_1: #{@address_line_1.inspect}, address_line_2:"\
126
+ " #{@address_line_2.inspect}, admin_area_2: #{@admin_area_2.inspect}, admin_area_1:"\
127
+ " #{@admin_area_1.inspect}, postal_code: #{@postal_code.inspect}, country_code:"\
128
+ " #{@country_code.inspect}>"
129
+ end
115
130
  end
116
131
  end
@@ -111,5 +111,22 @@ module PaypalServerSdk
111
111
  shipping_discount: shipping_discount,
112
112
  discount: discount)
113
113
  end
114
+
115
+ # Provides a human-readable string representation of the object.
116
+ def to_s
117
+ class_name = self.class.name.split('::').last
118
+ "<#{class_name} item_total: #{@item_total}, shipping: #{@shipping}, handling: #{@handling},"\
119
+ " tax_total: #{@tax_total}, insurance: #{@insurance}, shipping_discount:"\
120
+ " #{@shipping_discount}, discount: #{@discount}>"
121
+ end
122
+
123
+ # Provides a debugging-friendly string with detailed object information.
124
+ def inspect
125
+ class_name = self.class.name.split('::').last
126
+ "<#{class_name} item_total: #{@item_total.inspect}, shipping: #{@shipping.inspect},"\
127
+ " handling: #{@handling.inspect}, tax_total: #{@tax_total.inspect}, insurance:"\
128
+ " #{@insurance.inspect}, shipping_discount: #{@shipping_discount.inspect}, discount:"\
129
+ " #{@discount.inspect}>"
130
+ end
114
131
  end
115
132
  end
@@ -6,12 +6,11 @@
6
6
  module PaypalServerSdk
7
7
  # The total order amount with an optional breakdown that provides details,
8
8
  # such as the total item amount, total tax amount, shipping, handling,
9
- # insurance, and discounts, if any.<br/>If you specify `amount.breakdown`, the
9
+ # insurance, and discounts, if any. If you specify `amount.breakdown`, the
10
10
  # amount equals `item_total` plus `tax_total` plus `shipping` plus `handling`
11
- # plus `insurance` minus `shipping_discount` minus discount.<br/>The amount
12
- # must be a positive number. For listed of supported currencies and decimal
13
- # precision, see the PayPal REST APIs <a
14
- # href="/docs/integration/direct/rest/currency-codes/">Currency Codes</a>.
11
+ # plus `insurance` minus `shipping_discount` minus discount. The amount must
12
+ # be a positive number. For listed of supported currencies and decimal
13
+ # precision, see the PayPal REST APIs Currency Codes.
15
14
  class AmountWithBreakdown < BaseModel
16
15
  SKIP = Object.new
17
16
  private_constant :SKIP
@@ -21,10 +20,10 @@ module PaypalServerSdk
21
20
  # @return [String]
22
21
  attr_accessor :currency_code
23
22
 
24
- # The value, which might be:<ul><li>An integer for currencies like `JPY`
25
- # that are not typically fractional.</li><li>A decimal fraction for
26
- # currencies like `TND` that are subdivided into thousandths.</li></ul>For
27
- # the required number of decimal places for a currency code, see [Currency
23
+ # The value, which might be: An integer for currencies like `JPY` that are
24
+ # not typically fractional. A decimal fraction for currencies like `TND`
25
+ # that are subdivided into thousandths. For the required number of decimal
26
+ # places for a currency code, see [Currency
28
27
  # Codes](/api/rest/reference/currency-codes/).
29
28
  # @return [String]
30
29
  attr_accessor :value
@@ -76,5 +75,19 @@ module PaypalServerSdk
76
75
  value: value,
77
76
  breakdown: breakdown)
78
77
  end
78
+
79
+ # Provides a human-readable string representation of the object.
80
+ def to_s
81
+ class_name = self.class.name.split('::').last
82
+ "<#{class_name} currency_code: #{@currency_code}, value: #{@value}, breakdown:"\
83
+ " #{@breakdown}>"
84
+ end
85
+
86
+ # Provides a debugging-friendly string with detailed object information.
87
+ def inspect
88
+ class_name = self.class.name.split('::').last
89
+ "<#{class_name} currency_code: #{@currency_code.inspect}, value: #{@value.inspect},"\
90
+ " breakdown: #{@breakdown.inspect}>"
91
+ end
79
92
  end
80
93
  end
@@ -56,5 +56,17 @@ module PaypalServerSdk
56
56
  ApplePayAttributes.new(customer: customer,
57
57
  vault: vault)
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} customer: #{@customer}, vault: #{@vault}>"
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} customer: #{@customer.inspect}, vault: #{@vault.inspect}>"
70
+ end
59
71
  end
60
72
  end
@@ -46,5 +46,17 @@ module PaypalServerSdk
46
46
  # Create object from extracted values.
47
47
  ApplePayAttributesResponse.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
@@ -90,5 +90,19 @@ module PaypalServerSdk
90
90
  brand: brand,
91
91
  billing_address: billing_address)
92
92
  end
93
+
94
+ # Provides a human-readable string representation of the object.
95
+ def to_s
96
+ class_name = self.class.name.split('::').last
97
+ "<#{class_name} name: #{@name}, last_digits: #{@last_digits}, type: #{@type}, brand:"\
98
+ " #{@brand}, billing_address: #{@billing_address}>"
99
+ end
100
+
101
+ # Provides a debugging-friendly string with detailed object information.
102
+ def inspect
103
+ class_name = self.class.name.split('::').last
104
+ "<#{class_name} name: #{@name.inspect}, last_digits: #{@last_digits.inspect}, type:"\
105
+ " #{@type.inspect}, brand: #{@brand.inspect}, billing_address: #{@billing_address.inspect}>"
106
+ end
93
107
  end
94
108
  end
@@ -51,6 +51,19 @@ module PaypalServerSdk
51
51
  # @return [BinDetails]
52
52
  attr_accessor :bin_details
53
53
 
54
+ # Provides additional details to process a payment using a `card` that has
55
+ # been stored or is intended to be stored (also referred to as
56
+ # stored_credential or card-on-file). Parameter compatibility:
57
+ # `payment_type=ONE_TIME` is compatible only with
58
+ # `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with
59
+ # `payment_initiator=CUSTOMER`. `previous_transaction_reference` or
60
+ # `previous_network_transaction_reference` is compatible only with
61
+ # `payment_initiator=MERCHANT`. Only one of the parameters -
62
+ # `previous_transaction_reference` and
63
+ # `previous_network_transaction_reference` - can be present in the request.
64
+ # @return [CardStoredCredential]
65
+ attr_accessor :stored_credential
66
+
54
67
  # The portable international postal address. Maps to
55
68
  # [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/
56
69
  # wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls:
@@ -61,11 +74,10 @@ module PaypalServerSdk
61
74
  attr_accessor :billing_address
62
75
 
63
76
  # 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>
77
+ # that identifies the country or region. Note: The country code for Great
78
+ # Britain is GB and not UK as used in the top-level domain names for that
79
+ # country. Use the `C2` country code for China worldwide for comparable
80
+ # uncontrolled price (CUP) method, bank card, and cross-border transactions.
69
81
  # @return [String]
70
82
  attr_accessor :country_code
71
83
 
@@ -82,6 +94,7 @@ module PaypalServerSdk
82
94
  @_hash['from_request'] = 'from_request'
83
95
  @_hash['expiry'] = 'expiry'
84
96
  @_hash['bin_details'] = 'bin_details'
97
+ @_hash['stored_credential'] = 'stored_credential'
85
98
  @_hash['billing_address'] = 'billing_address'
86
99
  @_hash['country_code'] = 'country_code'
87
100
  @_hash
@@ -100,6 +113,7 @@ module PaypalServerSdk
100
113
  from_request
101
114
  expiry
102
115
  bin_details
116
+ stored_credential
103
117
  billing_address
104
118
  country_code
105
119
  ]
@@ -114,7 +128,8 @@ module PaypalServerSdk
114
128
  available_networks: SKIP, type: SKIP,
115
129
  authentication_result: SKIP, attributes: SKIP,
116
130
  from_request: SKIP, expiry: SKIP, bin_details: SKIP,
117
- billing_address: SKIP, country_code: SKIP)
131
+ stored_credential: SKIP, billing_address: SKIP,
132
+ country_code: SKIP)
118
133
  @name = name unless name == SKIP
119
134
  @last_digits = last_digits unless last_digits == SKIP
120
135
  @brand = brand unless brand == SKIP
@@ -125,6 +140,7 @@ module PaypalServerSdk
125
140
  @from_request = from_request unless from_request == SKIP
126
141
  @expiry = expiry unless expiry == SKIP
127
142
  @bin_details = bin_details unless bin_details == SKIP
143
+ @stored_credential = stored_credential unless stored_credential == SKIP
128
144
  @billing_address = billing_address unless billing_address == SKIP
129
145
  @country_code = country_code unless country_code == SKIP
130
146
  end
@@ -146,6 +162,8 @@ module PaypalServerSdk
146
162
  from_request = CardFromRequest.from_hash(hash['from_request']) if hash['from_request']
147
163
  expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
148
164
  bin_details = BinDetails.from_hash(hash['bin_details']) if hash['bin_details']
165
+ stored_credential = CardStoredCredential.from_hash(hash['stored_credential']) if
166
+ hash['stored_credential']
149
167
  billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address']
150
168
  country_code = hash.key?('country_code') ? hash['country_code'] : SKIP
151
169
 
@@ -160,8 +178,32 @@ module PaypalServerSdk
160
178
  from_request: from_request,
161
179
  expiry: expiry,
162
180
  bin_details: bin_details,
181
+ stored_credential: stored_credential,
163
182
  billing_address: billing_address,
164
183
  country_code: country_code)
165
184
  end
185
+
186
+ # Provides a human-readable string representation of the object.
187
+ def to_s
188
+ class_name = self.class.name.split('::').last
189
+ "<#{class_name} name: #{@name}, last_digits: #{@last_digits}, brand: #{@brand},"\
190
+ " available_networks: #{@available_networks}, type: #{@type}, authentication_result:"\
191
+ " #{@authentication_result}, attributes: #{@attributes}, from_request: #{@from_request},"\
192
+ " expiry: #{@expiry}, bin_details: #{@bin_details}, stored_credential:"\
193
+ " #{@stored_credential}, billing_address: #{@billing_address}, country_code:"\
194
+ " #{@country_code}>"
195
+ end
196
+
197
+ # Provides a debugging-friendly string with detailed object information.
198
+ def inspect
199
+ class_name = self.class.name.split('::').last
200
+ "<#{class_name} name: #{@name.inspect}, last_digits: #{@last_digits.inspect}, brand:"\
201
+ " #{@brand.inspect}, available_networks: #{@available_networks.inspect}, type:"\
202
+ " #{@type.inspect}, authentication_result: #{@authentication_result.inspect}, attributes:"\
203
+ " #{@attributes.inspect}, from_request: #{@from_request.inspect}, expiry:"\
204
+ " #{@expiry.inspect}, bin_details: #{@bin_details.inspect}, stored_credential:"\
205
+ " #{@stored_credential.inspect}, billing_address: #{@billing_address.inspect}, country_code:"\
206
+ " #{@country_code.inspect}>"
207
+ end
166
208
  end
167
209
  end
@@ -91,5 +91,21 @@ module PaypalServerSdk
91
91
  payment_data_type: payment_data_type,
92
92
  payment_data: payment_data)
93
93
  end
94
+
95
+ # Provides a human-readable string representation of the object.
96
+ def to_s
97
+ class_name = self.class.name.split('::').last
98
+ "<#{class_name} transaction_amount: #{@transaction_amount}, tokenized_card:"\
99
+ " #{@tokenized_card}, device_manufacturer_id: #{@device_manufacturer_id}, payment_data_type:"\
100
+ " #{@payment_data_type}, payment_data: #{@payment_data}>"
101
+ end
102
+
103
+ # Provides a debugging-friendly string with detailed object information.
104
+ def inspect
105
+ class_name = self.class.name.split('::').last
106
+ "<#{class_name} transaction_amount: #{@transaction_amount.inspect}, tokenized_card:"\
107
+ " #{@tokenized_card.inspect}, device_manufacturer_id: #{@device_manufacturer_id.inspect},"\
108
+ " payment_data_type: #{@payment_data_type.inspect}, payment_data: #{@payment_data.inspect}>"
109
+ end
94
110
  end
95
111
  end
@@ -79,5 +79,19 @@ module PaypalServerSdk
79
79
  emv_data: emv_data,
80
80
  pin: pin)
81
81
  end
82
+
83
+ # Provides a human-readable string representation of the object.
84
+ def to_s
85
+ class_name = self.class.name.split('::').last
86
+ "<#{class_name} cryptogram: #{@cryptogram}, eci_indicator: #{@eci_indicator}, emv_data:"\
87
+ " #{@emv_data}, pin: #{@pin}>"
88
+ end
89
+
90
+ # Provides a debugging-friendly string with detailed object information.
91
+ def inspect
92
+ class_name = self.class.name.split('::').last
93
+ "<#{class_name} cryptogram: #{@cryptogram.inspect}, eci_indicator:"\
94
+ " #{@eci_indicator.inspect}, emv_data: #{@emv_data.inspect}, pin: #{@pin.inspect}>"
95
+ end
82
96
  end
83
97
  end
@@ -8,10 +8,14 @@ module PaypalServerSdk
8
8
  # data is 3DSECURE and for China it is EMV.
9
9
  class ApplePayPaymentDataType
10
10
  APPLE_PAY_PAYMENT_DATA_TYPE = [
11
- # TODO: Write general description for ENUM_3DSECURE
11
+ # The card was authenticated using 3D Secure (3DS) authentication scheme.
12
+ # While using this value make sure to populate cryptogram and
13
+ # eci_indicator as part of payment data..
12
14
  ENUM_3DSECURE = '3DSECURE'.freeze,
13
15
 
14
- # TODO: Write general description for EMV
16
+ # The card was authenticated using EMV method, which is applicable for
17
+ # China. While using this value make sure to pass emv_data and pin as part
18
+ # of payment data.
15
19
  EMV = 'EMV'.freeze
16
20
  ].freeze
17
21
 
@@ -25,11 +25,10 @@ module PaypalServerSdk
25
25
  # @return [String]
26
26
  attr_accessor :name
27
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>
28
+ # The internationalized email address. Note: Up to 64 characters are allowed
29
+ # before and 255 characters are allowed after the @ sign. However, the
30
+ # generally accepted maximum length for an email address is 254 characters.
31
+ # The pattern verifies that an unquoted @ sign exists.
33
32
  # @return [String]
34
33
  attr_accessor :email_address
35
34
 
@@ -46,6 +45,19 @@ module PaypalServerSdk
46
45
  # @return [ApplePayAttributesResponse]
47
46
  attr_accessor :attributes
48
47
 
48
+ # Provides additional details to process a payment using a `card` that has
49
+ # been stored or is intended to be stored (also referred to as
50
+ # stored_credential or card-on-file). Parameter compatibility:
51
+ # `payment_type=ONE_TIME` is compatible only with
52
+ # `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with
53
+ # `payment_initiator=CUSTOMER`. `previous_transaction_reference` or
54
+ # `previous_network_transaction_reference` is compatible only with
55
+ # `payment_initiator=MERCHANT`. Only one of the parameters -
56
+ # `previous_transaction_reference` and
57
+ # `previous_network_transaction_reference` - can be present in the request.
58
+ # @return [CardStoredCredential]
59
+ attr_accessor :stored_credential
60
+
49
61
  # A mapping from model property names to API property names.
50
62
  def self.names
51
63
  @_hash = {} if @_hash.nil?
@@ -56,6 +68,7 @@ module PaypalServerSdk
56
68
  @_hash['phone_number'] = 'phone_number'
57
69
  @_hash['card'] = 'card'
58
70
  @_hash['attributes'] = 'attributes'
71
+ @_hash['stored_credential'] = 'stored_credential'
59
72
  @_hash
60
73
  end
61
74
 
@@ -69,6 +82,7 @@ module PaypalServerSdk
69
82
  phone_number
70
83
  card
71
84
  attributes
85
+ stored_credential
72
86
  ]
73
87
  end
74
88
 
@@ -78,7 +92,8 @@ module PaypalServerSdk
78
92
  end
79
93
 
80
94
  def initialize(id: SKIP, token: SKIP, name: SKIP, email_address: SKIP,
81
- phone_number: SKIP, card: SKIP, attributes: SKIP)
95
+ phone_number: SKIP, card: SKIP, attributes: SKIP,
96
+ stored_credential: SKIP)
82
97
  @id = id unless id == SKIP
83
98
  @token = token unless token == SKIP
84
99
  @name = name unless name == SKIP
@@ -86,6 +101,7 @@ module PaypalServerSdk
86
101
  @phone_number = phone_number unless phone_number == SKIP
87
102
  @card = card unless card == SKIP
88
103
  @attributes = attributes unless attributes == SKIP
104
+ @stored_credential = stored_credential unless stored_credential == SKIP
89
105
  end
90
106
 
91
107
  # Creates an instance of the object from a hash.
@@ -100,6 +116,8 @@ module PaypalServerSdk
100
116
  phone_number = PhoneNumber.from_hash(hash['phone_number']) if hash['phone_number']
101
117
  card = ApplePayCardResponse.from_hash(hash['card']) if hash['card']
102
118
  attributes = ApplePayAttributesResponse.from_hash(hash['attributes']) if hash['attributes']
119
+ stored_credential = CardStoredCredential.from_hash(hash['stored_credential']) if
120
+ hash['stored_credential']
103
121
 
104
122
  # Create object from extracted values.
105
123
  ApplePayPaymentObject.new(id: id,
@@ -108,7 +126,25 @@ module PaypalServerSdk
108
126
  email_address: email_address,
109
127
  phone_number: phone_number,
110
128
  card: card,
111
- attributes: attributes)
129
+ attributes: attributes,
130
+ stored_credential: stored_credential)
131
+ end
132
+
133
+ # Provides a human-readable string representation of the object.
134
+ def to_s
135
+ class_name = self.class.name.split('::').last
136
+ "<#{class_name} id: #{@id}, token: #{@token}, name: #{@name}, email_address:"\
137
+ " #{@email_address}, phone_number: #{@phone_number}, card: #{@card}, attributes:"\
138
+ " #{@attributes}, stored_credential: #{@stored_credential}>"
139
+ end
140
+
141
+ # Provides a debugging-friendly string with detailed object information.
142
+ def inspect
143
+ class_name = self.class.name.split('::').last
144
+ "<#{class_name} id: #{@id.inspect}, token: #{@token.inspect}, name: #{@name.inspect},"\
145
+ " email_address: #{@email_address.inspect}, phone_number: #{@phone_number.inspect}, card:"\
146
+ " #{@card.inspect}, attributes: #{@attributes.inspect}, stored_credential:"\
147
+ " #{@stored_credential.inspect}>"
112
148
  end
113
149
  end
114
150
  end
@@ -47,5 +47,17 @@ module PaypalServerSdk
47
47
  # Create object from extracted values.
48
48
  ApplePayPaymentToken.new(card: card)
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} card: #{@card}>"
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} card: #{@card.inspect}>"
61
+ end
50
62
  end
51
63
  end
@@ -19,11 +19,10 @@ module PaypalServerSdk
19
19
  # @return [String]
20
20
  attr_accessor :name
21
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>
22
+ # The internationalized email address. Note: Up to 64 characters are allowed
23
+ # before and 255 characters are allowed after the @ sign. However, the
24
+ # generally accepted maximum length for an email address is 254 characters.
25
+ # The pattern verifies that an unquoted @ sign exists.
27
26
  # @return [String]
28
27
  attr_accessor :email_address
29
28
 
@@ -38,16 +37,14 @@ module PaypalServerSdk
38
37
 
39
38
  # Provides additional details to process a payment using a `card` that has
40
39
  # 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
40
+ # stored_credential or card-on-file). Parameter compatibility:
41
+ # `payment_type=ONE_TIME` is compatible only with
42
+ # `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with
43
+ # `payment_initiator=CUSTOMER`. `previous_transaction_reference` or
46
44
  # `previous_network_transaction_reference` is compatible only with
47
- # `payment_initiator=MERCHANT`.</li><li>Only one of the parameters -
45
+ # `payment_initiator=MERCHANT`. Only one of the parameters -
48
46
  # `previous_transaction_reference` and
49
- # `previous_network_transaction_reference` - can be present in the
50
- # request.</li></ul>
47
+ # `previous_network_transaction_reference` - can be present in the request.
51
48
  # @return [CardStoredCredential]
52
49
  attr_accessor :stored_credential
53
50
 
@@ -133,5 +130,22 @@ module PaypalServerSdk
133
130
  vault_id: vault_id,
134
131
  attributes: attributes)
135
132
  end
133
+
134
+ # Provides a human-readable string representation of the object.
135
+ def to_s
136
+ class_name = self.class.name.split('::').last
137
+ "<#{class_name} id: #{@id}, name: #{@name}, email_address: #{@email_address}, phone_number:"\
138
+ " #{@phone_number}, decrypted_token: #{@decrypted_token}, stored_credential:"\
139
+ " #{@stored_credential}, vault_id: #{@vault_id}, attributes: #{@attributes}>"
140
+ end
141
+
142
+ # Provides a debugging-friendly string with detailed object information.
143
+ def inspect
144
+ class_name = self.class.name.split('::').last
145
+ "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, email_address:"\
146
+ " #{@email_address.inspect}, phone_number: #{@phone_number.inspect}, decrypted_token:"\
147
+ " #{@decrypted_token.inspect}, stored_credential: #{@stored_credential.inspect}, vault_id:"\
148
+ " #{@vault_id.inspect}, attributes: #{@attributes.inspect}>"
149
+ end
136
150
  end
137
151
  end
@@ -109,5 +109,20 @@ module PaypalServerSdk
109
109
  brand: brand,
110
110
  billing_address: billing_address)
111
111
  end
112
+
113
+ # Provides a human-readable string representation of the object.
114
+ def to_s
115
+ class_name = self.class.name.split('::').last
116
+ "<#{class_name} name: #{@name}, number: #{@number}, expiry: #{@expiry}, card_type:"\
117
+ " #{@card_type}, type: #{@type}, brand: #{@brand}, billing_address: #{@billing_address}>"
118
+ end
119
+
120
+ # Provides a debugging-friendly string with detailed object information.
121
+ def inspect
122
+ class_name = self.class.name.split('::').last
123
+ "<#{class_name} name: #{@name.inspect}, number: #{@number.inspect}, expiry:"\
124
+ " #{@expiry.inspect}, card_type: #{@card_type.inspect}, type: #{@type.inspect}, brand:"\
125
+ " #{@brand.inspect}, billing_address: #{@billing_address.inspect}>"
126
+ end
112
127
  end
113
128
  end
@@ -64,5 +64,19 @@ module PaypalServerSdk
64
64
  AssuranceDetails.new(account_verified: account_verified,
65
65
  card_holder_authenticated: card_holder_authenticated)
66
66
  end
67
+
68
+ # Provides a human-readable string representation of the object.
69
+ def to_s
70
+ class_name = self.class.name.split('::').last
71
+ "<#{class_name} account_verified: #{@account_verified}, card_holder_authenticated:"\
72
+ " #{@card_holder_authenticated}>"
73
+ end
74
+
75
+ # Provides a debugging-friendly string with detailed object information.
76
+ def inspect
77
+ class_name = self.class.name.split('::').last
78
+ "<#{class_name} account_verified: #{@account_verified.inspect}, card_holder_authenticated:"\
79
+ " #{@card_holder_authenticated.inspect}>"
80
+ end
67
81
  end
68
82
  end
@@ -57,5 +57,18 @@ module PaypalServerSdk
57
57
  AuthenticationResponse.new(liability_shift: liability_shift,
58
58
  three_d_secure: three_d_secure)
59
59
  end
60
+
61
+ # Provides a human-readable string representation of the object.
62
+ def to_s
63
+ class_name = self.class.name.split('::').last
64
+ "<#{class_name} liability_shift: #{@liability_shift}, three_d_secure: #{@three_d_secure}>"
65
+ end
66
+
67
+ # Provides a debugging-friendly string with detailed object information.
68
+ def inspect
69
+ class_name = self.class.name.split('::').last
70
+ "<#{class_name} liability_shift: #{@liability_shift.inspect}, three_d_secure:"\
71
+ " #{@three_d_secure.inspect}>"
72
+ end
60
73
  end
61
74
  end