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
@@ -0,0 +1,129 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # The billing cycle providing details of the billing frequency, amount,
8
+ # duration and if the billing cycle is a free, discounted or regular billing
9
+ # cycle. The sequence of the billing cycle will be in the following order -
10
+ # free trial billing cycle(s), discounted trial billing cycle(s), regular
11
+ # billing cycle(s).
12
+ class BillingCycle < BaseModel
13
+ SKIP = Object.new
14
+ private_constant :SKIP
15
+
16
+ # The tenure type of the billing cycle identifies if the billing cycle is a
17
+ # trial(free or discounted) or regular billing cycle.
18
+ # @return [TenureType]
19
+ attr_accessor :tenure_type
20
+
21
+ # The pricing scheme details.
22
+ # @return [PricingScheme]
23
+ attr_accessor :pricing_scheme
24
+
25
+ # The frequency details for this billing cycle.
26
+ # @return [Object]
27
+ attr_accessor :frequency
28
+
29
+ # The number of times this billing cycle gets executed. Trial billing cycles
30
+ # can only be executed a finite number of times (value between 1 and 999 for
31
+ # total_cycles). Regular billing cycles can be executed infinite times
32
+ # (value of 0 for total_cycles) or a finite number of times (value between 1
33
+ # and 999 for total_cycles).
34
+ # @return [Integer]
35
+ attr_accessor :total_cycles
36
+
37
+ # The order in which this cycle is to run among other billing cycles. For
38
+ # example, a trial billing cycle has a `sequence` of `1` while a regular
39
+ # billing cycle has a `sequence` of `2`, so that trial cycle runs before the
40
+ # regular cycle.
41
+ # @return [Integer]
42
+ attr_accessor :sequence
43
+
44
+ # The stand-alone date, in [Internet date and time
45
+ # format](https://tools.ietf.org/html/rfc3339#section-5.6). To represent
46
+ # special legal values, such as a date of birth, you should use dates with
47
+ # no associated time or time-zone data. Whenever possible, use the standard
48
+ # `date_time` type. This regular expression does not validate all dates. For
49
+ # example, February 31 is valid and nothing is known about leap years.
50
+ # @return [String]
51
+ attr_accessor :start_date
52
+
53
+ # A mapping from model property names to API property names.
54
+ def self.names
55
+ @_hash = {} if @_hash.nil?
56
+ @_hash['tenure_type'] = 'tenure_type'
57
+ @_hash['pricing_scheme'] = 'pricing_scheme'
58
+ @_hash['frequency'] = 'frequency'
59
+ @_hash['total_cycles'] = 'total_cycles'
60
+ @_hash['sequence'] = 'sequence'
61
+ @_hash['start_date'] = 'start_date'
62
+ @_hash
63
+ end
64
+
65
+ # An array for optional fields
66
+ def self.optionals
67
+ %w[
68
+ pricing_scheme
69
+ frequency
70
+ total_cycles
71
+ sequence
72
+ start_date
73
+ ]
74
+ end
75
+
76
+ # An array for nullable fields
77
+ def self.nullables
78
+ []
79
+ end
80
+
81
+ def initialize(tenure_type:, pricing_scheme: SKIP, frequency: SKIP,
82
+ total_cycles: 1, sequence: 1, start_date: SKIP)
83
+ @tenure_type = tenure_type
84
+ @pricing_scheme = pricing_scheme unless pricing_scheme == SKIP
85
+ @frequency = frequency unless frequency == SKIP
86
+ @total_cycles = total_cycles unless total_cycles == SKIP
87
+ @sequence = sequence unless sequence == SKIP
88
+ @start_date = start_date unless start_date == SKIP
89
+ end
90
+
91
+ # Creates an instance of the object from a hash.
92
+ def self.from_hash(hash)
93
+ return nil unless hash
94
+
95
+ # Extract variables from the hash.
96
+ tenure_type = hash.key?('tenure_type') ? hash['tenure_type'] : nil
97
+ pricing_scheme = PricingScheme.from_hash(hash['pricing_scheme']) if hash['pricing_scheme']
98
+ frequency = hash.key?('frequency') ? hash['frequency'] : SKIP
99
+ total_cycles = hash['total_cycles'] ||= 1
100
+ sequence = hash['sequence'] ||= 1
101
+ start_date = hash.key?('start_date') ? hash['start_date'] : SKIP
102
+
103
+ # Create object from extracted values.
104
+ BillingCycle.new(tenure_type: tenure_type,
105
+ pricing_scheme: pricing_scheme,
106
+ frequency: frequency,
107
+ total_cycles: total_cycles,
108
+ sequence: sequence,
109
+ start_date: start_date)
110
+ end
111
+
112
+ # Provides a human-readable string representation of the object.
113
+ def to_s
114
+ class_name = self.class.name.split('::').last
115
+ "<#{class_name} tenure_type: #{@tenure_type}, pricing_scheme: #{@pricing_scheme},"\
116
+ " frequency: #{@frequency}, total_cycles: #{@total_cycles}, sequence: #{@sequence},"\
117
+ " start_date: #{@start_date}>"
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} tenure_type: #{@tenure_type.inspect}, pricing_scheme:"\
124
+ " #{@pricing_scheme.inspect}, frequency: #{@frequency.inspect}, total_cycles:"\
125
+ " #{@total_cycles.inspect}, sequence: #{@sequence.inspect}, start_date:"\
126
+ " #{@start_date.inspect}>"
127
+ end
128
+ end
129
+ end
@@ -20,11 +20,10 @@ module PaypalServerSdk
20
20
  attr_accessor :issuing_bank
21
21
 
22
22
  # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
23
- # that identifies the country or region.<blockquote><strong>Note:</strong>
24
- # The country code for Great Britain is <code>GB</code> and not
25
- # <code>UK</code> as used in the top-level domain names for that country.
26
- # Use the `C2` country code for China worldwide for comparable uncontrolled
27
- # price (CUP) method, bank card, and cross-border transactions.</blockquote>
23
+ # that identifies the country or region. Note: The country code for Great
24
+ # Britain is GB and not UK as used in the top-level domain names for that
25
+ # country. Use the `C2` country code for China worldwide for comparable
26
+ # uncontrolled price (CUP) method, bank card, and cross-border transactions.
28
27
  # @return [String]
29
28
  attr_accessor :bin_country_code
30
29
 
@@ -84,5 +83,19 @@ module PaypalServerSdk
84
83
  bin_country_code: bin_country_code,
85
84
  products: products)
86
85
  end
86
+
87
+ # Provides a human-readable string representation of the object.
88
+ def to_s
89
+ class_name = self.class.name.split('::').last
90
+ "<#{class_name} bin: #{@bin}, issuing_bank: #{@issuing_bank}, bin_country_code:"\
91
+ " #{@bin_country_code}, products: #{@products}>"
92
+ end
93
+
94
+ # Provides a debugging-friendly string with detailed object information.
95
+ def inspect
96
+ class_name = self.class.name.split('::').last
97
+ "<#{class_name} bin: #{@bin.inspect}, issuing_bank: #{@issuing_bank.inspect},"\
98
+ " bin_country_code: #{@bin_country_code.inspect}, products: #{@products.inspect}>"
99
+ end
87
100
  end
88
101
  end
@@ -118,5 +118,22 @@ module PaypalServerSdk
118
118
  consumer_ip: consumer_ip,
119
119
  consumer_user_agent: consumer_user_agent)
120
120
  end
121
+
122
+ # Provides a human-readable string representation of the object.
123
+ def to_s
124
+ class_name = self.class.name.split('::').last
125
+ "<#{class_name} brand_name: #{@brand_name}, locale: #{@locale}, shipping_preference:"\
126
+ " #{@shipping_preference}, return_url: #{@return_url}, cancel_url: #{@cancel_url},"\
127
+ " consumer_ip: #{@consumer_ip}, consumer_user_agent: #{@consumer_user_agent}>"
128
+ end
129
+
130
+ # Provides a debugging-friendly string with detailed object information.
131
+ def inspect
132
+ class_name = self.class.name.split('::').last
133
+ "<#{class_name} brand_name: #{@brand_name.inspect}, locale: #{@locale.inspect},"\
134
+ " shipping_preference: #{@shipping_preference.inspect}, return_url: #{@return_url.inspect},"\
135
+ " cancel_url: #{@cancel_url.inspect}, consumer_ip: #{@consumer_ip.inspect},"\
136
+ " consumer_user_agent: #{@consumer_user_agent.inspect}>"
137
+ end
121
138
  end
122
139
  end
@@ -44,5 +44,17 @@ module PaypalServerSdk
44
44
  # Create object from extracted values.
45
45
  BlikLevel0PaymentObject.new(auth_code: auth_code)
46
46
  end
47
+
48
+ # Provides a human-readable string representation of the object.
49
+ def to_s
50
+ class_name = self.class.name.split('::').last
51
+ "<#{class_name} auth_code: #{@auth_code}>"
52
+ end
53
+
54
+ # Provides a debugging-friendly string with detailed object information.
55
+ def inspect
56
+ class_name = self.class.name.split('::').last
57
+ "<#{class_name} auth_code: #{@auth_code.inspect}>"
58
+ end
47
59
  end
48
60
  end
@@ -48,5 +48,17 @@ module PaypalServerSdk
48
48
  # Create object from extracted values.
49
49
  BlikOneClickPaymentObject.new(consumer_reference: consumer_reference)
50
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} consumer_reference: #{@consumer_reference}>"
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} consumer_reference: #{@consumer_reference.inspect}>"
62
+ end
51
63
  end
52
64
  end
@@ -78,5 +78,20 @@ module PaypalServerSdk
78
78
  alias_label: alias_label,
79
79
  alias_key: alias_key)
80
80
  end
81
+
82
+ # Provides a human-readable string representation of the object.
83
+ def to_s
84
+ class_name = self.class.name.split('::').last
85
+ "<#{class_name} auth_code: #{@auth_code}, consumer_reference: #{@consumer_reference},"\
86
+ " alias_label: #{@alias_label}, alias_key: #{@alias_key}>"
87
+ end
88
+
89
+ # Provides a debugging-friendly string with detailed object information.
90
+ def inspect
91
+ class_name = self.class.name.split('::').last
92
+ "<#{class_name} auth_code: #{@auth_code.inspect}, consumer_reference:"\
93
+ " #{@consumer_reference.inspect}, alias_label: #{@alias_label.inspect}, alias_key:"\
94
+ " #{@alias_key.inspect}>"
95
+ end
81
96
  end
82
97
  end
@@ -14,19 +14,17 @@ module PaypalServerSdk
14
14
  attr_accessor :name
15
15
 
16
16
  # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
17
- # that identifies the country or region.<blockquote><strong>Note:</strong>
18
- # The country code for Great Britain is <code>GB</code> and not
19
- # <code>UK</code> as used in the top-level domain names for that country.
20
- # Use the `C2` country code for China worldwide for comparable uncontrolled
21
- # price (CUP) method, bank card, and cross-border transactions.</blockquote>
17
+ # that identifies the country or region. Note: The country code for Great
18
+ # Britain is GB and not UK as used in the top-level domain names for that
19
+ # country. Use the `C2` country code for China worldwide for comparable
20
+ # uncontrolled price (CUP) method, bank card, and cross-border transactions.
22
21
  # @return [String]
23
22
  attr_accessor :country_code
24
23
 
25
- # The internationalized email address.<blockquote><strong>Note:</strong> Up
26
- # to 64 characters are allowed before and 255 characters are allowed after
27
- # the <code>@</code> sign. However, the generally accepted maximum length
28
- # for an email address is 254 characters. The pattern verifies that an
29
- # unquoted <code>@</code> sign exists.</blockquote>
24
+ # The internationalized email address. Note: Up to 64 characters are allowed
25
+ # before and 255 characters are allowed after the @ sign. However, the
26
+ # generally accepted maximum length for an email address is 254 characters.
27
+ # The pattern verifies that an unquoted @ sign exists.
30
28
  # @return [String]
31
29
  attr_accessor :email
32
30
 
@@ -82,5 +80,19 @@ module PaypalServerSdk
82
80
  email: email,
83
81
  one_click: one_click)
84
82
  end
83
+
84
+ # Provides a human-readable string representation of the object.
85
+ def to_s
86
+ class_name = self.class.name.split('::').last
87
+ "<#{class_name} name: #{@name}, country_code: #{@country_code}, email: #{@email},"\
88
+ " one_click: #{@one_click}>"
89
+ end
90
+
91
+ # Provides a debugging-friendly string with detailed object information.
92
+ def inspect
93
+ class_name = self.class.name.split('::').last
94
+ "<#{class_name} name: #{@name.inspect}, country_code: #{@country_code.inspect}, email:"\
95
+ " #{@email.inspect}, one_click: #{@one_click.inspect}>"
96
+ end
85
97
  end
86
98
  end
@@ -14,19 +14,17 @@ module PaypalServerSdk
14
14
  attr_accessor :name
15
15
 
16
16
  # The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/)
17
- # that identifies the country or region.<blockquote><strong>Note:</strong>
18
- # The country code for Great Britain is <code>GB</code> and not
19
- # <code>UK</code> as used in the top-level domain names for that country.
20
- # Use the `C2` country code for China worldwide for comparable uncontrolled
21
- # price (CUP) method, bank card, and cross-border transactions.</blockquote>
17
+ # that identifies the country or region. Note: The country code for Great
18
+ # Britain is GB and not UK as used in the top-level domain names for that
19
+ # country. Use the `C2` country code for China worldwide for comparable
20
+ # uncontrolled price (CUP) method, bank card, and cross-border transactions.
22
21
  # @return [String]
23
22
  attr_accessor :country_code
24
23
 
25
- # The internationalized email address.<blockquote><strong>Note:</strong> Up
26
- # to 64 characters are allowed before and 255 characters are allowed after
27
- # the <code>@</code> sign. However, the generally accepted maximum length
28
- # for an email address is 254 characters. The pattern verifies that an
29
- # unquoted <code>@</code> sign exists.</blockquote>
24
+ # The internationalized email address. Note: Up to 64 characters are allowed
25
+ # before and 255 characters are allowed after the @ sign. However, the
26
+ # generally accepted maximum length for an email address is 254 characters.
27
+ # The pattern verifies that an unquoted @ sign exists.
30
28
  # @return [String]
31
29
  attr_accessor :email
32
30
 
@@ -101,5 +99,21 @@ module PaypalServerSdk
101
99
  level_0: level_0,
102
100
  one_click: one_click)
103
101
  end
102
+
103
+ # Provides a human-readable string representation of the object.
104
+ def to_s
105
+ class_name = self.class.name.split('::').last
106
+ "<#{class_name} name: #{@name}, country_code: #{@country_code}, email: #{@email},"\
107
+ " experience_context: #{@experience_context}, level_0: #{@level_0}, one_click:"\
108
+ " #{@one_click}>"
109
+ end
110
+
111
+ # Provides a debugging-friendly string with detailed object information.
112
+ def inspect
113
+ class_name = self.class.name.split('::').last
114
+ "<#{class_name} name: #{@name.inspect}, country_code: #{@country_code.inspect}, email:"\
115
+ " #{@email.inspect}, experience_context: #{@experience_context.inspect}, level_0:"\
116
+ " #{@level_0.inspect}, one_click: #{@one_click.inspect}>"
117
+ end
104
118
  end
105
119
  end
@@ -0,0 +1,75 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # CallBack Configuration that the merchant can provide to PayPal/Venmo.
8
+ class CallbackConfiguration < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # An array of callback events merchant can subscribe to for the
13
+ # corresponding callback url. The SHIPPING_ADDRESS callback event is
14
+ # required.
15
+ # @return [Array[CallbackEvents]]
16
+ attr_accessor :callback_events
17
+
18
+ # Merchant provided CallBack url.PayPal/Venmo will use this url to call the
19
+ # merchant back when the events occur .PayPal/Venmo expects a secured url
20
+ # usually in the https format.merchant can append the cart id or other
21
+ # params part of the url as query or path params.
22
+ # @return [String]
23
+ attr_accessor :callback_url
24
+
25
+ # A mapping from model property names to API property names.
26
+ def self.names
27
+ @_hash = {} if @_hash.nil?
28
+ @_hash['callback_events'] = 'callback_events'
29
+ @_hash['callback_url'] = 'callback_url'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ []
36
+ end
37
+
38
+ # An array for nullable fields
39
+ def self.nullables
40
+ []
41
+ end
42
+
43
+ def initialize(callback_events:, callback_url:)
44
+ @callback_events = callback_events
45
+ @callback_url = callback_url
46
+ end
47
+
48
+ # Creates an instance of the object from a hash.
49
+ def self.from_hash(hash)
50
+ return nil unless hash
51
+
52
+ # Extract variables from the hash.
53
+ callback_events =
54
+ hash.key?('callback_events') ? hash['callback_events'] : nil
55
+ callback_url = hash.key?('callback_url') ? hash['callback_url'] : nil
56
+
57
+ # Create object from extracted values.
58
+ CallbackConfiguration.new(callback_events: callback_events,
59
+ callback_url: callback_url)
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} callback_events: #{@callback_events}, callback_url: #{@callback_url}>"
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} callback_events: #{@callback_events.inspect}, callback_url:"\
72
+ " #{@callback_url.inspect}>"
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,27 @@
1
+ # paypal_server_sdk
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaypalServerSdk
7
+ # CallBack event.
8
+ class CallbackEvents
9
+ CALLBACK_EVENTS = [
10
+ # When Buyer changes or selects the shipping address on the PayPal/Venmo
11
+ # buyer approval flow , PayPal/Venmo will call merchant with the callback
12
+ # URL to update order totals.
13
+ SHIPPING_ADDRESS = 'SHIPPING_ADDRESS'.freeze,
14
+
15
+ # When Buyer changes or selects the shipping options on the PayPal/Venmo
16
+ # buyer approval flow , PayPal/Venmo will call merchant with the callback
17
+ # URL to update order totals.
18
+ SHIPPING_OPTIONS = 'SHIPPING_OPTIONS'.freeze
19
+ ].freeze
20
+
21
+ def self.validate(value)
22
+ return false if value.nil?
23
+
24
+ true
25
+ end
26
+ end
27
+ end
@@ -7,42 +7,50 @@ module PaypalServerSdk
7
7
  # The reason why the captured payment status is `PENDING` or `DENIED`.
8
8
  class CaptureIncompleteReason
9
9
  CAPTURE_INCOMPLETE_REASON = [
10
- # TODO: Write general description for BUYER_COMPLAINT
10
+ # The payer initiated a dispute for this captured payment with PayPal.
11
11
  BUYER_COMPLAINT = 'BUYER_COMPLAINT'.freeze,
12
12
 
13
- # TODO: Write general description for CHARGEBACK
13
+ # The captured funds were reversed in response to the payer disputing this
14
+ # captured payment with the issuer of the financial instrument used to pay
15
+ # for this captured payment.
14
16
  CHARGEBACK = 'CHARGEBACK'.freeze,
15
17
 
16
- # TODO: Write general description for ECHECK
18
+ # The payer paid by an eCheck that has not yet cleared.
17
19
  ECHECK = 'ECHECK'.freeze,
18
20
 
19
- # TODO: Write general description for INTERNATIONAL_WITHDRAWAL
21
+ # Visit your online account. In your **Account Overview**, accept and deny
22
+ # this payment.
20
23
  INTERNATIONAL_WITHDRAWAL = 'INTERNATIONAL_WITHDRAWAL'.freeze,
21
24
 
22
- # TODO: Write general description for OTHER
25
+ # No additional specific reason can be provided. For more information
26
+ # about this captured payment, visit your account online or contact
27
+ # PayPal.
23
28
  OTHER = 'OTHER'.freeze,
24
29
 
25
- # TODO: Write general description for PENDING_REVIEW
30
+ # The captured payment is pending manual review.
26
31
  PENDING_REVIEW = 'PENDING_REVIEW'.freeze,
27
32
 
28
- # TODO: Write general description for
29
- # RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION
33
+ # The payee has not yet set up appropriate receiving preferences for their
34
+ # account. For more information about how to accept or deny this payment,
35
+ # visit your account online. This reason is typically offered in scenarios
36
+ # such as when the currency of the captured payment is different from the
37
+ # primary holding currency of the payee.
30
38
  RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION = 'RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION'.freeze,
31
39
 
32
- # TODO: Write general description for REFUNDED
40
+ # The captured funds were refunded.
33
41
  REFUNDED = 'REFUNDED'.freeze,
34
42
 
35
- # TODO: Write general description for
36
- # TRANSACTION_APPROVED_AWAITING_FUNDING
43
+ # The payer must send the funds for this captured payment. This code
44
+ # generally appears for manual EFTs.
37
45
  TRANSACTION_APPROVED_AWAITING_FUNDING = 'TRANSACTION_APPROVED_AWAITING_FUNDING'.freeze,
38
46
 
39
- # TODO: Write general description for UNILATERAL
47
+ # The payee does not have a PayPal account.
40
48
  UNILATERAL = 'UNILATERAL'.freeze,
41
49
 
42
- # TODO: Write general description for VERIFICATION_REQUIRED
50
+ # The payee's PayPal account is not verified.
43
51
  VERIFICATION_REQUIRED = 'VERIFICATION_REQUIRED'.freeze,
44
52
 
45
- # TODO: Write general description for DECLINED_BY_RISK_FRAUD_FILTERS
53
+ # Risk Filter set by the payee failed for the transaction.
46
54
  DECLINED_BY_RISK_FRAUD_FILTERS = 'DECLINED_BY_RISK_FRAUD_FILTERS'.freeze
47
55
  ].freeze
48
56
 
@@ -85,5 +85,20 @@ module PaypalServerSdk
85
85
  disbursement_mode: disbursement_mode,
86
86
  payee_receivable_fx_rate_id: payee_receivable_fx_rate_id)
87
87
  end
88
+
89
+ # Provides a human-readable string representation of the object.
90
+ def to_s
91
+ class_name = self.class.name.split('::').last
92
+ "<#{class_name} platform_fees: #{@platform_fees}, disbursement_mode: #{@disbursement_mode},"\
93
+ " payee_receivable_fx_rate_id: #{@payee_receivable_fx_rate_id}>"
94
+ end
95
+
96
+ # Provides a debugging-friendly string with detailed object information.
97
+ def inspect
98
+ class_name = self.class.name.split('::').last
99
+ "<#{class_name} platform_fees: #{@platform_fees.inspect}, disbursement_mode:"\
100
+ " #{@disbursement_mode.inspect}, payee_receivable_fx_rate_id:"\
101
+ " #{@payee_receivable_fx_rate_id.inspect}>"
102
+ end
88
103
  end
89
104
  end
@@ -104,5 +104,22 @@ module PaypalServerSdk
104
104
  payment_instruction: payment_instruction,
105
105
  soft_descriptor: soft_descriptor)
106
106
  end
107
+
108
+ # Provides a human-readable string representation of the object.
109
+ def to_s
110
+ class_name = self.class.name.split('::').last
111
+ "<#{class_name} invoice_id: #{@invoice_id}, note_to_payer: #{@note_to_payer}, amount:"\
112
+ " #{@amount}, final_capture: #{@final_capture}, payment_instruction:"\
113
+ " #{@payment_instruction}, soft_descriptor: #{@soft_descriptor}>"
114
+ end
115
+
116
+ # Provides a debugging-friendly string with detailed object information.
117
+ def inspect
118
+ class_name = self.class.name.split('::').last
119
+ "<#{class_name} invoice_id: #{@invoice_id.inspect}, note_to_payer:"\
120
+ " #{@note_to_payer.inspect}, amount: #{@amount.inspect}, final_capture:"\
121
+ " #{@final_capture.inspect}, payment_instruction: #{@payment_instruction.inspect},"\
122
+ " soft_descriptor: #{@soft_descriptor.inspect}>"
123
+ end
107
124
  end
108
125
  end
@@ -7,22 +7,26 @@ module PaypalServerSdk
7
7
  # The status of the captured payment.
8
8
  class CaptureStatus
9
9
  CAPTURE_STATUS = [
10
- # TODO: Write general description for COMPLETED
10
+ # The funds for this captured payment were credited to the payee's PayPal
11
+ # account.
11
12
  COMPLETED = 'COMPLETED'.freeze,
12
13
 
13
- # TODO: Write general description for DECLINED
14
+ # The funds could not be captured.
14
15
  DECLINED = 'DECLINED'.freeze,
15
16
 
16
- # TODO: Write general description for PARTIALLY_REFUNDED
17
+ # An amount less than this captured payment's amount was partially
18
+ # refunded to the payer.
17
19
  PARTIALLY_REFUNDED = 'PARTIALLY_REFUNDED'.freeze,
18
20
 
19
- # TODO: Write general description for PENDING
21
+ # The funds for this captured payment was not yet credited to the payee's
22
+ # PayPal account. For more information, see status.details.
20
23
  PENDING = 'PENDING'.freeze,
21
24
 
22
- # TODO: Write general description for REFUNDED
25
+ # An amount greater than or equal to this captured payment's amount was
26
+ # refunded to the payer.
23
27
  REFUNDED = 'REFUNDED'.freeze,
24
28
 
25
- # TODO: Write general description for FAILED
29
+ # There was an error while capturing payment.
26
30
  FAILED = 'FAILED'.freeze
27
31
  ].freeze
28
32
 
@@ -46,5 +46,17 @@ module PaypalServerSdk
46
46
  # Create object from extracted values.
47
47
  CaptureStatusDetails.new(reason: reason)
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} reason: #{@reason}>"
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} reason: #{@reason.inspect}>"
60
+ end
49
61
  end
50
62
  end
@@ -56,5 +56,17 @@ module PaypalServerSdk
56
56
  CaptureStatusWithDetails.new(status: status,
57
57
  status_details: status_details)
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} status: #{@status}, status_details: #{@status_details}>"
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} status: #{@status.inspect}, status_details: #{@status_details.inspect}>"
70
+ end
59
71
  end
60
72
  end