paypal-sdk-rest 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 455e36539241e57e39d8cd01efd98562bad29546
4
- data.tar.gz: 3aa9e1ccc2d597f2ee2bf3ae7c5758b5ba7ae95d
3
+ metadata.gz: e759a6fc42d56bd24b8e8467472c8fd4e323121d
4
+ data.tar.gz: 68343766a40d693a959a0b6291efa662077d6426
5
5
  SHA512:
6
- metadata.gz: b3627f5058ee499a3f6049c712866aa5b097b817485b3a15929247243b51cf8b8876b77594985207a478395f303e3a413f6fce68b3ed660f17e56e3f7c761514
7
- data.tar.gz: f5eebcc4a68640dbf1609cb7f99ae626c6aa5aec91d28e173f6639b0b2a90245df85daa39f2d8f2816b2dfa316fdeec3f64a396d86e23311db302d8111197851
6
+ metadata.gz: 08a94b1a3afa4574868b984f474102233cae7760703eb1faafc8170a8dc598e2123aa6437474a7e49dd6a1b856c67baea7b06a41305e1a6737bd8932986d96a1
7
+ data.tar.gz: e139b81398da7712b2dd4e29047344c45a2953a223059435131ced027cec72d052c4eaf37091ba4bd24441950a63f87185a4f039c1cee83daf19959b3326c84a
@@ -96,6 +96,7 @@ module PayPal::SDK
96
96
 
97
97
  def self.load_members
98
98
  object_of :payment_method, String
99
+ object_of :status, String
99
100
  array_of :funding_instruments, FundingInstrument
100
101
  object_of :payer_info, PayerInfo
101
102
  end
@@ -124,6 +125,8 @@ module PayPal::SDK
124
125
  object_of :payer_id, String
125
126
  object_of :state, String
126
127
  object_of :valid_until, String
128
+ object_of :create_time, String
129
+ object_of :update_time, String
127
130
  array_of :links, Links
128
131
  end
129
132
 
@@ -169,6 +172,7 @@ module PayPal::SDK
169
172
  class Address < Base
170
173
 
171
174
  def self.load_members
175
+ object_of :recipient_name, String
172
176
  object_of :line1, String
173
177
  object_of :line2, String
174
178
  object_of :city, String
@@ -233,6 +237,9 @@ module PayPal::SDK
233
237
  object_of :amount, Amount
234
238
  object_of :payee, Payee
235
239
  object_of :description, String
240
+ object_of :invoice_number, String
241
+ object_of :custom, String
242
+ object_of :soft_descriptor, String
236
243
  object_of :item_list, ItemList
237
244
  array_of :related_resources, RelatedResources
238
245
  array_of :transactions, Transaction
@@ -327,6 +334,9 @@ module PayPal::SDK
327
334
  object_of :amount, Amount
328
335
  object_of :state, String
329
336
  object_of :parent_payment, String
337
+ object_of :payment_mode, String
338
+ object_of :protection_eligibility, String
339
+ object_of :protection_eligibility_type, String
330
340
  array_of :links, Links
331
341
  end
332
342
 
@@ -898,13 +908,224 @@ module PayPal::SDK
898
908
  if correlation_id != nil
899
909
  header = http_header
900
910
  header = header.merge({
901
- "Paypal-Application-Correlation-Id" => correlation_id})
911
+ "PAYPAL-CLIENT-METADATA-ID" => correlation_id})
912
+ end
913
+ response = api.post(path, self.to_hash, http_header)
914
+ self.merge!(response)
915
+ success?
916
+ end
917
+
918
+ end
919
+ class Plan < Base
920
+
921
+ def self.load_members
922
+ array_of :links, Links
923
+ array_of :payment_definitions, PaymentDefinition
924
+ array_of :terms, Terms
925
+ object_of :create_time, String
926
+ object_of :description, String
927
+ object_of :id, String
928
+ object_of :merchant_preferences, MerchantPreferences
929
+ object_of :name, String
930
+ object_of :payee, Payee
931
+ object_of :state, String
932
+ object_of :type, String
933
+ object_of :update_time, String
934
+ end
935
+
936
+ include RequestDataType
937
+
938
+ def create()
939
+ path = "v1/payments/billing-plans"
940
+ response = api.post(path, self.to_hash, http_header)
941
+ self.merge!(response)
942
+ success?
943
+ end
944
+
945
+ class << self
946
+ def find(resource_id)
947
+ raise ArgumentError.new("id required") if resource_id.to_s.strip.empty?
948
+ path = "v1/payments/billing-plans/#{resource_id}"
949
+ self.new(api.get(path))
902
950
  end
951
+ end
952
+
953
+ def update(value)
954
+ path = "v1/payments/billing-plans/#{self.id}"
955
+ params = [{
956
+ "path" => "/",
957
+ "value" => value,
958
+ "op" => "replace"
959
+ }]
960
+ response = api.patch(path, params, http_header)
961
+ success?
962
+ end
963
+
964
+ class << self
965
+ def all(options = {})
966
+ path = "v1/payments/billing-plans"
967
+ PlanHistory.new(api.get(path, options))
968
+ end
969
+ end
970
+
971
+ end
972
+ class PlanHistory < Base
973
+
974
+ def self.load_members
975
+ array_of :plans, Plan
976
+ array_of :links, Links
977
+ end
978
+
979
+ end
980
+ class PaymentDefinition < Base
981
+
982
+ def self.load_members
983
+ object_of :id, String
984
+ object_of :name, String
985
+ object_of :type, String
986
+ object_of :frequency_interval, String
987
+ object_of :frequency, String
988
+ object_of :cycles, String
989
+ object_of :amount, Currency
990
+ array_of :charge_models, ChargeModels
991
+ end
992
+
993
+ end
994
+ class ChargeModels < Base
995
+
996
+ def self.load_members
997
+ object_of :id, String
998
+ object_of :type, String
999
+ object_of :amount, Currency
1000
+ end
1001
+
1002
+ end
1003
+ class MerchantPreferences < Base
1004
+
1005
+ def self.load_members
1006
+ object_of :id, String
1007
+ object_of :setup_fee, Currency
1008
+ object_of :cancel_url, String
1009
+ object_of :return_url, String
1010
+ object_of :notify_url, String
1011
+ object_of :max_fail_attempts, String
1012
+ object_of :auto_bill_amount, String
1013
+ object_of :initial_fail_amount_action, String
1014
+ object_of :accepted_payment_type, String
1015
+ object_of :char_set, String
1016
+ end
1017
+
1018
+ end
1019
+ class Terms < Base
1020
+
1021
+ def self.load_members
1022
+ object_of :id, String
1023
+ object_of :type, String
1024
+ object_of :max_billing_amount, Currency
1025
+ object_of :occurrences, String
1026
+ object_of :amount_range, Currency
1027
+ object_of :buyer_editable, String
1028
+ end
1029
+
1030
+ end
1031
+ class Agreement < Base
1032
+
1033
+ def self.load_members
1034
+ object_of :id, String
1035
+ object_of :name, String
1036
+ object_of :state, String
1037
+ object_of :description, String
1038
+ object_of :start_date, String
1039
+ object_of :payer, Payer
1040
+ object_of :shipping_address, Address
1041
+ object_of :override_merchant_preferences, MerchantPreferences
1042
+ array_of :override_charge_models, OverrideChargeModel
1043
+ object_of :plan, Plan
1044
+ object_of :create_time, String
1045
+ object_of :update_time, String
1046
+ array_of :links, Links
1047
+ object_of :agreement_details, AgreementDetails
1048
+ end
1049
+
1050
+ include RequestDataType
1051
+
1052
+ def create()
1053
+ path = "v1/payments/billing-agreements"
903
1054
  response = api.post(path, self.to_hash, http_header)
904
1055
  self.merge!(response)
905
1056
  success?
906
1057
  end
907
1058
 
1059
+ class << self
1060
+ def find(resource_id)
1061
+ raise ArgumentError.new("id required") if resource_id.to_s.strip.empty?
1062
+ path = "v1/payments/billing-agreements/#{resource_id}"
1063
+ self.new(api.get(path))
1064
+ end
1065
+ end
1066
+
1067
+ class << self
1068
+ def execute(token)
1069
+ raise ArgumentError.new("token required") if token.to_s.strip.empty?
1070
+ path = "v1/payments/billing-agreements/#{token}/agreement-execute"
1071
+ response = api.post(path)
1072
+ self.new(response)
1073
+ end
1074
+ end
1075
+
1076
+ def suspend(note)
1077
+ note = Note.new(note) unless note.is_a? Note
1078
+ path = "v1/payments/billing-agreements/#{self.id}/suspend"
1079
+ response = api.post(path, note.to_hash, http_header)
1080
+ self.merge!(response)
1081
+ success?
1082
+ end
1083
+
1084
+ def reactivate(note)
1085
+ note = Note.new(note) unless note.is_a? Note
1086
+ path = "v1/payments/billing-agreements/#{self.id}/re-activate"
1087
+ response = api.post(path, note.to_hash, http_header)
1088
+ self.merge!(response)
1089
+ success?
1090
+ end
1091
+
1092
+ def cancel(note)
1093
+ note = Note.new(note) unless note.is_a? Note
1094
+ path = "v1/payments/billing-agreements/#{self.id}/cancel"
1095
+ response = api.post(path, note.to_hash, http_header)
1096
+ self.merge!(response)
1097
+ success?
1098
+ end
1099
+
1100
+ end
1101
+ class AgreementDetails < Base
1102
+
1103
+ def self.load_members
1104
+ object_of :outstanding_balance, Currency
1105
+ object_of :cycles_remaining, String
1106
+ object_of :cycles_completed, String
1107
+ object_of :final_payment_date, DateTime
1108
+ object_of :failed_payment_count, String
1109
+ object_of :next_billing_date, DateTime
1110
+ object_of :last_payment_date, DateTime
1111
+ object_of :last_payment_amount, Currency
1112
+ end
1113
+
1114
+ end
1115
+ class Note < Base
1116
+
1117
+ def self.load_members
1118
+ object_of :note, String
1119
+ end
1120
+
1121
+ end
1122
+ class OverrideChargeModel < Base
1123
+
1124
+ def self.load_members
1125
+ object_of :charge_id, String
1126
+ object_of :amount, Currency
1127
+ end
1128
+
908
1129
  end
909
1130
 
910
1131
  constants.each do |data_type_klass|
@@ -1,7 +1,7 @@
1
1
  module PayPal
2
2
  module SDK
3
3
  module REST
4
- VERSION = "0.7.2"
4
+ VERSION = "0.7.3"
5
5
  end
6
6
  end
7
7
  end
data/spec/log/http.log CHANGED
@@ -1,67 +0,0 @@
1
- opening connection to api.sandbox.paypal.com:443...
2
- opened
3
- starting SSL for api.sandbox.paypal.com:443...
4
- SSL established
5
- <- "POST /v1/invoicing/invoices HTTP/1.1\r\nAuthorization: Bearer A015XXNLKck4zlIZMkjai9eHsWctQBnPn.gT3pfUTZ-A2p4\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 0.7.2 (paypal-sdk-core 0.3.1; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: b26f2b35-53d4-4158-9b87-2c86adae7ff3\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\nContent-Length: 243\r\n\r\n"
6
- <- "{\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"items\":[{\"name\":\"Sutures\",\"quantity\":100.0,\"unit_price\":{\"currency\":\"USD\",\"value\":\"5\"}}],\"note\":\"Medical Invoice 16 Jul, 2013 PST\"}"
7
- -> "HTTP/1.1 201 Created\r\n"
8
- -> "Server: Apache-Coyote/1.1\r\n"
9
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=2876\r\n"
10
- -> "Paypal-Debug-Id: ae9f0be924930\r\n"
11
- -> "Date: Mon, 20 Oct 2014 16:25:48 GMT\r\n"
12
- -> "Location: https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-8EPA-K2PE-XXHL-UKSX\r\n"
13
- -> "Content-Type: application/json\r\n"
14
- -> "Content-Length: 510\r\n"
15
- -> "\r\n"
16
- reading 510 bytes...
17
- -> "{\"id\":\"INV2-8EPA-K2PE-XXHL-UKSX\",\"number\":\"2456\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"items\":[{\"name\":\"Sutures\",\"quantity\":100.0,\"unit_price\":{\"currency\":\"USD\",\"value\":\"5.00\"}}],\"invoice_date\":\"2014-10-20 PDT\",\"discount\":{\"amount\":{\"currency\":\"USD\",\"value\":\"0.00\"}},\"tax_calculated_after_discount\":false,\"tax_inclusive\":false,\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"}}"
18
- read 510 bytes
19
- Conn keep-alive
20
- opening connection to api.sandbox.paypal.com:443...
21
- opened
22
- starting SSL for api.sandbox.paypal.com:443...
23
- SSL established
24
- <- "GET /v1/invoicing/invoices/?total_count_required=true HTTP/1.1\r\nAuthorization: Bearer A015XXNLKck4zlIZMkjai9eHsWctQBnPn.gT3pfUTZ-A2p4\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 0.7.2 (paypal-sdk-core 0.3.1; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
25
- -> "HTTP/1.1 200 OK\r\n"
26
- -> "Server: Apache-Coyote/1.1\r\n"
27
- -> "PROXY_SERVER_INFO: host=slcsbjava2.slc.paypal.com;threadId=239\r\n"
28
- -> "Paypal-Debug-Id: a59b4e352eecb\r\n"
29
- -> "Date: Mon, 20 Oct 2014 16:25:50 GMT\r\n"
30
- -> "Content-Type: application/json\r\n"
31
- -> "Transfer-Encoding: chunked\r\n"
32
- -> "\r\n"
33
- -> "2000\r\n"
34
- reading 8192 bytes...
35
- -> "{\"total_count\":2445,\"invoices\":[{\"id\":\"INV2-8EPA-K2PE-XXHL-UKSX\",\"number\":\"2456\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\"},\"invoice_date\":\"2014-10-20 PDT\",\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-20 09:25:48 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-8EPA-K2PE-XXHL-UKSX\"}},{\"id\":\"INV2-5HG5-JTGH-8F6P-4D7P\",\"number\":\"2455\",\"status\":\"SENT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-19 PDT\",\"payment_term\":{\"due_date\":\"2014-12-03 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-19 20:32:07 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-5HG5-JTGH-8F6P-4D7P\"}},{\"id\":\"INV2-SAQ8-CBPR-PH9E-JSYV\",\"number\":\"2454\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-19 PDT\",\"payment_term\":{\"due_date\":\"2014-12-03 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-19 08:47:32 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-SAQ8-CBPR-PH9E-JSYV\"}},{\"id\":\"INV2-Z4PA-EYHZ-D86T-YJDV\",\"number\":\"2453\",\"status\":\"SENT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-17 PDT\",\"payment_term\":{\"due_date\":\"2014-12-01 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-17 01:58:39 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-Z4PA-EYHZ-D86T-YJDV\"}},{\"id\":\"INV2-22Y4-3KUP-9B5D-XMD5\",\"number\":\"2452\",\"status\":\"MARKED_AS_PAID\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-16 PDT\",\"payment_term\":{\"due_date\":\"2014-11-30 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-16 06:19:48 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-22Y4-3KUP-9B5D-XMD5\"}},{\"id\":\"INV2-M6GA-L6BH-ZDSU-K8UQ\",\"number\":\"2451\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\"},\"invoice_date\":\"2014-10-15 PDT\",\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-15 19:03:20 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-M6GA-L6BH-ZDSU-K8UQ\"}},{\"id\":\"INV2-225R-283C-Z4MV-BDLW\",\"number\":\"2450\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\"},\"invoice_date\":\"2014-10-15 PDT\",\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-15 18:46:56 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-225R-283C-Z4MV-BDLW\"}},{\"id\":\"INV2-U3LF-A7NH-JB65-BMM8\",\"number\":\"2449\",\"status\":\"SENT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-15 PDT\",\"payment_term\":{\"due_date\":\"2014-11-29 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-15 07:58:59 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-U3LF-A7NH-JB65-BMM8\"}},{\"id\":\"INV2-LZ4R-PVSS-RVQ9-JCFF\",\"number\":\"2448\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-14 PDT\",\"payment_term\":{\"due_date\":\"2014-11-28 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-14 15:17:52 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-LZ4R-PVSS-RVQ9-JCFF\"}},{\"id\":\"INV2-GAT6-YG44-8RL3-DF5X\",\"number\":\"2447\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-14 PDT\",\"payment_term\":{\"due_date\":\"2014-11-28 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-14 08:17:02 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-GAT6-YG44-8RL3-DF5X\"}},{\"id\":\"INV2-EK4B-4UYV-ETJX-44F2\",\"number\":\"2446\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-14 PDT\",\"payment_term\":{\"due_date\":\"2014-11-28 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-14 01:10:37 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-EK4B-4UYV-ETJX-44F2\"}},{\"id\":\"INV2-THJC-H5ES-WXWB-8T2Z\",\"number\":\"2445\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-14 PDT\",\"payment_term\":{\"due_date\":\"2014-11-28 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-14 00:24:08 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-THJC-H5ES-WXWB-8T2Z\"}},{\"id\":\"INV2-JHD9-HQ7G-6FHL-MZ32\",\"number\":\"2444\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-13 PDT\",\"payment_term\":{\"due_date\":\"2014-11-27 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-13 22:05:13 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-JHD9-HQ7G-6FHL-MZ32\"}},{\"id\":\"INV2-ZJRQ-KMMA-FFPR-WWL9\",\"number\":\"2443\",\"status\":\"MARKED_AS_PAID\",\"merchant_info\":{\""
36
- read 8192 bytes
37
- reading 2 bytes...
38
- -> "\r\n"
39
- read 2 bytes
40
- -> "1189\r\n"
41
- reading 4489 bytes...
42
- -> "email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-13 PDT\",\"payment_term\":{\"due_date\":\"2014-11-27 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-13 15:52:04 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-ZJRQ-KMMA-FFPR"
43
- -> "-WWL9\"}},{\"id\":\"INV2-M8U3-F77F-FZ89-M4MP\",\"number\":\"2442\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-13 PDT\",\"payment_term\":{\"due_date\":\"2014-11-27 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-13 14:38:33 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-M8U3-F77F-FZ89-M4MP\"}},{\"id\":\"INV2-BMRE-KDF5-32TR-VJ7E\",\"number\":\"2441\",\"status\":\"MARKED_AS_PAID\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-13 PDT\",\"payment_term\":{\"due_date\":\"2014-11-27 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-13 09:41:41 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-BMRE-KDF5-32TR-VJ7E\"}},{\"id\":\"INV2-K3T2-5E76-AUSG-HV77\",\"number\":\"2440\",\"status\":\"MARKED_AS_PAID\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-13 PDT\",\"payment_term\":{\"due_date\":\"2014-11-27 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-13 09:41:26 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-K3T2-5E76-AUSG-HV77\"}},{\"id\":\"INV2-23FK-KQ4Q-2DUR-AHKK\",\"number\":\"2439\",\"status\":\"MARKED_AS_PAID\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-13 PDT\",\"payment_term\":{\"due_date\":\"2014-11-27 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-13 09:41:06 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-23FK-KQ4Q-2DUR-AHKK\"}},{\"id\":\"INV2-3D7X-UB9T-JZRW-XPBA\",\"number\":\"2438\",\"status\":\"DRAFT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-13 PDT\",\"payment_term\":{\"due_date\":\"2014-11-27 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-13 09:04:03 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-3D7X-UB9T-JZRW-XPBA\"}},{\"id\":\"INV2-FTCU-HTLQ-JCRB-7RJF\",\"number\":\"2437\",\"status\":\"MARKED_AS_PAID\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\"},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"email\":\"example@example.com\",\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\"},\"invoice_date\":\"2014-10-10 PDT\",\"payment_term\":{\"due_date\":\"2014-11-24 PST\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-10-10 12:42:10 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-FTCU-HTLQ-JCRB-7RJF\"}}]}"
44
- read 4489 bytes
45
- reading 2 bytes...
46
- -> "\r\n"
47
- read 2 bytes
48
- -> "0\r\n"
49
- -> "\r\n"
50
- Conn keep-alive
51
- opening connection to api.sandbox.paypal.com:443...
52
- opened
53
- starting SSL for api.sandbox.paypal.com:443...
54
- SSL established
55
- <- "GET /v1/invoicing/invoices/INV2-P6VJ-36HG-BBVT-M2MA HTTP/1.1\r\nAuthorization: Bearer A015XXNLKck4zlIZMkjai9eHsWctQBnPn.gT3pfUTZ-A2p4\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 0.7.2 (paypal-sdk-core 0.3.1; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
56
- -> "HTTP/1.1 200 OK\r\n"
57
- -> "Server: Apache-Coyote/1.1\r\n"
58
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=12898\r\n"
59
- -> "Paypal-Debug-Id: b4db79ee3a984\r\n"
60
- -> "Date: Mon, 20 Oct 2014 16:25:51 GMT\r\n"
61
- -> "Content-Type: application/json\r\n"
62
- -> "Content-Length: 1184\r\n"
63
- -> "\r\n"
64
- reading 1184 bytes...
65
- -> "{\"id\":\"INV2-P6VJ-36HG-BBVT-M2MA\",\"number\":\"0001\",\"status\":\"SENT\",\"merchant_info\":{\"email\":\"PPX.DevNet-facilitator@gmail.com\",\"first_name\":\"Dennis\",\"last_name\":\"Doctor\",\"business_name\":\"Medical Professionals, LLC\",\"address\":{\"line1\":\"1234 Main St.\",\"city\":\"Portland\",\"state\":\"OR\",\"postal_code\":\"97217\",\"country_code\":\"US\"}},\"billing_info\":[{\"email\":\"example@example.com\"}],\"shipping_info\":{\"first_name\":\"Sally\",\"last_name\":\"Patient\",\"business_name\":\"Not applicable\",\"address\":{\"line1\":\"1234 Broad St.\",\"city\":\"Portland\",\"state\":\"OR\",\"postal_code\":\"97216\",\"country_code\":\"US\"}},\"items\":[{\"name\":\"Sutures\",\"quantity\":100.0,\"unit_price\":{\"currency\":\"USD\",\"value\":\"5.00\"}}],\"invoice_date\":\"2014-04-03 PDT\",\"payment_term\":{\"term_type\":\"NET_45\",\"due_date\":\"2014-05-18 PDT\"},\"tax_calculated_after_discount\":false,\"tax_inclusive\":false,\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-04-03 22:30:15 PDT\",\"first_sent_date\":\"2014-04-03 22:48:22 PDT\",\"last_sent_date\":\"2014-04-03 22:48:22 PDT\",\"payer_view_url\":\"https://www.sandbox.paypal.com/cgi_bin/webscr?cmd=_pay-inv&viewtype=altview&id=INV2-P6VJ-36HG-BBVT-M2MA\"}}"
66
- read 1184 bytes
67
- Conn keep-alive
@@ -107,7 +107,7 @@ describe "Payments" do
107
107
 
108
108
  it "Create with empty values" do
109
109
  payment = Payment.new
110
- payment.create.should be_false
110
+ expect(payment.create).to be_falsey
111
111
  end
112
112
 
113
113
  it "Find with invalid ID" do
@@ -137,12 +137,12 @@ describe "Payments" do
137
137
  end
138
138
  end
139
139
 
140
- describe "instance method" do
140
+ # describe "instance method" do
141
141
 
142
- it "Execute" do
143
- pending "Test with capybara"
144
- end
145
- end
142
+ # it "Execute" do
143
+ # pending "Test with capybara"
144
+ # end
145
+ # end
146
146
 
147
147
  end
148
148
 
@@ -159,7 +159,7 @@ describe "Payments" do
159
159
  end
160
160
 
161
161
  it "Create a payment" do
162
- # put your Paypal-Application-Correlation-Id
162
+ # put your PAYPAL-CLIENT-METADATA-ID
163
163
  correlation_id = ''
164
164
  @future_payment = FuturePayment.new(FuturePaymentAttributes.merge( :token => access_token ))
165
165
  @future_payment.create(correlation_id)
@@ -277,8 +277,8 @@ describe "Payments" do
277
277
  "type" => "visa",
278
278
  "number" => "4417119669820331",
279
279
  "expire_month" => "11", "expire_year" => "2018" })
280
- credit_card.create.should be_true
281
- credit_card.delete.should be_true
280
+ expect(credit_card.create).to be_truthy
281
+ expect(credit_card.delete).to be_truthy
282
282
  end
283
283
 
284
284
  describe "Validation" do
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: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - PayPal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-20 00:00:00.000000000 Z
11
+ date: 2014-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paypal-sdk-core
@@ -66,7 +66,8 @@ files:
66
66
  - spec/payments_examples_spec.rb
67
67
  - spec/spec_helper.rb
68
68
  homepage: https://developer.paypal.com
69
- licenses: []
69
+ licenses:
70
+ - PayPal SDK License
70
71
  metadata: {}
71
72
  post_install_message:
72
73
  rdoc_options: []