paypal-sdk-rest 1.7.4 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -14
- data/README.md +45 -251
- data/lib/lib.rb +88 -0
- data/lib/paypal/core/access_token.rb +20 -0
- data/lib/paypal/core/paypal_environment.rb +38 -0
- data/lib/paypal/core/paypal_http_client.rb +51 -0
- data/lib/paypal/core/token_requests.rb +40 -0
- data/lib/paypal/core/version.rb +3 -0
- data/lib/v1/billing_agreements/agreement_bill_balance_request.rb +35 -0
- data/lib/v1/billing_agreements/agreement_cancel_request.rb +35 -0
- data/lib/v1/billing_agreements/agreement_create_request.rb +33 -0
- data/lib/v1/billing_agreements/agreement_execute_request.rb +31 -0
- data/lib/v1/billing_agreements/agreement_get_request.rb +31 -0
- data/lib/v1/billing_agreements/agreement_re_activate_request.rb +35 -0
- data/lib/v1/billing_agreements/agreement_set_balance_request.rb +35 -0
- data/lib/v1/billing_agreements/agreement_suspend_request.rb +35 -0
- data/lib/v1/billing_agreements/agreement_transactions_request.rb +41 -0
- data/lib/v1/billing_agreements/agreement_update_request.rb +35 -0
- data/lib/v1/billing_plans/plan_create_request.rb +33 -0
- data/lib/v1/billing_plans/plan_get_request.rb +31 -0
- data/lib/v1/billing_plans/plan_list_request.rb +49 -0
- data/lib/v1/billing_plans/plan_update_request.rb +35 -0
- data/lib/v1/identity/user_consent.rb +45 -0
- data/lib/v1/identity/userinfo_get_request.rb +33 -0
- data/lib/v1/invoices/invoice_cancel_request.rb +35 -0
- data/lib/v1/invoices/invoice_create_request.rb +33 -0
- data/lib/v1/invoices/invoice_delete_external_payment_request.rb +33 -0
- data/lib/v1/invoices/invoice_delete_external_refund_request.rb +33 -0
- data/lib/v1/invoices/invoice_delete_request.rb +31 -0
- data/lib/v1/invoices/invoice_get_request.rb +31 -0
- data/lib/v1/invoices/invoice_list_request.rb +44 -0
- data/lib/v1/invoices/invoice_next_invoice_number_request.rb +29 -0
- data/lib/v1/invoices/invoice_qr_code_request.rb +46 -0
- data/lib/v1/invoices/invoice_record_payment_request.rb +35 -0
- data/lib/v1/invoices/invoice_record_refund_request.rb +35 -0
- data/lib/v1/invoices/invoice_remind_request.rb +35 -0
- data/lib/v1/invoices/invoice_search_request.rb +33 -0
- data/lib/v1/invoices/invoice_send_request.rb +36 -0
- data/lib/v1/invoices/invoice_update_request.rb +40 -0
- data/lib/v1/invoices/template_create_request.rb +33 -0
- data/lib/v1/invoices/template_delete_request.rb +31 -0
- data/lib/v1/invoices/template_get_request.rb +31 -0
- data/lib/v1/invoices/template_list_request.rb +34 -0
- data/lib/v1/invoices/template_update_request.rb +35 -0
- data/lib/v1/orders/orders_cancel_request.rb +31 -0
- data/lib/v1/orders/orders_create_request.rb +33 -0
- data/lib/v1/orders/orders_get_request.rb +31 -0
- data/lib/v1/orders/orders_pay_request.rb +35 -0
- data/lib/v1/payment_experience/web_profile_create_request.rb +33 -0
- data/lib/v1/payment_experience/web_profile_delete_request.rb +31 -0
- data/lib/v1/payment_experience/web_profile_get_request.rb +31 -0
- data/lib/v1/payment_experience/web_profile_list_request.rb +29 -0
- data/lib/v1/payment_experience/web_profile_partial_update_request.rb +35 -0
- data/lib/v1/payment_experience/web_profile_update_request.rb +35 -0
- data/lib/v1/payments/authorization_capture_request.rb +35 -0
- data/lib/v1/payments/authorization_get_request.rb +31 -0
- data/lib/v1/payments/authorization_reauthorize_request.rb +35 -0
- data/lib/v1/payments/authorization_void_request.rb +31 -0
- data/lib/v1/payments/capture_get_request.rb +31 -0
- data/lib/v1/payments/capture_refund_request.rb +35 -0
- data/lib/v1/payments/order_authorize_request.rb +35 -0
- data/lib/v1/payments/order_capture_request.rb +35 -0
- data/lib/v1/payments/order_get_request.rb +31 -0
- data/lib/v1/payments/order_void_request.rb +31 -0
- data/lib/v1/payments/payment_create_request.rb +33 -0
- data/lib/v1/payments/payment_execute_request.rb +35 -0
- data/lib/v1/payments/payment_get_request.rb +31 -0
- data/lib/v1/payments/payment_list_request.rb +69 -0
- data/lib/v1/payments/payment_update_request.rb +35 -0
- data/lib/v1/payments/refund_get_request.rb +31 -0
- data/lib/v1/payments/sale_get_request.rb +31 -0
- data/lib/v1/payments/sale_refund_request.rb +35 -0
- data/lib/v1/sync/search_get_request.rb +99 -0
- data/lib/v1/vault/credit_card_create_request.rb +33 -0
- data/lib/v1/vault/credit_card_delete_request.rb +31 -0
- data/lib/v1/vault/credit_card_get_request.rb +31 -0
- data/lib/v1/vault/credit_card_list_request.rb +79 -0
- data/lib/v1/vault/credit_card_update_request.rb +35 -0
- data/lib/v1/webhooks/available_event_type_list_request.rb +29 -0
- data/lib/v1/webhooks/event_get_request.rb +31 -0
- data/lib/v1/webhooks/event_list_request.rb +54 -0
- data/lib/v1/webhooks/event_resend_request.rb +35 -0
- data/lib/v1/webhooks/simulate_event_request.rb +33 -0
- data/lib/v1/webhooks/webhook_create_request.rb +33 -0
- data/lib/v1/webhooks/webhook_delete_request.rb +31 -0
- data/lib/v1/webhooks/webhook_get_request.rb +31 -0
- data/lib/v1/webhooks/webhook_list_event_subscriptions_request.rb +31 -0
- data/lib/v1/webhooks/webhook_list_request.rb +34 -0
- data/lib/v1/webhooks/webhook_update_request.rb +35 -0
- data/lib/v1/webhooks/webhook_verify_signature_request.rb +33 -0
- data/spec/integration/test_harness.rb +25 -0
- data/spec/integration/v1/billing_agreements/agreement_create_spec.rb +63 -0
- data/spec/integration/v1/billing_plans/plan_create_spec.rb +12 -0
- data/spec/integration/v1/billing_plans/plan_get_spec.rb +16 -0
- data/spec/integration/v1/billing_plans/plan_helper.rb +71 -0
- data/spec/integration/v1/billing_plans/plan_list_spec.rb +16 -0
- data/spec/integration/v1/billing_plans/plan_update_spec.rb +19 -0
- data/spec/integration/v1/identity/userinfo_get_spec.rb +65 -0
- data/spec/integration/v1/invoices/invoice_cancel_spec.rb +23 -0
- data/spec/integration/v1/invoices/invoice_create_spec.rb +15 -0
- data/spec/integration/v1/invoices/invoice_delete_external_payment_spec.rb +23 -0
- data/spec/integration/v1/invoices/invoice_delete_external_refund_spec.rb +21 -0
- data/spec/integration/v1/invoices/invoice_delete_spec.rb +16 -0
- data/spec/integration/v1/invoices/invoice_get_spec.rb +18 -0
- data/spec/integration/v1/invoices/invoice_helper.rb +171 -0
- data/spec/integration/v1/invoices/invoice_list_spec.rb +20 -0
- data/spec/integration/v1/invoices/invoice_next_invoice_number_spec.rb +14 -0
- data/spec/integration/v1/invoices/invoice_qr_code_spec.rb +18 -0
- data/spec/integration/v1/invoices/invoice_record_payment_spec.rb +14 -0
- data/spec/integration/v1/invoices/invoice_record_refund_spec.rb +14 -0
- data/spec/integration/v1/invoices/invoice_remind_spec.rb +22 -0
- data/spec/integration/v1/invoices/invoice_search_spec.rb +20 -0
- data/spec/integration/v1/invoices/invoice_send_spec.rb +15 -0
- data/spec/integration/v1/invoices/invoice_update_spec.rb +26 -0
- data/spec/integration/v1/invoices/template_create_spec.rb +14 -0
- data/spec/integration/v1/invoices/template_delete_spec.rb +15 -0
- data/spec/integration/v1/invoices/template_get_spec.rb +18 -0
- data/spec/integration/v1/invoices/template_list_spec.rb +15 -0
- data/spec/integration/v1/invoices/template_update_spec.rb +62 -0
- data/spec/integration/v1/orders/orders_cancel_spec.rb +15 -0
- data/spec/integration/v1/orders/orders_create_spec.rb +17 -0
- data/spec/integration/v1/orders/orders_get_spec.rb +18 -0
- data/spec/integration/v1/orders/orders_helper.rb +36 -0
- data/spec/integration/v1/orders/orders_pay_spec.rb +19 -0
- data/spec/integration/v1/payment_experience/pe_helper.rb +35 -0
- data/spec/integration/v1/payment_experience/web_profile_create_spec.rb +20 -0
- data/spec/integration/v1/payment_experience/web_profile_delete_spec.rb +15 -0
- data/spec/integration/v1/payment_experience/web_profile_get_spec.rb +17 -0
- data/spec/integration/v1/payment_experience/web_profile_list_spec.rb +18 -0
- data/spec/integration/v1/payment_experience/web_profile_partial_update_spec.rb +32 -0
- data/spec/integration/v1/payment_experience/web_profile_update_spec.rb +44 -0
- data/spec/integration/v1/payments/authorization_capture_spec.rb +17 -0
- data/spec/integration/v1/payments/authorization_get_spec.rb +18 -0
- data/spec/integration/v1/payments/authorization_reauthorize_spec.rb +26 -0
- data/spec/integration/v1/payments/authorization_void_spec.rb +19 -0
- data/spec/integration/v1/payments/capture_get_spec.rb +20 -0
- data/spec/integration/v1/payments/capture_refund_spec.rb +27 -0
- data/spec/integration/v1/payments/order_authorize_spec.rb +20 -0
- data/spec/integration/v1/payments/order_capture_spec.rb +21 -0
- data/spec/integration/v1/payments/order_get_spec.rb +14 -0
- data/spec/integration/v1/payments/order_void_spec.rb +14 -0
- data/spec/integration/v1/payments/payment_create_spec.rb +13 -0
- data/spec/integration/v1/payments/payment_execute_spec.rb +19 -0
- data/spec/integration/v1/payments/payment_get_spec.rb +17 -0
- data/spec/integration/v1/payments/payment_list_spec.rb +16 -0
- data/spec/integration/v1/payments/payment_update_spec.rb +28 -0
- data/spec/integration/v1/payments/payments_helper.rb +72 -0
- data/spec/integration/v1/payments/refund_get_spec.rb +19 -0
- data/spec/integration/v1/payments/sale_get_spec.rb +18 -0
- data/spec/integration/v1/payments/sale_refund_spec.rb +18 -0
- data/spec/integration/v1/sync/search_get_spec.rb +34 -0
- data/spec/integration/v1/vault/credit_card_create_spec.rb +16 -0
- data/spec/integration/v1/vault/credit_card_delete_spec.rb +16 -0
- data/spec/integration/v1/vault/credit_card_get_spec.rb +17 -0
- data/spec/integration/v1/vault/credit_card_list_spec.rb +18 -0
- data/spec/integration/v1/vault/credit_card_update_spec.rb +26 -0
- data/spec/integration/v1/vault/vault_helper.rb +28 -0
- data/spec/integration/v1/webhooks/available_event_type_list_spec.rb +16 -0
- data/spec/integration/v1/webhooks/webhook_create_spec.rb +12 -0
- data/spec/integration/v1/webhooks/webhook_delete_spec.rb +13 -0
- data/spec/integration/v1/webhooks/webhook_get_spec.rb +16 -0
- data/spec/integration/v1/webhooks/webhook_helper.rb +43 -0
- data/spec/integration/v1/webhooks/webhook_list_event_subscriptions_spec.rb +16 -0
- data/spec/integration/v1/webhooks/webhook_list_spec.rb +15 -0
- data/spec/integration/v1/webhooks/webhook_update_spec.rb +29 -0
- data/spec/integration/v1/webhooks/webhook_verify_signature_spec.rb +20 -0
- data/spec/spec_helper.rb +97 -28
- data/spec/unit/paypal_http_client_spec.rb +264 -0
- metadata +250 -120
- data/Rakefile +0 -15
- data/data/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/data/DigiCertSHA2ExtendedValidationServerCA.pem +0 -28
- data/data/paypal.crt +0 -171
- data/lib/generators/paypal/sdk/USAGE +0 -3
- data/lib/generators/paypal/sdk/install_generator.rb +0 -17
- data/lib/generators/paypal/sdk/templates/paypal.rb +0 -2
- data/lib/generators/paypal/sdk/templates/paypal.yml +0 -29
- data/lib/paypal-sdk-core.rb +0 -38
- data/lib/paypal-sdk-rest.rb +0 -2
- data/lib/paypal-sdk/core/api.rb +0 -20
- data/lib/paypal-sdk/core/api/base.rb +0 -169
- data/lib/paypal-sdk/core/api/data_types/array_with_block.rb +0 -44
- data/lib/paypal-sdk/core/api/data_types/base.rb +0 -225
- data/lib/paypal-sdk/core/api/data_types/enum.rb +0 -26
- data/lib/paypal-sdk/core/api/data_types/simple_types.rb +0 -52
- data/lib/paypal-sdk/core/api/ipn.rb +0 -66
- data/lib/paypal-sdk/core/api/rest.rb +0 -177
- data/lib/paypal-sdk/core/authentication.rb +0 -66
- data/lib/paypal-sdk/core/config.rb +0 -253
- data/lib/paypal-sdk/core/credential.rb +0 -16
- data/lib/paypal-sdk/core/credential/base.rb +0 -27
- data/lib/paypal-sdk/core/credential/certificate.rb +0 -32
- data/lib/paypal-sdk/core/credential/signature.rb +0 -22
- data/lib/paypal-sdk/core/credential/third_party/subject.rb +0 -25
- data/lib/paypal-sdk/core/credential/third_party/token.rb +0 -39
- data/lib/paypal-sdk/core/exceptions.rb +0 -112
- data/lib/paypal-sdk/core/logging.rb +0 -50
- data/lib/paypal-sdk/core/openid_connect.rb +0 -140
- data/lib/paypal-sdk/core/openid_connect/api.rb +0 -50
- data/lib/paypal-sdk/core/openid_connect/data_types.rb +0 -73
- data/lib/paypal-sdk/core/openid_connect/get_api.rb +0 -28
- data/lib/paypal-sdk/core/openid_connect/request_data_type.rb +0 -52
- data/lib/paypal-sdk/core/openid_connect/set_api.rb +0 -36
- data/lib/paypal-sdk/core/util.rb +0 -11
- data/lib/paypal-sdk/core/util/http_helper.rb +0 -171
- data/lib/paypal-sdk/core/util/oauth_signature.rb +0 -64
- data/lib/paypal-sdk/core/util/ordered_hash.rb +0 -165
- data/lib/paypal-sdk/rest.rb +0 -39
- data/lib/paypal-sdk/rest/api.rb +0 -23
- data/lib/paypal-sdk/rest/data_types.rb +0 -2597
- data/lib/paypal-sdk/rest/error_hash.rb +0 -39
- data/lib/paypal-sdk/rest/get_api.rb +0 -20
- data/lib/paypal-sdk/rest/request_data_type.rb +0 -53
- data/lib/paypal-sdk/rest/set_api.rb +0 -42
- data/lib/paypal-sdk/rest/version.rb +0 -7
- data/spec/README.md +0 -22
- data/spec/config/cacert.pem +0 -171
- data/spec/config/cert_key.pem +0 -33
- data/spec/config/paypal.yml +0 -35
- data/spec/config/sample_data.yml +0 -3
- data/spec/core/api/data_type_spec.rb +0 -289
- data/spec/core/api/rest_spec.rb +0 -211
- data/spec/core/config_spec.rb +0 -192
- data/spec/core/logging_spec.rb +0 -28
- data/spec/core/openid_connect_spec.rb +0 -153
- data/spec/invoice_examples_spec.rb +0 -38
- data/spec/payments_examples_spec.rb +0 -437
- data/spec/payouts_examples_spec.rb +0 -74
- data/spec/rest/data_types_spec.rb +0 -62
- data/spec/rest/error_hash_spec.rb +0 -83
- data/spec/subscription_examples_spec.rb +0 -227
- data/spec/support/sample_data.rb +0 -5
- data/spec/web_profile_examples_spec.rb +0 -106
- data/spec/webhooks_examples_spec.rb +0 -93
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../../test_harness'
|
2
|
+
require_relative './webhook_helper'
|
3
|
+
|
4
|
+
|
5
|
+
include PayPal::V1::Webhooks
|
6
|
+
|
7
|
+
describe WebhookVerifySignatureRequest do
|
8
|
+
def build_request_body
|
9
|
+
return JSON.parse('{ "transmission_id": "d938e770-8046-11e6-8103-6b62a8a99ac4", "transmission_time": "2016-09-21T22:00:46Z", "cert_url": "https://api.sandbox.paypal.com/v1/notifications/certs/CERT-360caa42-fca2a594-a5cafa77", "auth_algo": "SHA256withRSA", "transmission_sig": "eDOnWUj9FXOnr2naQnrdL7bhgejVSTwRbwbJ0kuk5wAtm2ZYkr7w5BSUDO7e5ZOsqLwN3sPn3RV85Jd9pjHuTlpuXDLYk+l5qiViPbaaC0tLV+8C/zbDjg2WCfvtf2NmFT8CHgPPQAByUqiiTY+RJZPPQC5np7j7WuxcegsJLeWStRAofsDLiSKrzYV3CKZYtNoNnRvYmSFMkYp/5vk4xGcQLeYNV1CC2PyqraZj8HGG6Y+KV4trhreV9VZDn+rPtLDZTbzUohie1LpEy31k2dg+1szpWaGYOz+MRb40U04oD7fD69vghCrDTYs5AsuFM2+WZtsMDmYGI0pxLjn2yw==", "webhook_id": "1JE4291016473214C", "webhook_event": { "id": "WH-9UG43882HX7271132-6E0871324L7949614", "event_version": "1.0", "create_time": "2016-09-21T22:00:45Z", "resource_type": "sale", "event_type": "PAYMENT.SALE.COMPLETED", "summary": "Payment completed for $ 21.0 USD", "resource": { "id": "80F85758S3080410K", "state": "completed", "amount": { "total": "21.00", "currency": "USD", "details": { "subtotal": "17.50", "tax": "1.30", "shipping": "2.20" } }, "payment_mode": "INSTANT_TRANSFER", "protection_eligibility": "ELIGIBLE", "protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE", "transaction_fee": { "value": "0.91", "currency": "USD" }, "invoice_number": "57e3028db8d1b", "custom": "", "parent_payment": "PAY-7F371669SL612941HK7RQFDQ", "create_time": "2016-09-21T21:59:02Z", "update_time": "2016-09-21T22:00:06Z", "links": [{ "href": "https://api.sandbox.paypal.com/v1/payments/sale/80F85758S3080410K", "rel": "self", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/payments/sale/80F85758S3080410K/refund", "rel": "refund", "method": "POST" }, { "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-7F371669SL612941HK7RQFDQ", "rel": "parent_payment", "method": "GET" }] }, "links": [{ "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-9UG43882HX7271132-6E0871324L7949614", "rel": "self", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-9UG43882HX7271132-6E0871324L7949614/resend", "rel": "resend", "method": "POST" }] } }')
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'successfully makes a request' do
|
13
|
+
request = WebhookVerifySignatureRequest.new()
|
14
|
+
request.request_body(build_request_body)
|
15
|
+
|
16
|
+
resp = TestHarness::client.execute(request)
|
17
|
+
expect(resp.status_code).to eq(200)
|
18
|
+
expect(resp.result).not_to be_nil
|
19
|
+
end
|
20
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,37 +1,106 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
require_relative "../lib/lib.rb"
|
2
|
+
require 'pp'
|
3
|
+
|
4
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
5
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
6
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
7
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
8
|
+
# files.
|
9
|
+
#
|
10
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
11
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
12
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
13
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
14
|
+
# a separate helper file that requires the additional dependencies and performs
|
15
|
+
# the additional setup, and require it from the spec files that actually need
|
16
|
+
# it.
|
17
|
+
#
|
18
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
19
|
+
# users commonly want.
|
20
|
+
#
|
21
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
22
|
+
RSpec.configure do |config|
|
23
|
+
# rspec-expectations config goes here. You can use an alternate
|
24
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
25
|
+
# assertions if you prefer.
|
26
|
+
config.expect_with :rspec do |expectations|
|
27
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
28
|
+
# and `failure_message` of custom matchers include text for helper methods
|
29
|
+
# defined using `chain`, e.g.:
|
30
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
31
|
+
# # => "be bigger than 2 and smaller than 4"
|
32
|
+
# ...rather than:
|
33
|
+
# # => "be bigger than 2"
|
34
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
9
35
|
end
|
10
|
-
end
|
11
36
|
|
12
|
-
|
13
|
-
|
37
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
38
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
39
|
+
config.mock_with :rspec do |mocks|
|
40
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
41
|
+
# a real object. This is generally recommended, and will default to
|
42
|
+
# `true` in RSpec 4.
|
43
|
+
mocks.verify_partial_doubles = true
|
44
|
+
end
|
14
45
|
|
15
|
-
|
46
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
47
|
+
# have no way to turn it off -- the option exists only for backwards
|
48
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
49
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
50
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
51
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
16
52
|
|
17
|
-
|
18
|
-
|
53
|
+
# The settings below are suggested to provide a good initial experience
|
54
|
+
# with RSpec, but feel free to customize to your heart's content.
|
55
|
+
=begin
|
56
|
+
# This allows you to limit a spec run to individual examples or groups
|
57
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
58
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
59
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
60
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
61
|
+
config.filter_run_when_matching :focus
|
19
62
|
|
20
|
-
|
21
|
-
|
22
|
-
|
63
|
+
# Allows RSpec to persist some state between runs in order to support
|
64
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
65
|
+
# you configure your source control system to ignore this file.
|
66
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
23
67
|
|
24
|
-
|
68
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
69
|
+
# recommended. For more details, see:
|
70
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
71
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
72
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
73
|
+
config.disable_monkey_patching!
|
25
74
|
|
26
|
-
#
|
27
|
-
|
28
|
-
|
75
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
76
|
+
# be too noisy due to issues in dependencies.
|
77
|
+
config.warnings = true
|
29
78
|
|
30
|
-
RSpec
|
31
|
-
|
32
|
-
|
33
|
-
config.
|
34
|
-
|
35
|
-
|
79
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
80
|
+
# file, and it's useful to allow more verbose output when running an
|
81
|
+
# individual spec file.
|
82
|
+
if config.files_to_run.one?
|
83
|
+
# Use the documentation formatter for detailed output,
|
84
|
+
# unless a formatter has already been configured
|
85
|
+
# (e.g. via a command-line flag).
|
86
|
+
config.default_formatter = 'doc'
|
87
|
+
end
|
88
|
+
|
89
|
+
# Print the 10 slowest examples and example groups at the
|
90
|
+
# end of the spec run, to help surface which specs are running
|
91
|
+
# particularly slow.
|
92
|
+
config.profile_examples = 10
|
36
93
|
|
37
|
-
|
94
|
+
# Run specs in random order to surface order dependencies. If you find an
|
95
|
+
# order dependency and want to debug it, you can fix the order by providing
|
96
|
+
# the seed, which is printed after each run.
|
97
|
+
# --seed 1234
|
98
|
+
config.order = :random
|
99
|
+
|
100
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
101
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
102
|
+
# test failures related to randomization by passing the same `--seed` value
|
103
|
+
# as the one that triggered the failure.
|
104
|
+
Kernel.srand config.seed
|
105
|
+
=end
|
106
|
+
end
|
@@ -0,0 +1,264 @@
|
|
1
|
+
require_relative '../../lib/paypal/core/version'
|
2
|
+
require 'webmock/rspec'
|
3
|
+
|
4
|
+
include WebMock::API
|
5
|
+
|
6
|
+
describe PayPal::PayPalHttpClient do
|
7
|
+
before do
|
8
|
+
WebMock.disable!
|
9
|
+
@environment = PayPal::SandboxEnvironment.new('clientId', 'clientSecret')
|
10
|
+
@httpClient = PayPal::PayPalHttpClient.new(@environment)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Helpers
|
14
|
+
def stubAccessToken
|
15
|
+
access_token_json = JSON.generate({
|
16
|
+
:access_token => "simple-access-token",
|
17
|
+
:expires_in => 3600,
|
18
|
+
:token_type => 'Bearer',
|
19
|
+
})
|
20
|
+
|
21
|
+
stub_request(:any, @environment.base_url + "/v1/oauth2/token").
|
22
|
+
to_return(body: access_token_json, status: 200,
|
23
|
+
headers: {'content-type' => "application/json"})
|
24
|
+
end
|
25
|
+
|
26
|
+
def stubRefreshToken
|
27
|
+
access_token_json = JSON.generate({
|
28
|
+
:access_token => "refresh-access-token",
|
29
|
+
:expires_in => 3600,
|
30
|
+
:token_type => 'Bearer',
|
31
|
+
})
|
32
|
+
|
33
|
+
stub_request(:any, @environment.base_url + "/v1/oauth2/token")
|
34
|
+
.to_return(body: access_token_json, status: 200, headers: {'content-type' => "application/json"})
|
35
|
+
end
|
36
|
+
|
37
|
+
describe 'execute' do
|
38
|
+
before(:each) do
|
39
|
+
WebMock.enable!
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'fetches access token if not yet fetched' do
|
43
|
+
access_token_stub = stubAccessToken
|
44
|
+
|
45
|
+
return_json = JSON.generate({
|
46
|
+
:some_key => "some_value",
|
47
|
+
})
|
48
|
+
|
49
|
+
stub_request(:get, @environment.base_url + "/path")
|
50
|
+
.to_return(body: return_json, status: 200, headers: {'content-type' => "application/json"})
|
51
|
+
|
52
|
+
req = OpenStruct.new({:verb => "GET", :path => "/path"})
|
53
|
+
|
54
|
+
resp = @httpClient.execute(req)
|
55
|
+
|
56
|
+
expect(resp.status_code).to eq(200)
|
57
|
+
expect(resp.result.some_key).to eq("some_value")
|
58
|
+
assert_requested(access_token_stub)
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'does not fetch access token if not expired and valid' do
|
62
|
+
access_token_stub = stubAccessToken
|
63
|
+
|
64
|
+
return_json = JSON.generate({
|
65
|
+
:some_key => "some_value",
|
66
|
+
})
|
67
|
+
|
68
|
+
response_stub = stub_request(:any, @environment.base_url)
|
69
|
+
.to_return(body: return_json, status: 200, headers: {'content-type' => "application/json"})
|
70
|
+
|
71
|
+
req = OpenStruct.new({:verb => "GET", :path => "/"})
|
72
|
+
|
73
|
+
resp = @httpClient.execute(req)
|
74
|
+
|
75
|
+
expect(resp.status_code).to eq(200)
|
76
|
+
expect(resp.result[:some_key]).to eq("some_value")
|
77
|
+
|
78
|
+
resp = @httpClient.execute(req)
|
79
|
+
|
80
|
+
assert_requested(access_token_stub, times: 1)
|
81
|
+
assert_requested(response_stub, times: 2)
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'fetches access token if expired' do
|
85
|
+
expired_access_token_json = JSON.generate({
|
86
|
+
:access_token => "expired-access-token",
|
87
|
+
:expires_in => -1,
|
88
|
+
:token_type => 'Bearer',
|
89
|
+
})
|
90
|
+
|
91
|
+
access_token_json = JSON.generate({
|
92
|
+
:access_token => "simple-access-token",
|
93
|
+
:expires_in => 3600,
|
94
|
+
:token_type => 'Bearer',
|
95
|
+
})
|
96
|
+
|
97
|
+
access_token_stub = stub_request(:any, @environment.base_url + "/v1/oauth2/token")
|
98
|
+
.to_return(body: expired_access_token_json, status: 200, headers: {'content-type' => "application/json"})
|
99
|
+
.times(1)
|
100
|
+
.then
|
101
|
+
.to_return(body: access_token_json, status: 200, headers: {'content-type' => "application/json"})
|
102
|
+
|
103
|
+
return_json = JSON.generate({
|
104
|
+
:some_key => "some_value",
|
105
|
+
})
|
106
|
+
|
107
|
+
response_stub = stub_request(:any, @environment.base_url)
|
108
|
+
.to_return(body: return_json, status: 200, headers: {'content-type' => "application/json"})
|
109
|
+
|
110
|
+
req = OpenStruct.new({:verb => "GET", :path => "/"})
|
111
|
+
|
112
|
+
resp = @httpClient.execute(req)
|
113
|
+
|
114
|
+
expect(resp.status_code).to eq(200)
|
115
|
+
expect(resp.result[:some_key]).to eq("some_value")
|
116
|
+
|
117
|
+
resp = @httpClient.execute(req)
|
118
|
+
|
119
|
+
assert_requested(access_token_stub, times: 2)
|
120
|
+
assert_requested(response_stub, times: 2)
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'fetches access token with refresh token not yet fetched' do
|
124
|
+
@httpClient = PayPal::PayPalHttpClient.new(@environment, "refresh-token")
|
125
|
+
refresh_token_stub = stubRefreshToken
|
126
|
+
|
127
|
+
return_json = JSON.generate({
|
128
|
+
:some_key => "some_value",
|
129
|
+
})
|
130
|
+
|
131
|
+
stub_request(:any, @environment.base_url)
|
132
|
+
.to_return(body: return_json, status: 200, headers: {'content-type' => "application/json"})
|
133
|
+
|
134
|
+
req = OpenStruct.new({:verb => "GET", :path => "/"})
|
135
|
+
|
136
|
+
resp = @httpClient.execute(req)
|
137
|
+
|
138
|
+
expect(resp.status_code).to eq(200)
|
139
|
+
expect(resp.result[:some_key]).to eq("some_value")
|
140
|
+
assert_requested(refresh_token_stub)
|
141
|
+
end
|
142
|
+
|
143
|
+
it 'fetches access token with refresh token if expired' do
|
144
|
+
@httpClient = PayPal::PayPalHttpClient.new(@environment, "refresh-token")
|
145
|
+
|
146
|
+
expired_access_token_json = JSON.generate({
|
147
|
+
:access_token => "expired-access-token",
|
148
|
+
:expires_in => -1,
|
149
|
+
:token_type => 'Bearer',
|
150
|
+
})
|
151
|
+
|
152
|
+
access_token_json = JSON.generate({
|
153
|
+
:access_token => "refresh-access-token",
|
154
|
+
:expires_in => 3600,
|
155
|
+
:token_type => 'Bearer',
|
156
|
+
})
|
157
|
+
|
158
|
+
access_token_stub = stub_request(:any, @environment.base_url + "/v1/oauth2/token")
|
159
|
+
.to_return(body: expired_access_token_json, status: 200, headers: {'content-type' => "application/json"})
|
160
|
+
.times(1)
|
161
|
+
.then
|
162
|
+
.to_return(body: access_token_json, status: 200, headers: {'content-type' => "application/json"})
|
163
|
+
|
164
|
+
return_json = JSON.generate({
|
165
|
+
:some_key => "some_value",
|
166
|
+
})
|
167
|
+
|
168
|
+
response_stub = stub_request(:any, @environment.base_url)
|
169
|
+
.to_return(body: return_json, status: 200, headers: {'content-type' => "application/json"})
|
170
|
+
|
171
|
+
req = OpenStruct.new({:verb => "GET", :path => "/"})
|
172
|
+
|
173
|
+
resp = @httpClient.execute(req)
|
174
|
+
|
175
|
+
expect(resp.status_code).to eq(200)
|
176
|
+
expect(resp.result[:some_key]).to eq("some_value")
|
177
|
+
|
178
|
+
resp = @httpClient.execute(req)
|
179
|
+
|
180
|
+
assert_requested(access_token_stub, times: 2)
|
181
|
+
assert_requested(response_stub, times: 2)
|
182
|
+
end
|
183
|
+
|
184
|
+
it 'does not fetch access token if authorization header already present' do
|
185
|
+
@httpClient = PayPal::PayPalHttpClient.new(@environment)
|
186
|
+
|
187
|
+
return_json = JSON.generate({
|
188
|
+
:some_key => "some_value",
|
189
|
+
})
|
190
|
+
|
191
|
+
stub_request(:get, @environment.base_url + "/path")
|
192
|
+
.to_return(body: return_json, status: 200, headers: {'content-type' => "application/json"})
|
193
|
+
|
194
|
+
req = OpenStruct.new({:verb => "GET", :path => "/path", :headers => {'Authorization' => 'custom-header-value'}})
|
195
|
+
|
196
|
+
resp = @httpClient.execute(req)
|
197
|
+
|
198
|
+
expect(resp.status_code).to eq(200)
|
199
|
+
expect(resp.result[:some_key]).to eq("some_value")
|
200
|
+
|
201
|
+
expect(WebMock).to have_requested(:get, @environment.base_url + '/path')
|
202
|
+
.with(headers: {'Authorization' => "custom-header-value"})
|
203
|
+
end
|
204
|
+
|
205
|
+
it 'sets Authorization header with access token value' do
|
206
|
+
access_token_stub = stubAccessToken
|
207
|
+
|
208
|
+
return_json = JSON.generate({
|
209
|
+
:some_key => "some_value",
|
210
|
+
})
|
211
|
+
|
212
|
+
stub_request(:get, @environment.base_url + "/path")
|
213
|
+
.to_return(body: return_json, status: 200, headers: {'content-type' => "application/json"})
|
214
|
+
|
215
|
+
req = OpenStruct.new({:verb => "GET", :path => "/path"})
|
216
|
+
|
217
|
+
resp = @httpClient.execute(req)
|
218
|
+
|
219
|
+
expect(resp.status_code).to eq(200)
|
220
|
+
expect(resp.result.some_key).to eq("some_value")
|
221
|
+
assert_requested(access_token_stub)
|
222
|
+
|
223
|
+
expect(WebMock).to have_requested(:get, @environment.base_url + '/path')
|
224
|
+
.with(headers: {'Authorization' => "Bearer simple-access-token"})
|
225
|
+
end
|
226
|
+
|
227
|
+
it 'sets User-Agent header properly' do
|
228
|
+
access_token_stub = stubAccessToken
|
229
|
+
|
230
|
+
return_json = JSON.generate({
|
231
|
+
:some_key => "some_value",
|
232
|
+
})
|
233
|
+
|
234
|
+
request_stub = stub_request(:any, @environment.base_url)
|
235
|
+
.to_return(body: return_json, status: 200, headers: {'content-type' => "application/json"})
|
236
|
+
|
237
|
+
resp = @httpClient.execute(OpenStruct.new({:verb => "GET", :path => "/"}))
|
238
|
+
|
239
|
+
user_agent_regex = /^PayPalSDK\/rest-sdk-ruby #{PayPal::VERSION} \(paypal-sdk-core .*; ruby [\d\.?]*p\d+-.*;OpenSSL.*\)$/
|
240
|
+
expect(WebMock).to have_requested(:get, @environment.base_url)
|
241
|
+
.with(headers: {'User-Agent' => user_agent_regex})
|
242
|
+
end
|
243
|
+
|
244
|
+
it 'sets Accept-Encoding header to gzip' do
|
245
|
+
access_token_stub = stubAccessToken
|
246
|
+
|
247
|
+
return_json = JSON.generate({
|
248
|
+
:some_key => "some_value",
|
249
|
+
})
|
250
|
+
|
251
|
+
request_stub = stub_request(:any, @environment.base_url)
|
252
|
+
.to_return(body: return_json, status: 200, headers: {'content-type' => "application/json"})
|
253
|
+
|
254
|
+
req = OpenStruct.new({:verb => "GET", :path => "/"})
|
255
|
+
|
256
|
+
resp = @httpClient.execute(req)
|
257
|
+
|
258
|
+
expect(resp.status_code).to eq(200)
|
259
|
+
expect(resp.result[:some_key]).to eq("some_value")
|
260
|
+
expect(WebMock).to have_requested(:get, @environment.base_url)
|
261
|
+
.with(headers: {'Accept-Encoding' => 'gzip'})
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
metadata
CHANGED
@@ -1,57 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypal-sdk-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PayPal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: xml-simple
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: multi_json
|
14
|
+
name: braintreehttp
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
44
16
|
requirements:
|
45
17
|
- - "~>"
|
46
18
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
19
|
+
version: 0.4.4
|
48
20
|
type: :runtime
|
49
21
|
prerelease: false
|
50
22
|
version_requirements: !ruby/object:Gem::Requirement
|
51
23
|
requirements:
|
52
24
|
- - "~>"
|
53
25
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
26
|
+
version: 0.4.4
|
55
27
|
description: The PayPal REST SDK provides Ruby APIs to create, process and manage
|
56
28
|
payment.
|
57
29
|
email:
|
@@ -62,72 +34,172 @@ extra_rdoc_files: []
|
|
62
34
|
files:
|
63
35
|
- Gemfile
|
64
36
|
- README.md
|
65
|
-
-
|
66
|
-
-
|
67
|
-
-
|
68
|
-
-
|
69
|
-
- lib/
|
70
|
-
- lib/
|
71
|
-
- lib/
|
72
|
-
- lib/
|
73
|
-
- lib/
|
74
|
-
- lib/
|
75
|
-
- lib/
|
76
|
-
- lib/
|
77
|
-
- lib/
|
78
|
-
- lib/
|
79
|
-
- lib/
|
80
|
-
- lib/
|
81
|
-
- lib/
|
82
|
-
- lib/
|
83
|
-
- lib/
|
84
|
-
- lib/
|
85
|
-
- lib/
|
86
|
-
- lib/
|
87
|
-
- lib/
|
88
|
-
- lib/
|
89
|
-
- lib/
|
90
|
-
- lib/
|
91
|
-
- lib/
|
92
|
-
- lib/
|
93
|
-
- lib/
|
94
|
-
- lib/
|
95
|
-
- lib/
|
96
|
-
- lib/
|
97
|
-
- lib/
|
98
|
-
- lib/
|
99
|
-
- lib/
|
100
|
-
- lib/
|
101
|
-
- lib/
|
102
|
-
- lib/
|
103
|
-
- lib/
|
104
|
-
- lib/
|
105
|
-
- lib/
|
106
|
-
- lib/
|
107
|
-
- lib/
|
108
|
-
- lib/
|
109
|
-
- lib/
|
110
|
-
- lib/
|
111
|
-
-
|
112
|
-
-
|
113
|
-
-
|
114
|
-
-
|
115
|
-
-
|
116
|
-
-
|
117
|
-
-
|
118
|
-
-
|
119
|
-
-
|
120
|
-
-
|
121
|
-
-
|
122
|
-
-
|
123
|
-
-
|
124
|
-
-
|
125
|
-
-
|
37
|
+
- lib/lib.rb
|
38
|
+
- lib/paypal/core/access_token.rb
|
39
|
+
- lib/paypal/core/paypal_environment.rb
|
40
|
+
- lib/paypal/core/paypal_http_client.rb
|
41
|
+
- lib/paypal/core/token_requests.rb
|
42
|
+
- lib/paypal/core/version.rb
|
43
|
+
- lib/v1/billing_agreements/agreement_bill_balance_request.rb
|
44
|
+
- lib/v1/billing_agreements/agreement_cancel_request.rb
|
45
|
+
- lib/v1/billing_agreements/agreement_create_request.rb
|
46
|
+
- lib/v1/billing_agreements/agreement_execute_request.rb
|
47
|
+
- lib/v1/billing_agreements/agreement_get_request.rb
|
48
|
+
- lib/v1/billing_agreements/agreement_re_activate_request.rb
|
49
|
+
- lib/v1/billing_agreements/agreement_set_balance_request.rb
|
50
|
+
- lib/v1/billing_agreements/agreement_suspend_request.rb
|
51
|
+
- lib/v1/billing_agreements/agreement_transactions_request.rb
|
52
|
+
- lib/v1/billing_agreements/agreement_update_request.rb
|
53
|
+
- lib/v1/billing_plans/plan_create_request.rb
|
54
|
+
- lib/v1/billing_plans/plan_get_request.rb
|
55
|
+
- lib/v1/billing_plans/plan_list_request.rb
|
56
|
+
- lib/v1/billing_plans/plan_update_request.rb
|
57
|
+
- lib/v1/identity/user_consent.rb
|
58
|
+
- lib/v1/identity/userinfo_get_request.rb
|
59
|
+
- lib/v1/invoices/invoice_cancel_request.rb
|
60
|
+
- lib/v1/invoices/invoice_create_request.rb
|
61
|
+
- lib/v1/invoices/invoice_delete_external_payment_request.rb
|
62
|
+
- lib/v1/invoices/invoice_delete_external_refund_request.rb
|
63
|
+
- lib/v1/invoices/invoice_delete_request.rb
|
64
|
+
- lib/v1/invoices/invoice_get_request.rb
|
65
|
+
- lib/v1/invoices/invoice_list_request.rb
|
66
|
+
- lib/v1/invoices/invoice_next_invoice_number_request.rb
|
67
|
+
- lib/v1/invoices/invoice_qr_code_request.rb
|
68
|
+
- lib/v1/invoices/invoice_record_payment_request.rb
|
69
|
+
- lib/v1/invoices/invoice_record_refund_request.rb
|
70
|
+
- lib/v1/invoices/invoice_remind_request.rb
|
71
|
+
- lib/v1/invoices/invoice_search_request.rb
|
72
|
+
- lib/v1/invoices/invoice_send_request.rb
|
73
|
+
- lib/v1/invoices/invoice_update_request.rb
|
74
|
+
- lib/v1/invoices/template_create_request.rb
|
75
|
+
- lib/v1/invoices/template_delete_request.rb
|
76
|
+
- lib/v1/invoices/template_get_request.rb
|
77
|
+
- lib/v1/invoices/template_list_request.rb
|
78
|
+
- lib/v1/invoices/template_update_request.rb
|
79
|
+
- lib/v1/orders/orders_cancel_request.rb
|
80
|
+
- lib/v1/orders/orders_create_request.rb
|
81
|
+
- lib/v1/orders/orders_get_request.rb
|
82
|
+
- lib/v1/orders/orders_pay_request.rb
|
83
|
+
- lib/v1/payment_experience/web_profile_create_request.rb
|
84
|
+
- lib/v1/payment_experience/web_profile_delete_request.rb
|
85
|
+
- lib/v1/payment_experience/web_profile_get_request.rb
|
86
|
+
- lib/v1/payment_experience/web_profile_list_request.rb
|
87
|
+
- lib/v1/payment_experience/web_profile_partial_update_request.rb
|
88
|
+
- lib/v1/payment_experience/web_profile_update_request.rb
|
89
|
+
- lib/v1/payments/authorization_capture_request.rb
|
90
|
+
- lib/v1/payments/authorization_get_request.rb
|
91
|
+
- lib/v1/payments/authorization_reauthorize_request.rb
|
92
|
+
- lib/v1/payments/authorization_void_request.rb
|
93
|
+
- lib/v1/payments/capture_get_request.rb
|
94
|
+
- lib/v1/payments/capture_refund_request.rb
|
95
|
+
- lib/v1/payments/order_authorize_request.rb
|
96
|
+
- lib/v1/payments/order_capture_request.rb
|
97
|
+
- lib/v1/payments/order_get_request.rb
|
98
|
+
- lib/v1/payments/order_void_request.rb
|
99
|
+
- lib/v1/payments/payment_create_request.rb
|
100
|
+
- lib/v1/payments/payment_execute_request.rb
|
101
|
+
- lib/v1/payments/payment_get_request.rb
|
102
|
+
- lib/v1/payments/payment_list_request.rb
|
103
|
+
- lib/v1/payments/payment_update_request.rb
|
104
|
+
- lib/v1/payments/refund_get_request.rb
|
105
|
+
- lib/v1/payments/sale_get_request.rb
|
106
|
+
- lib/v1/payments/sale_refund_request.rb
|
107
|
+
- lib/v1/sync/search_get_request.rb
|
108
|
+
- lib/v1/vault/credit_card_create_request.rb
|
109
|
+
- lib/v1/vault/credit_card_delete_request.rb
|
110
|
+
- lib/v1/vault/credit_card_get_request.rb
|
111
|
+
- lib/v1/vault/credit_card_list_request.rb
|
112
|
+
- lib/v1/vault/credit_card_update_request.rb
|
113
|
+
- lib/v1/webhooks/available_event_type_list_request.rb
|
114
|
+
- lib/v1/webhooks/event_get_request.rb
|
115
|
+
- lib/v1/webhooks/event_list_request.rb
|
116
|
+
- lib/v1/webhooks/event_resend_request.rb
|
117
|
+
- lib/v1/webhooks/simulate_event_request.rb
|
118
|
+
- lib/v1/webhooks/webhook_create_request.rb
|
119
|
+
- lib/v1/webhooks/webhook_delete_request.rb
|
120
|
+
- lib/v1/webhooks/webhook_get_request.rb
|
121
|
+
- lib/v1/webhooks/webhook_list_event_subscriptions_request.rb
|
122
|
+
- lib/v1/webhooks/webhook_list_request.rb
|
123
|
+
- lib/v1/webhooks/webhook_update_request.rb
|
124
|
+
- lib/v1/webhooks/webhook_verify_signature_request.rb
|
125
|
+
- spec/integration/test_harness.rb
|
126
|
+
- spec/integration/v1/billing_agreements/agreement_create_spec.rb
|
127
|
+
- spec/integration/v1/billing_plans/plan_create_spec.rb
|
128
|
+
- spec/integration/v1/billing_plans/plan_get_spec.rb
|
129
|
+
- spec/integration/v1/billing_plans/plan_helper.rb
|
130
|
+
- spec/integration/v1/billing_plans/plan_list_spec.rb
|
131
|
+
- spec/integration/v1/billing_plans/plan_update_spec.rb
|
132
|
+
- spec/integration/v1/identity/userinfo_get_spec.rb
|
133
|
+
- spec/integration/v1/invoices/invoice_cancel_spec.rb
|
134
|
+
- spec/integration/v1/invoices/invoice_create_spec.rb
|
135
|
+
- spec/integration/v1/invoices/invoice_delete_external_payment_spec.rb
|
136
|
+
- spec/integration/v1/invoices/invoice_delete_external_refund_spec.rb
|
137
|
+
- spec/integration/v1/invoices/invoice_delete_spec.rb
|
138
|
+
- spec/integration/v1/invoices/invoice_get_spec.rb
|
139
|
+
- spec/integration/v1/invoices/invoice_helper.rb
|
140
|
+
- spec/integration/v1/invoices/invoice_list_spec.rb
|
141
|
+
- spec/integration/v1/invoices/invoice_next_invoice_number_spec.rb
|
142
|
+
- spec/integration/v1/invoices/invoice_qr_code_spec.rb
|
143
|
+
- spec/integration/v1/invoices/invoice_record_payment_spec.rb
|
144
|
+
- spec/integration/v1/invoices/invoice_record_refund_spec.rb
|
145
|
+
- spec/integration/v1/invoices/invoice_remind_spec.rb
|
146
|
+
- spec/integration/v1/invoices/invoice_search_spec.rb
|
147
|
+
- spec/integration/v1/invoices/invoice_send_spec.rb
|
148
|
+
- spec/integration/v1/invoices/invoice_update_spec.rb
|
149
|
+
- spec/integration/v1/invoices/template_create_spec.rb
|
150
|
+
- spec/integration/v1/invoices/template_delete_spec.rb
|
151
|
+
- spec/integration/v1/invoices/template_get_spec.rb
|
152
|
+
- spec/integration/v1/invoices/template_list_spec.rb
|
153
|
+
- spec/integration/v1/invoices/template_update_spec.rb
|
154
|
+
- spec/integration/v1/orders/orders_cancel_spec.rb
|
155
|
+
- spec/integration/v1/orders/orders_create_spec.rb
|
156
|
+
- spec/integration/v1/orders/orders_get_spec.rb
|
157
|
+
- spec/integration/v1/orders/orders_helper.rb
|
158
|
+
- spec/integration/v1/orders/orders_pay_spec.rb
|
159
|
+
- spec/integration/v1/payment_experience/pe_helper.rb
|
160
|
+
- spec/integration/v1/payment_experience/web_profile_create_spec.rb
|
161
|
+
- spec/integration/v1/payment_experience/web_profile_delete_spec.rb
|
162
|
+
- spec/integration/v1/payment_experience/web_profile_get_spec.rb
|
163
|
+
- spec/integration/v1/payment_experience/web_profile_list_spec.rb
|
164
|
+
- spec/integration/v1/payment_experience/web_profile_partial_update_spec.rb
|
165
|
+
- spec/integration/v1/payment_experience/web_profile_update_spec.rb
|
166
|
+
- spec/integration/v1/payments/authorization_capture_spec.rb
|
167
|
+
- spec/integration/v1/payments/authorization_get_spec.rb
|
168
|
+
- spec/integration/v1/payments/authorization_reauthorize_spec.rb
|
169
|
+
- spec/integration/v1/payments/authorization_void_spec.rb
|
170
|
+
- spec/integration/v1/payments/capture_get_spec.rb
|
171
|
+
- spec/integration/v1/payments/capture_refund_spec.rb
|
172
|
+
- spec/integration/v1/payments/order_authorize_spec.rb
|
173
|
+
- spec/integration/v1/payments/order_capture_spec.rb
|
174
|
+
- spec/integration/v1/payments/order_get_spec.rb
|
175
|
+
- spec/integration/v1/payments/order_void_spec.rb
|
176
|
+
- spec/integration/v1/payments/payment_create_spec.rb
|
177
|
+
- spec/integration/v1/payments/payment_execute_spec.rb
|
178
|
+
- spec/integration/v1/payments/payment_get_spec.rb
|
179
|
+
- spec/integration/v1/payments/payment_list_spec.rb
|
180
|
+
- spec/integration/v1/payments/payment_update_spec.rb
|
181
|
+
- spec/integration/v1/payments/payments_helper.rb
|
182
|
+
- spec/integration/v1/payments/refund_get_spec.rb
|
183
|
+
- spec/integration/v1/payments/sale_get_spec.rb
|
184
|
+
- spec/integration/v1/payments/sale_refund_spec.rb
|
185
|
+
- spec/integration/v1/sync/search_get_spec.rb
|
186
|
+
- spec/integration/v1/vault/credit_card_create_spec.rb
|
187
|
+
- spec/integration/v1/vault/credit_card_delete_spec.rb
|
188
|
+
- spec/integration/v1/vault/credit_card_get_spec.rb
|
189
|
+
- spec/integration/v1/vault/credit_card_list_spec.rb
|
190
|
+
- spec/integration/v1/vault/credit_card_update_spec.rb
|
191
|
+
- spec/integration/v1/vault/vault_helper.rb
|
192
|
+
- spec/integration/v1/webhooks/available_event_type_list_spec.rb
|
193
|
+
- spec/integration/v1/webhooks/webhook_create_spec.rb
|
194
|
+
- spec/integration/v1/webhooks/webhook_delete_spec.rb
|
195
|
+
- spec/integration/v1/webhooks/webhook_get_spec.rb
|
196
|
+
- spec/integration/v1/webhooks/webhook_helper.rb
|
197
|
+
- spec/integration/v1/webhooks/webhook_list_event_subscriptions_spec.rb
|
198
|
+
- spec/integration/v1/webhooks/webhook_list_spec.rb
|
199
|
+
- spec/integration/v1/webhooks/webhook_update_spec.rb
|
200
|
+
- spec/integration/v1/webhooks/webhook_verify_signature_spec.rb
|
126
201
|
- spec/spec_helper.rb
|
127
|
-
- spec/
|
128
|
-
- spec/support/sample_data.rb
|
129
|
-
- spec/web_profile_examples_spec.rb
|
130
|
-
- spec/webhooks_examples_spec.rb
|
202
|
+
- spec/unit/paypal_http_client_spec.rb
|
131
203
|
homepage: https://developer.paypal.com
|
132
204
|
licenses:
|
133
205
|
- PayPal SDK License
|
@@ -143,33 +215,91 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
215
|
version: '0'
|
144
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
217
|
requirements:
|
146
|
-
- - "
|
218
|
+
- - ">"
|
147
219
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
220
|
+
version: 1.3.1
|
149
221
|
requirements: []
|
150
222
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.5.2
|
223
|
+
rubygems_version: 2.5.2
|
152
224
|
signing_key:
|
153
225
|
specification_version: 4
|
154
226
|
summary: The PayPal REST SDK provides Ruby APIs to create, process and manage payment.
|
155
227
|
test_files:
|
156
|
-
- spec/
|
157
|
-
- spec/
|
158
|
-
- spec/
|
159
|
-
- spec/
|
160
|
-
- spec/
|
161
|
-
- spec/
|
162
|
-
- spec/
|
163
|
-
- spec/
|
164
|
-
- spec/
|
165
|
-
- spec/
|
166
|
-
- spec/
|
167
|
-
- spec/
|
168
|
-
- spec/
|
169
|
-
- spec/
|
170
|
-
- spec/
|
228
|
+
- spec/integration/test_harness.rb
|
229
|
+
- spec/integration/v1/billing_agreements/agreement_create_spec.rb
|
230
|
+
- spec/integration/v1/billing_plans/plan_create_spec.rb
|
231
|
+
- spec/integration/v1/billing_plans/plan_get_spec.rb
|
232
|
+
- spec/integration/v1/billing_plans/plan_helper.rb
|
233
|
+
- spec/integration/v1/billing_plans/plan_list_spec.rb
|
234
|
+
- spec/integration/v1/billing_plans/plan_update_spec.rb
|
235
|
+
- spec/integration/v1/identity/userinfo_get_spec.rb
|
236
|
+
- spec/integration/v1/invoices/invoice_cancel_spec.rb
|
237
|
+
- spec/integration/v1/invoices/invoice_create_spec.rb
|
238
|
+
- spec/integration/v1/invoices/invoice_delete_external_payment_spec.rb
|
239
|
+
- spec/integration/v1/invoices/invoice_delete_external_refund_spec.rb
|
240
|
+
- spec/integration/v1/invoices/invoice_delete_spec.rb
|
241
|
+
- spec/integration/v1/invoices/invoice_get_spec.rb
|
242
|
+
- spec/integration/v1/invoices/invoice_helper.rb
|
243
|
+
- spec/integration/v1/invoices/invoice_list_spec.rb
|
244
|
+
- spec/integration/v1/invoices/invoice_next_invoice_number_spec.rb
|
245
|
+
- spec/integration/v1/invoices/invoice_qr_code_spec.rb
|
246
|
+
- spec/integration/v1/invoices/invoice_record_payment_spec.rb
|
247
|
+
- spec/integration/v1/invoices/invoice_record_refund_spec.rb
|
248
|
+
- spec/integration/v1/invoices/invoice_remind_spec.rb
|
249
|
+
- spec/integration/v1/invoices/invoice_search_spec.rb
|
250
|
+
- spec/integration/v1/invoices/invoice_send_spec.rb
|
251
|
+
- spec/integration/v1/invoices/invoice_update_spec.rb
|
252
|
+
- spec/integration/v1/invoices/template_create_spec.rb
|
253
|
+
- spec/integration/v1/invoices/template_delete_spec.rb
|
254
|
+
- spec/integration/v1/invoices/template_get_spec.rb
|
255
|
+
- spec/integration/v1/invoices/template_list_spec.rb
|
256
|
+
- spec/integration/v1/invoices/template_update_spec.rb
|
257
|
+
- spec/integration/v1/orders/orders_cancel_spec.rb
|
258
|
+
- spec/integration/v1/orders/orders_create_spec.rb
|
259
|
+
- spec/integration/v1/orders/orders_get_spec.rb
|
260
|
+
- spec/integration/v1/orders/orders_helper.rb
|
261
|
+
- spec/integration/v1/orders/orders_pay_spec.rb
|
262
|
+
- spec/integration/v1/payment_experience/pe_helper.rb
|
263
|
+
- spec/integration/v1/payment_experience/web_profile_create_spec.rb
|
264
|
+
- spec/integration/v1/payment_experience/web_profile_delete_spec.rb
|
265
|
+
- spec/integration/v1/payment_experience/web_profile_get_spec.rb
|
266
|
+
- spec/integration/v1/payment_experience/web_profile_list_spec.rb
|
267
|
+
- spec/integration/v1/payment_experience/web_profile_partial_update_spec.rb
|
268
|
+
- spec/integration/v1/payment_experience/web_profile_update_spec.rb
|
269
|
+
- spec/integration/v1/payments/authorization_capture_spec.rb
|
270
|
+
- spec/integration/v1/payments/authorization_get_spec.rb
|
271
|
+
- spec/integration/v1/payments/authorization_reauthorize_spec.rb
|
272
|
+
- spec/integration/v1/payments/authorization_void_spec.rb
|
273
|
+
- spec/integration/v1/payments/capture_get_spec.rb
|
274
|
+
- spec/integration/v1/payments/capture_refund_spec.rb
|
275
|
+
- spec/integration/v1/payments/order_authorize_spec.rb
|
276
|
+
- spec/integration/v1/payments/order_capture_spec.rb
|
277
|
+
- spec/integration/v1/payments/order_get_spec.rb
|
278
|
+
- spec/integration/v1/payments/order_void_spec.rb
|
279
|
+
- spec/integration/v1/payments/payment_create_spec.rb
|
280
|
+
- spec/integration/v1/payments/payment_execute_spec.rb
|
281
|
+
- spec/integration/v1/payments/payment_get_spec.rb
|
282
|
+
- spec/integration/v1/payments/payment_list_spec.rb
|
283
|
+
- spec/integration/v1/payments/payment_update_spec.rb
|
284
|
+
- spec/integration/v1/payments/payments_helper.rb
|
285
|
+
- spec/integration/v1/payments/refund_get_spec.rb
|
286
|
+
- spec/integration/v1/payments/sale_get_spec.rb
|
287
|
+
- spec/integration/v1/payments/sale_refund_spec.rb
|
288
|
+
- spec/integration/v1/sync/search_get_spec.rb
|
289
|
+
- spec/integration/v1/vault/credit_card_create_spec.rb
|
290
|
+
- spec/integration/v1/vault/credit_card_delete_spec.rb
|
291
|
+
- spec/integration/v1/vault/credit_card_get_spec.rb
|
292
|
+
- spec/integration/v1/vault/credit_card_list_spec.rb
|
293
|
+
- spec/integration/v1/vault/credit_card_update_spec.rb
|
294
|
+
- spec/integration/v1/vault/vault_helper.rb
|
295
|
+
- spec/integration/v1/webhooks/available_event_type_list_spec.rb
|
296
|
+
- spec/integration/v1/webhooks/webhook_create_spec.rb
|
297
|
+
- spec/integration/v1/webhooks/webhook_delete_spec.rb
|
298
|
+
- spec/integration/v1/webhooks/webhook_get_spec.rb
|
299
|
+
- spec/integration/v1/webhooks/webhook_helper.rb
|
300
|
+
- spec/integration/v1/webhooks/webhook_list_event_subscriptions_spec.rb
|
301
|
+
- spec/integration/v1/webhooks/webhook_list_spec.rb
|
302
|
+
- spec/integration/v1/webhooks/webhook_update_spec.rb
|
303
|
+
- spec/integration/v1/webhooks/webhook_verify_signature_spec.rb
|
171
304
|
- spec/spec_helper.rb
|
172
|
-
- spec/
|
173
|
-
- spec/support/sample_data.rb
|
174
|
-
- spec/web_profile_examples_spec.rb
|
175
|
-
- spec/webhooks_examples_spec.rb
|
305
|
+
- spec/unit/paypal_http_client_spec.rb
|