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
@@ -5,7 +5,7 @@
5
5
 
6
6
  module PaypalServerSdk
7
7
  # Address request details.
8
- class AddressDetails < BaseModel
8
+ class CardResponseAddress < BaseModel
9
9
  SKIP = Object.new
10
10
  private_constant :SKIP
11
11
 
@@ -25,10 +25,9 @@ module PaypalServerSdk
25
25
 
26
26
  # The highest-level sub-division in a country, which is usually a province,
27
27
  # state, or ISO-3166-2 subdivision. This data is formatted for postal
28
- # delivery, for example, `CA` and not `California`. Value, by country,
29
- # is:<ul><li>UK. A county.</li><li>US. A state.</li><li>Canada. A
30
- # province.</li><li>Japan. A prefecture.</li><li>Switzerland. A
31
- # *kanton*.</li></ul>
28
+ # delivery, for example, `CA` and not `California`. Value, by country, is:
29
+ # UK. A county. US. A state. Canada. A province. Japan. A prefecture.
30
+ # Switzerland. A *kanton*.
32
31
  # @return [String]
33
32
  attr_accessor :admin_area_1
34
33
 
@@ -39,36 +38,17 @@ module PaypalServerSdk
39
38
  attr_accessor :postal_code
40
39
 
41
40
  # The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that
42
- # identifies the country or region.<blockquote><strong>Note:</strong> The
43
- # country code for Great Britain is <code>GB</code> and not <code>UK</code>
44
- # as used in the top-level domain names for that country. Use the `C2`
45
- # country code for China worldwide for comparable uncontrolled price (CUP)
46
- # method, bank card, and cross-border transactions.</blockquote>
41
+ # identifies the country or region. Note: The country code for Great Britain
42
+ # is GB and not UK as used in the top-level domain names for that country.
43
+ # Use the `C2` country code for China worldwide for comparable uncontrolled
44
+ # price (CUP) method, bank card, and cross-border transactions.
47
45
  # @return [String]
48
46
  attr_accessor :country_code
49
47
 
50
- # The name of the party.
51
- # @return [Name]
52
- attr_accessor :name
53
-
54
48
  # The resource ID of the address.
55
49
  # @return [String]
56
50
  attr_accessor :id
57
51
 
58
- # The name of the company or business associated to the address.
59
- # @return [String]
60
- attr_accessor :company
61
-
62
- # The phone number that can go on the mailing label with the address to
63
- # track the shipping. Phone number is in E.164 format.
64
- # @return [String]
65
- attr_accessor :phone
66
-
67
- # The phone number, in its canonical international [E.164 numbering plan
68
- # format](https://www.itu.int/rec/T-REC-E.164/en).
69
- # @return [Phone]
70
- attr_accessor :phone_number
71
-
72
52
  # A mapping from model property names to API property names.
73
53
  def self.names
74
54
  @_hash = {} if @_hash.nil?
@@ -78,11 +58,7 @@ module PaypalServerSdk
78
58
  @_hash['admin_area_1'] = 'admin_area_1'
79
59
  @_hash['postal_code'] = 'postal_code'
80
60
  @_hash['country_code'] = 'country_code'
81
- @_hash['name'] = 'name'
82
61
  @_hash['id'] = 'id'
83
- @_hash['company'] = 'company'
84
- @_hash['phone'] = 'phone'
85
- @_hash['phone_number'] = 'phone_number'
86
62
  @_hash
87
63
  end
88
64
 
@@ -94,11 +70,7 @@ module PaypalServerSdk
94
70
  admin_area_2
95
71
  admin_area_1
96
72
  postal_code
97
- name
98
73
  id
99
- company
100
- phone
101
- phone_number
102
74
  ]
103
75
  end
104
76
 
@@ -109,19 +81,14 @@ module PaypalServerSdk
109
81
 
110
82
  def initialize(country_code:, address_line_1: SKIP, address_line_2: SKIP,
111
83
  admin_area_2: SKIP, admin_area_1: SKIP, postal_code: SKIP,
112
- name: SKIP, id: SKIP, company: SKIP, phone: SKIP,
113
- phone_number: SKIP)
84
+ id: SKIP)
114
85
  @address_line_1 = address_line_1 unless address_line_1 == SKIP
115
86
  @address_line_2 = address_line_2 unless address_line_2 == SKIP
116
87
  @admin_area_2 = admin_area_2 unless admin_area_2 == SKIP
117
88
  @admin_area_1 = admin_area_1 unless admin_area_1 == SKIP
118
89
  @postal_code = postal_code unless postal_code == SKIP
119
90
  @country_code = country_code
120
- @name = name unless name == SKIP
121
91
  @id = id unless id == SKIP
122
- @company = company unless company == SKIP
123
- @phone = phone unless phone == SKIP
124
- @phone_number = phone_number unless phone_number == SKIP
125
92
  end
126
93
 
127
94
  # Creates an instance of the object from a hash.
@@ -137,24 +104,33 @@ module PaypalServerSdk
137
104
  admin_area_2 = hash.key?('admin_area_2') ? hash['admin_area_2'] : SKIP
138
105
  admin_area_1 = hash.key?('admin_area_1') ? hash['admin_area_1'] : SKIP
139
106
  postal_code = hash.key?('postal_code') ? hash['postal_code'] : SKIP
140
- name = Name.from_hash(hash['name']) if hash['name']
141
107
  id = hash.key?('id') ? hash['id'] : SKIP
142
- company = hash.key?('company') ? hash['company'] : SKIP
143
- phone = hash.key?('phone') ? hash['phone'] : SKIP
144
- phone_number = Phone.from_hash(hash['phone_number']) if hash['phone_number']
145
108
 
146
109
  # Create object from extracted values.
147
- AddressDetails.new(country_code: country_code,
148
- address_line_1: address_line_1,
149
- address_line_2: address_line_2,
150
- admin_area_2: admin_area_2,
151
- admin_area_1: admin_area_1,
152
- postal_code: postal_code,
153
- name: name,
154
- id: id,
155
- company: company,
156
- phone: phone,
157
- phone_number: phone_number)
110
+ CardResponseAddress.new(country_code: country_code,
111
+ address_line_1: address_line_1,
112
+ address_line_2: address_line_2,
113
+ admin_area_2: admin_area_2,
114
+ admin_area_1: admin_area_1,
115
+ postal_code: postal_code,
116
+ id: id)
117
+ end
118
+
119
+ # Provides a human-readable string representation of the object.
120
+ def to_s
121
+ class_name = self.class.name.split('::').last
122
+ "<#{class_name} address_line_1: #{@address_line_1}, address_line_2: #{@address_line_2},"\
123
+ " admin_area_2: #{@admin_area_2}, admin_area_1: #{@admin_area_1}, postal_code:"\
124
+ " #{@postal_code}, country_code: #{@country_code}, id: #{@id}>"
125
+ end
126
+
127
+ # Provides a debugging-friendly string with detailed object information.
128
+ def inspect
129
+ class_name = self.class.name.split('::').last
130
+ "<#{class_name} address_line_1: #{@address_line_1.inspect}, address_line_2:"\
131
+ " #{@address_line_2.inspect}, admin_area_2: #{@admin_area_2.inspect}, admin_area_1:"\
132
+ " #{@admin_area_1.inspect}, postal_code: #{@postal_code.inspect}, country_code:"\
133
+ " #{@country_code.inspect}, id: #{@id.inspect}>"
158
134
  end
159
135
  end
160
136
  end
@@ -6,15 +6,14 @@
6
6
  module PaypalServerSdk
7
7
  # Provides additional details to process a payment using a `card` that has
8
8
  # been stored or is intended to be stored (also referred to as
9
- # stored_credential or card-on-file).<br/>Parameter
10
- # compatibility:<br/><ul><li>`payment_type=ONE_TIME` is compatible only with
11
- # `payment_initiator=CUSTOMER`.</li><li>`usage=FIRST` is compatible only with
12
- # `payment_initiator=CUSTOMER`.</li><li>`previous_transaction_reference` or
9
+ # stored_credential or card-on-file). Parameter compatibility:
10
+ # `payment_type=ONE_TIME` is compatible only with
11
+ # `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with
12
+ # `payment_initiator=CUSTOMER`. `previous_transaction_reference` or
13
13
  # `previous_network_transaction_reference` is compatible only with
14
- # `payment_initiator=MERCHANT`.</li><li>Only one of the parameters -
14
+ # `payment_initiator=MERCHANT`. Only one of the parameters -
15
15
  # `previous_transaction_reference` and
16
- # `previous_network_transaction_reference` - can be present in the
17
- # request.</li></ul>
16
+ # `previous_network_transaction_reference` - can be present in the request.
18
17
  class CardStoredCredential < BaseModel
19
18
  SKIP = Object.new
20
19
  private_constant :SKIP
@@ -91,5 +90,22 @@ module PaypalServerSdk
91
90
  usage: usage,
92
91
  previous_network_transaction_reference: previous_network_transaction_reference)
93
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} payment_initiator: #{@payment_initiator}, payment_type: #{@payment_type},"\
98
+ " usage: #{@usage}, previous_network_transaction_reference:"\
99
+ " #{@previous_network_transaction_reference}>"
100
+ end
101
+
102
+ # Provides a debugging-friendly string with detailed object information.
103
+ def inspect
104
+ class_name = self.class.name.split('::').last
105
+ "<#{class_name} payment_initiator: #{@payment_initiator.inspect}, payment_type:"\
106
+ " #{@payment_type.inspect}, usage: #{@usage.inspect},"\
107
+ ' previous_network_transaction_reference:'\
108
+ " #{@previous_network_transaction_reference.inspect}>"
109
+ end
94
110
  end
95
111
  end
@@ -6,11 +6,7 @@
6
6
  module PaypalServerSdk
7
7
  # Merchants and partners can add Level 2 and 3 data to payments to reduce risk
8
8
  # and payment processing costs. For more information about processing
9
- # payments, see <a
10
- # href="https://developer.paypal.com/docs/checkout/advanced/processing/">check
11
- # out</a> or <a
12
- # href="https://developer.paypal.com/docs/multiparty/checkout/advanced/process
13
- # ing/">multiparty checkout</a>.
9
+ # payments, see checkout or multiparty checkout.
14
10
  class CardSupplementaryData < BaseModel
15
11
  SKIP = Object.new
16
12
  private_constant :SKIP
@@ -67,5 +63,17 @@ module PaypalServerSdk
67
63
  CardSupplementaryData.new(level_2: level_2,
68
64
  level_3: level_3)
69
65
  end
66
+
67
+ # Provides a human-readable string representation of the object.
68
+ def to_s
69
+ class_name = self.class.name.split('::').last
70
+ "<#{class_name} level_2: #{@level_2}, level_3: #{@level_3}>"
71
+ end
72
+
73
+ # Provides a debugging-friendly string with detailed object information.
74
+ def inspect
75
+ class_name = self.class.name.split('::').last
76
+ "<#{class_name} level_2: #{@level_2.inspect}, level_3: #{@level_3.inspect}>"
77
+ end
70
78
  end
71
79
  end
@@ -7,19 +7,19 @@ module PaypalServerSdk
7
7
  # Type of card. i.e Credit, Debit and so on.
8
8
  class CardType
9
9
  CARD_TYPE = [
10
- # TODO: Write general description for CREDIT
10
+ # A credit card.
11
11
  CREDIT = 'CREDIT'.freeze,
12
12
 
13
- # TODO: Write general description for DEBIT
13
+ # A debit card.
14
14
  DEBIT = 'DEBIT'.freeze,
15
15
 
16
- # TODO: Write general description for PREPAID
16
+ # A Prepaid card.
17
17
  PREPAID = 'PREPAID'.freeze,
18
18
 
19
- # TODO: Write general description for STORE
19
+ # A store card.
20
20
  STORE = 'STORE'.freeze,
21
21
 
22
- # TODO: Write general description for UNKNOWN
22
+ # Card type cannot be determined.
23
23
  UNKNOWN = 'UNKNOWN'.freeze
24
24
  ].freeze
25
25
 
@@ -82,5 +82,18 @@ module PaypalServerSdk
82
82
  links: links,
83
83
  customer: customer)
84
84
  end
85
+
86
+ # Provides a human-readable string representation of the object.
87
+ def to_s
88
+ class_name = self.class.name.split('::').last
89
+ "<#{class_name} id: #{@id}, status: #{@status}, links: #{@links}, customer: #{@customer}>"
90
+ end
91
+
92
+ # Provides a debugging-friendly string with detailed object information.
93
+ def inspect
94
+ class_name = self.class.name.split('::').last
95
+ "<#{class_name} id: #{@id.inspect}, status: #{@status.inspect}, links: #{@links.inspect},"\
96
+ " customer: #{@customer.inspect}>"
97
+ end
85
98
  end
86
99
  end
@@ -11,7 +11,7 @@ module PaypalServerSdk
11
11
  private_constant :SKIP
12
12
 
13
13
  # The method used for card verification.
14
- # @return [CardVerificationMethod]
14
+ # @return [OrdersCardVerificationMethod]
15
15
  attr_accessor :method
16
16
 
17
17
  # A mapping from model property names to API property names.
@@ -33,7 +33,7 @@ module PaypalServerSdk
33
33
  []
34
34
  end
35
35
 
36
- def initialize(method: CardVerificationMethod::SCA_WHEN_REQUIRED)
36
+ def initialize(method: OrdersCardVerificationMethod::SCA_WHEN_REQUIRED)
37
37
  @method = method unless method == SKIP
38
38
  end
39
39
 
@@ -42,10 +42,23 @@ module PaypalServerSdk
42
42
  return nil unless hash
43
43
 
44
44
  # Extract variables from the hash.
45
- method = hash['method'] ||= CardVerificationMethod::SCA_WHEN_REQUIRED
45
+ method =
46
+ hash['method'] ||= OrdersCardVerificationMethod::SCA_WHEN_REQUIRED
46
47
 
47
48
  # Create object from extracted values.
48
49
  CardVerification.new(method: method)
49
50
  end
51
+
52
+ # Provides a human-readable string representation of the object.
53
+ def to_s
54
+ class_name = self.class.name.split('::').last
55
+ "<#{class_name} method: #{@method}>"
56
+ end
57
+
58
+ # Provides a debugging-friendly string with detailed object information.
59
+ def inspect
60
+ class_name = self.class.name.split('::').last
61
+ "<#{class_name} method: #{@method.inspect}>"
62
+ end
50
63
  end
51
64
  end
@@ -10,15 +10,15 @@ module PaypalServerSdk
10
10
  SKIP = Object.new
11
11
  private_constant :SKIP
12
12
 
13
- # Transaction Identifier as given by the network to indicate a previously
14
- # executed CIT authorization. Only present when authorization is successful
15
- # for a verification.
13
+ # DEPRECATED. This field is DEPRECATED. Please find the network transaction
14
+ # id data in the 'id' field under the 'network_transaction_reference' object
15
+ # instead of the 'verification' object.
16
16
  # @return [String]
17
17
  attr_accessor :network_transaction_id
18
18
 
19
- # The date that the transaction was authorized by the scheme. This field may
20
- # not be returned for all networks. MasterCard refers to this field as
21
- # "BankNet reference date".
19
+ # DEPRECATED. This field is DEPRECATED. Please find the date data in the
20
+ # 'date' field under the 'network_transaction_reference' object instead of
21
+ # the 'verification' object.
22
22
  # @return [String]
23
23
  attr_accessor :date
24
24
 
@@ -29,9 +29,8 @@ module PaypalServerSdk
29
29
 
30
30
  # The date and time, in [Internet date and time
31
31
  # format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
32
- # required while fractional seconds are
33
- # optional.<blockquote><strong>Note:</strong> The regular expression
34
- # provides guidance but does not reject all invalid dates.</blockquote>
32
+ # required while fractional seconds are optional. Note: The regular
33
+ # expression provides guidance but does not reject all invalid dates.
35
34
  # @return [String]
36
35
  attr_accessor :time
37
36
 
@@ -45,6 +44,12 @@ module PaypalServerSdk
45
44
  # @return [CardVerificationProcessorResponse]
46
45
  attr_accessor :processor_response
47
46
 
47
+ # DEPRECATED. This field is DEPRECATED. Please find the 3D secure
48
+ # authentication data in the 'three_d_secure' object under the
49
+ # 'authentication_result' object instead of the 'verification' object.
50
+ # @return [Object]
51
+ attr_accessor :three_d_secure
52
+
48
53
  # A mapping from model property names to API property names.
49
54
  def self.names
50
55
  @_hash = {} if @_hash.nil?
@@ -54,6 +59,7 @@ module PaypalServerSdk
54
59
  @_hash['time'] = 'time'
55
60
  @_hash['amount'] = 'amount'
56
61
  @_hash['processor_response'] = 'processor_response'
62
+ @_hash['three_d_secure'] = 'three_d_secure'
57
63
  @_hash
58
64
  end
59
65
 
@@ -66,6 +72,7 @@ module PaypalServerSdk
66
72
  time
67
73
  amount
68
74
  processor_response
75
+ three_d_secure
69
76
  ]
70
77
  end
71
78
 
@@ -75,13 +82,15 @@ module PaypalServerSdk
75
82
  end
76
83
 
77
84
  def initialize(network_transaction_id: SKIP, date: SKIP, network: SKIP,
78
- time: SKIP, amount: SKIP, processor_response: SKIP)
85
+ time: SKIP, amount: SKIP, processor_response: SKIP,
86
+ three_d_secure: SKIP)
79
87
  @network_transaction_id = network_transaction_id unless network_transaction_id == SKIP
80
88
  @date = date unless date == SKIP
81
89
  @network = network unless network == SKIP
82
90
  @time = time unless time == SKIP
83
91
  @amount = amount unless amount == SKIP
84
92
  @processor_response = processor_response unless processor_response == SKIP
93
+ @three_d_secure = three_d_secure unless three_d_secure == SKIP
85
94
  end
86
95
 
87
96
  # Creates an instance of the object from a hash.
@@ -98,6 +107,8 @@ module PaypalServerSdk
98
107
  if hash['processor_response']
99
108
  processor_response = CardVerificationProcessorResponse.from_hash(hash['processor_response'])
100
109
  end
110
+ three_d_secure =
111
+ hash.key?('three_d_secure') ? hash['three_d_secure'] : SKIP
101
112
 
102
113
  # Create object from extracted values.
103
114
  CardVerificationDetails.new(network_transaction_id: network_transaction_id,
@@ -105,7 +116,25 @@ module PaypalServerSdk
105
116
  network: network,
106
117
  time: time,
107
118
  amount: amount,
108
- processor_response: processor_response)
119
+ processor_response: processor_response,
120
+ three_d_secure: three_d_secure)
121
+ end
122
+
123
+ # Provides a human-readable string representation of the object.
124
+ def to_s
125
+ class_name = self.class.name.split('::').last
126
+ "<#{class_name} network_transaction_id: #{@network_transaction_id}, date: #{@date},"\
127
+ " network: #{@network}, time: #{@time}, amount: #{@amount}, processor_response:"\
128
+ " #{@processor_response}, three_d_secure: #{@three_d_secure}>"
129
+ end
130
+
131
+ # Provides a debugging-friendly string with detailed object information.
132
+ def inspect
133
+ class_name = self.class.name.split('::').last
134
+ "<#{class_name} network_transaction_id: #{@network_transaction_id.inspect}, date:"\
135
+ " #{@date.inspect}, network: #{@network.inspect}, time: #{@time.inspect}, amount:"\
136
+ " #{@amount.inspect}, processor_response: #{@processor_response.inspect}, three_d_secure:"\
137
+ " #{@three_d_secure.inspect}>"
109
138
  end
110
139
  end
111
140
  end
@@ -58,5 +58,17 @@ module PaypalServerSdk
58
58
  CardVerificationProcessorResponse.new(avs_code: avs_code,
59
59
  cvv_code: cvv_code)
60
60
  end
61
+
62
+ # Provides a human-readable string representation of the object.
63
+ def to_s
64
+ class_name = self.class.name.split('::').last
65
+ "<#{class_name} avs_code: #{@avs_code}, cvv_code: #{@cvv_code}>"
66
+ end
67
+
68
+ # Provides a debugging-friendly string with detailed object information.
69
+ def inspect
70
+ class_name = self.class.name.split('::').last
71
+ "<#{class_name} avs_code: #{@avs_code.inspect}, cvv_code: #{@cvv_code.inspect}>"
72
+ end
61
73
  end
62
74
  end
@@ -0,0 +1,23 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # Verification status of Card.
8
+ class CardVerificationStatus
9
+ CARD_VERIFICATION_STATUS = [
10
+ # Card has been verified
11
+ VERIFIED = 'VERIFIED'.freeze,
12
+
13
+ # Card verification has failed
14
+ FAILED = 'FAILED'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ true
21
+ end
22
+ end
23
+ end
@@ -8,10 +8,18 @@ module PaypalServerSdk
8
8
  # an order after order creation.
9
9
  class CheckoutPaymentIntent
10
10
  CHECKOUT_PAYMENT_INTENT = [
11
- # TODO: Write general description for CAPTURE
11
+ # The merchant intends to capture payment immediately after the customer
12
+ # makes a payment.
12
13
  CAPTURE = 'CAPTURE'.freeze,
13
14
 
14
- # TODO: Write general description for AUTHORIZE
15
+ # The merchant intends to authorize a payment and place funds on hold
16
+ # after the customer makes a payment. Authorized payments are best
17
+ # captured within three days of authorization but are available to capture
18
+ # for up to 29 days. After the three-day honor period, the original
19
+ # authorized payment expires and you must re-authorize the payment. You
20
+ # must make a separate request to capture payments on demand. This intent
21
+ # is not supported when you have more than one `purchase_unit` within your
22
+ # order.
15
23
  AUTHORIZE = 'AUTHORIZE'.freeze
16
24
  ].freeze
17
25
 
@@ -66,5 +66,18 @@ module PaypalServerSdk
66
66
  payee: payee,
67
67
  amount: amount)
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} labels: #{@labels}, payee: #{@payee}, amount: #{@amount}>"
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} labels: #{@labels.inspect}, payee: #{@payee.inspect}, amount:"\
80
+ " #{@amount.inspect}>"
81
+ end
69
82
  end
70
83
  end
@@ -14,10 +14,6 @@ module PaypalServerSdk
14
14
  # @return [PaymentSource]
15
15
  attr_accessor :payment_source
16
16
 
17
- # The instruction to process an order.
18
- # @return [ProcessingInstruction]
19
- attr_accessor :processing_instruction
20
-
21
17
  # Customizes the payer confirmation experience.
22
18
  # @return [OrderConfirmApplicationContext]
23
19
  attr_accessor :application_context
@@ -26,7 +22,6 @@ module PaypalServerSdk
26
22
  def self.names
27
23
  @_hash = {} if @_hash.nil?
28
24
  @_hash['payment_source'] = 'payment_source'
29
- @_hash['processing_instruction'] = 'processing_instruction'
30
25
  @_hash['application_context'] = 'application_context'
31
26
  @_hash
32
27
  end
@@ -34,7 +29,6 @@ module PaypalServerSdk
34
29
  # An array for optional fields
35
30
  def self.optionals
36
31
  %w[
37
- processing_instruction
38
32
  application_context
39
33
  ]
40
34
  end
@@ -44,13 +38,8 @@ module PaypalServerSdk
44
38
  []
45
39
  end
46
40
 
47
- def initialize(
48
- payment_source:,
49
- processing_instruction: ProcessingInstruction::NO_INSTRUCTION,
50
- application_context: SKIP
51
- )
41
+ def initialize(payment_source:, application_context: SKIP)
52
42
  @payment_source = payment_source
53
- @processing_instruction = processing_instruction unless processing_instruction == SKIP
54
43
  @application_context = application_context unless application_context == SKIP
55
44
  end
56
45
 
@@ -60,15 +49,26 @@ module PaypalServerSdk
60
49
 
61
50
  # Extract variables from the hash.
62
51
  payment_source = PaymentSource.from_hash(hash['payment_source']) if hash['payment_source']
63
- processing_instruction =
64
- hash['processing_instruction'] ||= ProcessingInstruction::NO_INSTRUCTION
65
52
  application_context = OrderConfirmApplicationContext.from_hash(hash['application_context']) if
66
53
  hash['application_context']
67
54
 
68
55
  # Create object from extracted values.
69
56
  ConfirmOrderRequest.new(payment_source: payment_source,
70
- processing_instruction: processing_instruction,
71
57
  application_context: application_context)
72
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} payment_source: #{@payment_source}, application_context:"\
64
+ " #{@application_context}>"
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} payment_source: #{@payment_source.inspect}, application_context:"\
71
+ " #{@application_context.inspect}>"
72
+ end
73
73
  end
74
74
  end
@@ -4,8 +4,9 @@
4
4
  # ( https://apimatic.io ).
5
5
 
6
6
  module PaypalServerSdk
7
- # Customer in merchant's or partner's system of records.
8
- class CustomerRequest < BaseModel
7
+ # This object defines a customer in your system. Use it to manage customer
8
+ # profiles, save payment methods and contact details.
9
+ class Customer < BaseModel
9
10
  SKIP = Object.new
10
11
  private_constant :SKIP
11
12
 
@@ -55,8 +56,21 @@ module PaypalServerSdk
55
56
  hash.key?('merchant_customer_id') ? hash['merchant_customer_id'] : SKIP
56
57
 
57
58
  # Create object from extracted values.
58
- CustomerRequest.new(id: id,
59
- merchant_customer_id: merchant_customer_id)
59
+ Customer.new(id: id,
60
+ merchant_customer_id: merchant_customer_id)
61
+ end
62
+
63
+ # Provides a human-readable string representation of the object.
64
+ def to_s
65
+ class_name = self.class.name.split('::').last
66
+ "<#{class_name} id: #{@id}, merchant_customer_id: #{@merchant_customer_id}>"
67
+ end
68
+
69
+ # Provides a debugging-friendly string with detailed object information.
70
+ def inspect
71
+ class_name = self.class.name.split('::').last
72
+ "<#{class_name} id: #{@id.inspect}, merchant_customer_id:"\
73
+ " #{@merchant_customer_id.inspect}>"
60
74
  end
61
75
  end
62
76
  end
@@ -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
 
@@ -68,5 +67,18 @@ module PaypalServerSdk
68
67
  email_address: email_address,
69
68
  phone: phone)
70
69
  end
70
+
71
+ # Provides a human-readable string representation of the object.
72
+ def to_s
73
+ class_name = self.class.name.split('::').last
74
+ "<#{class_name} id: #{@id}, email_address: #{@email_address}, phone: #{@phone}>"
75
+ end
76
+
77
+ # Provides a debugging-friendly string with detailed object information.
78
+ def inspect
79
+ class_name = self.class.name.split('::').last
80
+ "<#{class_name} id: #{@id.inspect}, email_address: #{@email_address.inspect}, phone:"\
81
+ " #{@phone.inspect}>"
82
+ end
71
83
  end
72
84
  end