paypal-sdk-rest 1.5.0 → 1.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b3439f7dc0c9f865a7cc7815422c6b9bc81d050
4
- data.tar.gz: bf6283b0d9c0f1fdc37093839b44dba33801324e
3
+ metadata.gz: 07eb29c0bcc2e64cb6021ee41b2a8044c9ea614e
4
+ data.tar.gz: 34af36098b7335cf1f2f7eb5d733bc8e38a5a024
5
5
  SHA512:
6
- metadata.gz: 77823b3d706673505b29aae207be9faf1d2c8a25525a3e2177cd5c6e18eb710bd7c250c39373f2af43e975b9d4b61fd7a9a83ad394ec1edfa5602fff2575bbd9
7
- data.tar.gz: 5f2710b9aa5e78c3785e36ba496b139484cc0367ab83887ed6815fcab67c2cb3877165719ac5467f0e3efdc58fd7ebcb80824841065c90bd62b565a464df0409
6
+ metadata.gz: acbaec588e900bcc9efd6d19dfa455e1402b5cb83c64e6358afb254d452ae472fb2cf1ceb4f42032699d789c41d6c85f8a0137dc31a72f649ea5c28fc0dfd95f
7
+ data.tar.gz: c868cc58f3610e68cf142536500f18736752e598124a7b237307773799a6e280d3a22e8bda0d484d6ea7ee39b04b0abf9168d8ce324495ac4c7440ce2f6e0cd4
@@ -136,7 +136,7 @@ module PayPal::SDK::Core
136
136
  def set(key, value)
137
137
  send("#{key}=", value)
138
138
  rescue NoMethodError => error
139
- logger.warn error.message
139
+ logger.debug error.message
140
140
  rescue TypeError, ArgumentError => error
141
141
  raise TypeError, "#{error.message}(#{value.inspect}) for #{self.class.name}.#{key} member"
142
142
  end
@@ -64,7 +64,9 @@ module PayPal::SDK
64
64
  object_of :payment_instruction, PaymentInstruction
65
65
  object_of :state, String
66
66
  object_of :experience_profile_id, String
67
+ object_of :note_to_payer, String
67
68
  object_of :redirect_urls, RedirectUrls
69
+ object_of :failure_reason, String
68
70
  object_of :create_time, String
69
71
  object_of :update_time, String
70
72
  array_of :links, Links
@@ -168,6 +170,7 @@ module PayPal::SDK
168
170
  class Billing < Base
169
171
  def self.load_members
170
172
  object_of :billing_agreement_id, String
173
+ object_of :selected_installment_option, InstallmentOption
171
174
  end
172
175
 
173
176
  include RequestDataType
@@ -180,13 +183,6 @@ module PayPal::SDK
180
183
  include RequestDataType
181
184
  end
182
185
 
183
- class CarrierAccountToken < Base
184
- def self.load_members
185
- object_of :carrier_account_id, String
186
- object_of :external_customer_id, String
187
- end
188
- end
189
-
190
186
  class CountryCode < Base
191
187
  def self.load_members
192
188
  object_of :country_code, String
@@ -214,6 +210,8 @@ module PayPal::SDK
214
210
  object_of :code, String
215
211
  object_of :funding_account_id, String
216
212
  object_of :display_text, String
213
+ object_of :amount, Currency
214
+ object_of :funding_instruction, String
217
215
  end
218
216
 
219
217
  include RequestDataType
@@ -295,6 +293,7 @@ module PayPal::SDK
295
293
  array_of :funding_instruments, FundingInstrument
296
294
  object_of :funding_option_id, String
297
295
  object_of :funding_option, FundingOption
296
+ object_of :external_selected_funding_instrument_type, String
298
297
  object_of :related_funding_option, FundingOption
299
298
  object_of :payer_info, PayerInfo
300
299
  object_of :billing, Billing
@@ -377,6 +376,7 @@ module PayPal::SDK
377
376
  object_of :phone, String
378
377
  object_of :normalization_status, String
379
378
  object_of :status, String
379
+ object_of :type, String
380
380
  end
381
381
  end
382
382
 
@@ -413,6 +413,7 @@ module PayPal::SDK
413
413
  object_of :billing_address, Address
414
414
  object_of :external_customer_id, String
415
415
  object_of :status, String
416
+ object_of :card_product_class, String
416
417
  object_of :valid_until, String
417
418
  object_of :issue_number, String
418
419
  end
@@ -545,7 +546,9 @@ module PayPal::SDK
545
546
  object_of :funding_instrument_type, String
546
547
  object_of :soft_descriptor, String
547
548
  object_of :amount, Currency
549
+ object_of :negative_balance_amount, Currency
548
550
  object_of :legal_text, String
551
+ object_of :terms, String
549
552
  object_of :funding_detail, FundingDetail
550
553
  object_of :additional_text, String
551
554
  object_of :extends, FundingInstrument
@@ -721,13 +724,13 @@ module PayPal::SDK
721
724
 
722
725
  class Item < Base
723
726
  def self.load_members
724
- object_of :quantity, String
727
+ object_of :sku, String
725
728
  object_of :name, String
726
729
  object_of :description, String
730
+ object_of :quantity, String
727
731
  object_of :price, String
728
- object_of :tax, String
729
732
  object_of :currency, String
730
- object_of :sku, String
733
+ object_of :tax, String
731
734
  object_of :url, String
732
735
  object_of :category, String
733
736
  object_of :weight, Measurement
@@ -764,9 +767,9 @@ module PayPal::SDK
764
767
 
765
768
  class RelatedResources < Base
766
769
  def self.load_members
767
- object_of :order, Order
768
770
  object_of :sale, Sale
769
771
  object_of :authorization, Authorization
772
+ object_of :order, Order
770
773
  object_of :capture, Capture
771
774
  object_of :refund, Refund
772
775
  end
@@ -784,6 +787,7 @@ module PayPal::SDK
784
787
  object_of :protection_eligibility_type, String
785
788
  object_of :clearing_time, String
786
789
  object_of :recipient_fund_status, String
790
+ object_of :payment_hold_status, String
787
791
  object_of :hold_reason, String
788
792
  object_of :transaction_fee, Currency
789
793
  object_of :receivable_amount, Currency
@@ -794,7 +798,6 @@ module PayPal::SDK
794
798
  object_of :create_time, String
795
799
  object_of :update_time, String
796
800
  array_of :links, Links
797
- object_of :processor_response, ProcessorResponse
798
801
  object_of :billing_agreement_id, String
799
802
  object_of :payment_hold_reasons, String
800
803
  object_of :processor_response, ProcessorResponse
@@ -816,6 +819,14 @@ module PayPal::SDK
816
819
  response = api.post(path, refund.to_hash, http_header)
817
820
  Refund.new(response)
818
821
  end
822
+
823
+ def refund_request(refund_request)
824
+ refund_request = RefundRequest.new(refund_request) unless refund_request.is_a? RefundRequest
825
+ path = "v1/payments/sale/#{self.id}/refund"
826
+ response = api.post(path, refund_request.to_hash, http_header)
827
+ DetailedRefund.new(response)
828
+ end
829
+
819
830
  end
820
831
 
821
832
  class AnyOf < Base
@@ -838,6 +849,8 @@ module PayPal::SDK
838
849
  object_of :valid_until, String
839
850
  object_of :create_time, String
840
851
  object_of :update_time, String
852
+ object_of :reference_id, String
853
+ object_of :receipt_id, String
841
854
  array_of :links, Links
842
855
  end
843
856
 
@@ -878,7 +891,8 @@ module PayPal::SDK
878
891
  class Order < Base
879
892
  def self.load_members
880
893
  object_of :id, String
881
- object_of :purchase_unit_reference_id, String
894
+ object_of :purchase_unit_reference_id, String # Deprecated - use :reference_id instead
895
+ object_of :reference_id, String
882
896
  object_of :amount, Amount
883
897
  object_of :payment_mode, String
884
898
  object_of :state, String
@@ -932,11 +946,12 @@ module PayPal::SDK
932
946
  object_of :amount, Amount
933
947
  object_of :is_final_capture, Boolean
934
948
  object_of :state, String
949
+ object_of :reason_code, String
935
950
  object_of :parent_payment, String
951
+ object_of :invoice_number, String
936
952
  object_of :transaction_fee, Currency
937
953
  object_of :create_time, String
938
954
  object_of :update_time, String
939
- object_of :invoice_number, String
940
955
  array_of :links, Links
941
956
  end
942
957
 
@@ -950,12 +965,20 @@ module PayPal::SDK
950
965
  end
951
966
  end
952
967
 
968
+ # Deprecated - please use refund_request
953
969
  def refund(refund)
954
970
  refund = Refund.new(refund) unless refund.is_a? Refund
955
971
  path = "v1/payments/capture/#{self.id}/refund"
956
972
  response = api.post(path, refund.to_hash, http_header)
957
973
  Refund.new(response)
958
974
  end
975
+
976
+ def refund_request(refund_request)
977
+ refund_request = RefundRequest.new(refund_request) unless refund_request.is_a? RefundRequest
978
+ path = "v1/payments/capture/#{self.id}/refund"
979
+ response = api.post(path, refund_request.to_hash, http_header)
980
+ DetailedRefund.new(response)
981
+ end
959
982
  end
960
983
 
961
984
  class Refund < Base
@@ -964,12 +987,14 @@ module PayPal::SDK
964
987
  object_of :amount, Amount
965
988
  object_of :state, String
966
989
  object_of :reason, String
990
+ object_of :invoice_number, String
967
991
  object_of :sale_id, String
968
992
  object_of :capture_id, String
969
993
  object_of :parent_payment, String
970
994
  object_of :description, String
971
995
  object_of :create_time, String
972
996
  object_of :update_time, String
997
+ object_of :reason_code, String
973
998
  array_of :links, Links
974
999
  end
975
1000
 
@@ -984,6 +1009,31 @@ module PayPal::SDK
984
1009
  end
985
1010
  end
986
1011
 
1012
+ class RefundRequest < Base
1013
+ def self.load_members
1014
+ object_of :amount, Amount
1015
+ object_of :description, String
1016
+ object_of :refund_type, String
1017
+ object_of :refund_source, String
1018
+ object_of :reason, String
1019
+ object_of :invoice_number, String
1020
+ object_of :refund_advice, Boolean
1021
+ object_of :is_non_platform_transaction, String
1022
+ end
1023
+ end
1024
+
1025
+ class DetailedRefund < Refund
1026
+ def self.load_members
1027
+ object_of :custom, String
1028
+ object_of :invoice_number, String
1029
+ object_of :refund_to_payer, Currency
1030
+ array_of :refund_to_external_funding, ExternalFunding
1031
+ object_of :refund_from_transaction_fee, Currency
1032
+ object_of :refund_from_received_amount, Currency
1033
+ object_of :total_refunded_amount, Currency
1034
+ end
1035
+ end
1036
+
987
1037
  class Error < Base
988
1038
  def self.load_members
989
1039
  object_of :name, String
@@ -1055,14 +1105,14 @@ module PayPal::SDK
1055
1105
 
1056
1106
  class Patch < Base
1057
1107
  def self.load_members
1058
- object_of :op, String
1059
- object_of :path, String
1060
- object_of :value, Object
1061
- object_of :from, String
1108
+ object_of :op, String
1109
+ object_of :path, String
1110
+ object_of :value, Object
1111
+ object_of :from, String
1062
1112
  end
1063
1113
  end
1064
- class PatchRequest < Base
1065
1114
 
1115
+ class PatchRequest < Base
1066
1116
  def self.load_members
1067
1117
  object_of :op, String
1068
1118
  object_of :path, String
@@ -1074,8 +1124,8 @@ module PayPal::SDK
1074
1124
  class PaymentExecution < Base
1075
1125
  def self.load_members
1076
1126
  object_of :payer_id, String
1077
- array_of :transactions, CartBase
1078
1127
  object_of :carrier_account_id, String
1128
+ array_of :transactions, CartBase
1079
1129
  end
1080
1130
  end
1081
1131
 
@@ -1,7 +1,7 @@
1
1
  module PayPal
2
2
  module SDK
3
3
  module REST
4
- VERSION = "1.5.0"
4
+ VERSION = "1.6.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypal-sdk-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PayPal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-19 00:00:00.000000000 Z
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  requirements: []
151
151
  rubyforge_project:
152
- rubygems_version: 2.5.1
152
+ rubygems_version: 2.6.7
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: The PayPal REST SDK provides Ruby APIs to create, process and manage payment.