paypal-sdk-rest 0.6.1 → 0.7.0

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: 7c61ab8f4993fe76ff89a4d8f3c17d55ad5297eb
4
- data.tar.gz: d642dbb0b0af4d058541fc3aa59a4225392394fc
3
+ metadata.gz: 7a0c3c41b85405bed68ea25125bb269beae7b8fd
4
+ data.tar.gz: 8e203b322aeb57993fc2c99fffa10551b530a225
5
5
  SHA512:
6
- metadata.gz: b44a9418edc862eb7727063a561f319b838d7e9b51d172ce9596552c4431e3942d57087691fa2d743925067becf8555e775529074e776759abbd9c30fa6ce912
7
- data.tar.gz: 48c636eff51da37d96622d51425f9410132216fa1b25e37997571b1c4df3fec15d3fa136a6da2ce42dfc117e5c4f607041ac5fe1976204d934343c54d9cc5ccc
6
+ metadata.gz: 637e1f6d6e52ffbaea626ea353e95d8f4150e4d08d131545b28f947bd609de7d7826708038b30fe2e14dd5513f3c398762257dfa5f81f53ccc2cfe7a766d5b0a
7
+ data.tar.gz: e64e2061bd24461429d872614c45a37db8dc75d521d34de20508e9b4106a23ea2461901e31406adecf4b149891f7839dc52e09c9d3d8e67e0a08b2cf7702cb73
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # REST SDK
2
2
 
3
3
  The PayPal REST SDK provides Ruby APIs to create, process and manage payment.
4
+ > **Before starting to use the sdk, please be aware of the [existing issues and currently available or upcoming features](https://github.com/paypal/rest-api-sdk-python/wiki/Existing-Issues-and-Unavailable%5CUpcoming-features) for the REST APIs. (which the sdks are based on)**
4
5
 
5
6
  ## Installation
6
7
 
@@ -866,6 +866,28 @@ module PayPal::SDK
866
866
  object_of :send_to_payer, Boolean
867
867
  end
868
868
 
869
+ end
870
+ class FuturePayment < Payment
871
+
872
+ def self.exch_token(auth_code)
873
+ if auth_code
874
+ token = PayPal::SDK::Core::API::REST.new.token(auth_code)
875
+ token
876
+ end
877
+ end
878
+
879
+ def create(correlation_id=nil)
880
+ path = "v1/payments/payment"
881
+ if correlation_id != nil
882
+ header = http_header
883
+ header = header.merge({
884
+ "Paypal-Application-Correlation-Id" => correlation_id})
885
+ end
886
+ response = api.post(path, self.to_hash, http_header)
887
+ self.merge!(response)
888
+ success?
889
+ end
890
+
869
891
  end
870
892
 
871
893
  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.6.1"
4
+ VERSION = "0.7.0"
5
5
  end
6
6
  end
7
7
  end
data/spec/log/http.log CHANGED
@@ -2,70 +2,71 @@ opening connection to api.sandbox.paypal.com:443...
2
2
  opened
3
3
  starting SSL for api.sandbox.paypal.com:443...
4
4
  SSL established
5
- <- "POST /v1/invoicing/invoices HTTP/1.1\r\nAuthorization: Bearer 2.RUg7qbhqxLBDae7Si-exTRs8ztl0Tv1FWMAnd0XVo\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 0.6.1 (paypal-sdk-core 0.2.8; ruby 2.1.1p76-x86_64-darwin12.0)\r\nPaypal-Request-Id: 3f420816-6ba8-4831-be95-6337e8eeb209\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"
5
+ <- "POST /v1/invoicing/invoices HTTP/1.1\r\nAuthorization: Bearer A015.wU5Y.5Tt1X0UhVBpUcFySaug5JAAGqJxoEZGs1SFgI\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 0.6.1 (paypal-sdk-core 0.2.10; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: e2e7316e-f41a-41fb-a9f7-ac152360c219\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
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"
7
+ -> "HTTP/1.1 401 Unauthorized\r\n"
8
8
  -> "Server: Apache-Coyote/1.1\r\n"
9
- -> "PROXY_SERVER_INFO: host=slcsbjava2.slc.paypal.com;threadId=331\r\n"
10
- -> "Paypal-Debug-Id: 31e03665acd13\r\n"
11
- -> "Date: Fri, 04 Apr 2014 09:03:36 GMT\r\n"
12
- -> "Location: https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-QZ3V-GKZS-MJNP-HGBQ\r\n"
9
+ -> "PROXY_SERVER_INFO: host=slcsbjava3.slc.paypal.com;threadId=146798\r\n"
10
+ -> "Paypal-Debug-Id: 7bddeee2e6a9d\r\n"
11
+ -> "Date: Tue, 01 Jul 2014 15:14:23 GMT\r\n"
12
+ -> "WWW-Authenticate: OAuth\r\n"
13
13
  -> "Content-Type: application/json\r\n"
14
- -> "Transfer-Encoding: chunked\r\n"
15
- -> "\r\n"
16
- -> "1c6\r\n"
17
- reading 454 bytes...
18
- -> "{\"id\":\"INV2-QZ3V-GKZS-MJNP-HGBQ\",\"number\":\"0008\",\"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-04-04 PDT\",\"tax_calculated_after_discount\":false,\"tax_inclusive\":false,\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"}}"
19
- read 454 bytes
20
- reading 2 bytes...
21
- -> "\r\n"
22
- read 2 bytes
23
- -> "0\r\n"
14
+ -> "Content-Length: 99\r\n"
24
15
  -> "\r\n"
16
+ reading 99 bytes...
17
+ -> "{\"name\":\"AUTHORIZATION_ERROR\",\"message\":\"Authorization error occurred.\",\"debug_id\":\"7bddeee2e6a9d\"}"
18
+ read 99 bytes
25
19
  Conn keep-alive
26
20
  opening connection to api.sandbox.paypal.com:443...
27
21
  opened
28
22
  starting SSL for api.sandbox.paypal.com:443...
29
23
  SSL established
30
- <- "GET /v1/invoicing/invoices/?total_count_required=true HTTP/1.1\r\nAuthorization: Bearer 2.RUg7qbhqxLBDae7Si-exTRs8ztl0Tv1FWMAnd0XVo\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 0.6.1 (paypal-sdk-core 0.2.8; ruby 2.1.1p76-x86_64-darwin12.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"
31
- -> "HTTP/1.1 200 OK\r\n"
24
+ <- "POST /v1/invoicing/invoices HTTP/1.1\r\nAuthorization: Bearer A015BQqJiVFfESfOPuywwMxi0xiRrKvXTZb236CJfsS18og\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 0.6.1 (paypal-sdk-core 0.2.10; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: e2e7316e-f41a-41fb-a9f7-ac152360c219\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"
25
+ <- "{\"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\"}"
26
+ -> "HTTP/1.1 401 Unauthorized\r\n"
32
27
  -> "Server: Apache-Coyote/1.1\r\n"
33
- -> "PROXY_SERVER_INFO: host=slcsbjava2.slc.paypal.com;threadId=331\r\n"
34
- -> "Paypal-Debug-Id: 246eb331af4bd\r\n"
35
- -> "Date: Fri, 04 Apr 2014 09:03:38 GMT\r\n"
28
+ -> "PROXY_SERVER_INFO: host=slcsbjava3.slc.paypal.com;threadId=262\r\n"
29
+ -> "Paypal-Debug-Id: d1f9e910e146e\r\n"
30
+ -> "Date: Tue, 01 Jul 2014 15:14:27 GMT\r\n"
31
+ -> "WWW-Authenticate: OAuth\r\n"
36
32
  -> "Content-Type: application/json\r\n"
37
- -> "Transfer-Encoding: chunked\r\n"
38
- -> "\r\n"
39
- -> "f1c\r\n"
40
- reading 3868 bytes...
41
- -> "{\"total_count\":8,\"invoices\":[{\"id\":\"INV2-QZ3V-GKZS-MJNP-HGBQ\",\"number\":\"0008\",\"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-04-04 PDT\",\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-04-04 02:03:36 PDT\"}},{\"id\":\"INV2-KDSB-LFC9-7AH9-TP92\",\"number\":\"0007\",\"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-04-04 PDT\",\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-04-04 01:57:19 PDT\"}},{\"id\":\"INV2-YADT-86G3-KMHM-LV8B\",\"number\":\"0006\",\"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-04-04 PDT\",\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-04-04 01:55:44 PDT\"}},{\"id\":\"INV2-GH3A-3DWB-FCJZ-P97Q\",\"number\":\"0005\",\"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-04-03 PDT\",\"payment_term\":{\"due_date\":\"2014-05-18 PDT\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-04-03 23:49:20 PDT\"}},{\"id\":\"INV2-9CAH-K5G7-2JPL-G4B4\",\"number\":\"0004\",\"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-04-03 PDT\",\"payment_term\":{\"due_date\":\"2014-05-18 PDT\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-04-03 23:15:03 PDT\"}},{\"id\":\"INV2-CJL7-PF4G-BLQF-5FWG\",\"number\":\"0003\",\"status\":\"CANCELLED\",\"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-04-03 PDT\",\"payment_term\":{\"due_date\":\"2014-05-18 PDT\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-04-03 23:11:40 PDT\"}},{\"id\":\"INV2-VHEH-7Q5J-NV6F-RM6V\",\"number\":\"0002\",\"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-04-03 PDT\",\"payment_term\":{\"due_date\":\"2014-05-18 PDT\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-04-03 22:52:23 PDT\"}},{\"id\":\"INV2-P6VJ-36HG-BBVT-M2MA\",\"number\":\"0001\",\"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-04-03 PDT\",\"payment_term\":{\"due_date\":\"2014-05-18 PDT\"},\"note\":\"Medical Invoice 16 Jul, 2013 PST\",\"total_amount\":{\"currency\":\"USD\",\"value\":\"500.00\"},\"metadata\":{\"created_date\":\"2014-04-03 22:30:15 PDT\"}}]}"
42
- read 3868 bytes
43
- reading 2 bytes...
44
- -> "\r\n"
45
- read 2 bytes
46
- -> "0\r\n"
33
+ -> "Content-Length: 99\r\n"
47
34
  -> "\r\n"
35
+ reading 99 bytes...
36
+ -> "{\"name\":\"AUTHORIZATION_ERROR\",\"message\":\"Authorization error occurred.\",\"debug_id\":\"d1f9e910e146e\"}"
37
+ read 99 bytes
48
38
  Conn keep-alive
49
39
  opening connection to api.sandbox.paypal.com:443...
50
40
  opened
51
41
  starting SSL for api.sandbox.paypal.com:443...
52
42
  SSL established
53
- <- "GET /v1/invoicing/invoices/INV2-P6VJ-36HG-BBVT-M2MA HTTP/1.1\r\nAuthorization: Bearer 2.RUg7qbhqxLBDae7Si-exTRs8ztl0Tv1FWMAnd0XVo\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 0.6.1 (paypal-sdk-core 0.2.8; ruby 2.1.1p76-x86_64-darwin12.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"
43
+ <- "GET /v1/invoicing/invoices/?total_count_required=true HTTP/1.1\r\nAuthorization: Bearer A015BQqJiVFfESfOPuywwMxi0xiRrKvXTZb236CJfsS18og\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 0.6.1 (paypal-sdk-core 0.2.10; 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"
54
44
  -> "HTTP/1.1 200 OK\r\n"
55
45
  -> "Server: Apache-Coyote/1.1\r\n"
56
- -> "PROXY_SERVER_INFO: host=slcsbjava4.slc.paypal.com;threadId=238\r\n"
57
- -> "Paypal-Debug-Id: 64e62266afe5c\r\n"
58
- -> "Date: Fri, 04 Apr 2014 09:03:40 GMT\r\n"
46
+ -> "PROXY_SERVER_INFO: host=slcsbjava3.slc.paypal.com;threadId=696\r\n"
47
+ -> "Paypal-Debug-Id: 580295bde1278\r\n"
48
+ -> "Date: Tue, 01 Jul 2014 15:14:30 GMT\r\n"
59
49
  -> "Content-Type: application/json\r\n"
60
- -> "Transfer-Encoding: chunked\r\n"
61
- -> "\r\n"
62
- -> "461\r\n"
63
- reading 1121 bytes...
64
- -> "{\"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\",\"phone\":{\"country_code\":\"1\",\"national_number\":\"5032141716\"},\"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\"}}"
65
- read 1121 bytes
66
- reading 2 bytes...
50
+ -> "Content-Length: 31\r\n"
67
51
  -> "\r\n"
68
- read 2 bytes
69
- -> "0\r\n"
52
+ reading 31 bytes...
53
+ -> "{\"total_count\":0,\"invoices\":[]}"
54
+ read 31 bytes
55
+ Conn keep-alive
56
+ opening connection to api.sandbox.paypal.com:443...
57
+ opened
58
+ starting SSL for api.sandbox.paypal.com:443...
59
+ SSL established
60
+ <- "GET /v1/invoicing/invoices/INV2-P6VJ-36HG-BBVT-M2MA HTTP/1.1\r\nAuthorization: Bearer A015BQqJiVFfESfOPuywwMxi0xiRrKvXTZb236CJfsS18og\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 0.6.1 (paypal-sdk-core 0.2.10; 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"
61
+ -> "HTTP/1.1 404 Not Found\r\n"
62
+ -> "Server: Apache-Coyote/1.1\r\n"
63
+ -> "PROXY_SERVER_INFO: host=slcsbjava1.slc.paypal.com;threadId=19195\r\n"
64
+ -> "Paypal-Debug-Id: e85ba4289863b\r\n"
65
+ -> "Date: Tue, 01 Jul 2014 15:14:31 GMT\r\n"
66
+ -> "Content-Type: application/json\r\n"
67
+ -> "Content-Length: 140\r\n"
70
68
  -> "\r\n"
69
+ reading 140 bytes...
70
+ -> "{\"name\":\"RESOURCE_NOT_FOUND_ERROR\",\"message\":\"invoice with id INV2-P6VJ-36HG-BBVT-M2MA not found in the system.\",\"debug_id\":\"e85ba4289863b\"}"
71
+ read 140 bytes
71
72
  Conn keep-alive
@@ -24,6 +24,15 @@ describe "Payments" do
24
24
  "currency" => "USD" },
25
25
  "description" => "This is the payment transaction description." } ] }
26
26
 
27
+ FuturePaymentAttributes = {
28
+ "intent" => "authorize",
29
+ "payer" => {
30
+ "payment_method" => "paypal" },
31
+ "transactions" => [ {
32
+ "amount" => {
33
+ "total" => "1.00",
34
+ "currency" => "USD" },
35
+ "description" => "This is the payment transaction description." } ] }
27
36
 
28
37
  it "Validate user-agent" do
29
38
  PayPal::SDK::REST::API.user_agent.should match "PayPalSDK/rest-sdk-ruby"
@@ -137,6 +146,29 @@ describe "Payments" do
137
146
 
138
147
  end
139
148
 
149
+ describe "Future Payment" do
150
+ access_token = nil
151
+
152
+ it "Exchange Authorization Code for Refresh / Access Tokens" do
153
+ # put your authorization code for testing here
154
+ auth_code = ''
155
+ if auth_code != ''
156
+ access_token = FuturePayment.exch_token(auth_code)
157
+ access_token.should_not be_nil
158
+ end
159
+ end
160
+
161
+ it "Create a payment" do
162
+ # put your Paypal-Application-Correlation-Id
163
+ correlation_id = ''
164
+ @future_payment = FuturePayment.new(FuturePaymentAttributes.merge( :token => access_token ))
165
+ @future_payment.create(correlation_id)
166
+ @future_payment.error.should be_nil
167
+ @future_payment.id.should_not be_nil
168
+ end
169
+
170
+ end
171
+
140
172
  describe "Sale" do
141
173
  before :each do
142
174
  @payment = Payment.new(PaymentAttributes)
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.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PayPal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-04 00:00:00.000000000 Z
11
+ date: 2014-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paypal-sdk-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.8
19
+ version: 0.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.8
26
+ version: 0.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: uuidtools
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -96,4 +96,3 @@ test_files:
96
96
  - spec/log/http.log
97
97
  - spec/payments_examples_spec.rb
98
98
  - spec/spec_helper.rb
99
- has_rdoc: