solidus_paypal_commerce_platform 0.3.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +25 -2
  3. data/.rubocop.yml +6 -5
  4. data/CHANGELOG.md +180 -122
  5. data/Gemfile +16 -3
  6. data/README.md +27 -2
  7. data/app/assets/javascripts/spree/frontend/solidus_paypal_commerce_platform/button_actions.js +3 -1
  8. data/app/assets/javascripts/spree/frontend/solidus_paypal_commerce_platform/buttons.js +14 -0
  9. data/app/controllers/solidus_paypal_commerce_platform/orders_controller.rb +1 -1
  10. data/app/controllers/solidus_paypal_commerce_platform/payments_controller.rb +4 -2
  11. data/app/helpers/solidus_paypal_commerce_platform/button_options_helper.rb +4 -0
  12. data/app/models/solidus_paypal_commerce_platform/gateway.rb +20 -3
  13. data/app/models/solidus_paypal_commerce_platform/payment_method.rb +21 -1
  14. data/app/models/solidus_paypal_commerce_platform/payment_source.rb +12 -1
  15. data/app/models/solidus_paypal_commerce_platform/paypal_order.rb +6 -21
  16. data/app/models/solidus_paypal_commerce_platform/wizard.rb +1 -1
  17. data/bin/rails-engine +1 -1
  18. data/config/locales/en.yml +34 -1
  19. data/db/migrate/20211220133406_add_paypal_funding_source_to_paypal_commerce_platform_sources.rb +5 -0
  20. data/lib/paypal/access_token.rb +22 -0
  21. data/lib/paypal/lib.rb +19 -0
  22. data/lib/paypal/paypal_checkout_sdk/orders/orders_authorize_request.rb +44 -0
  23. data/lib/paypal/paypal_checkout_sdk/orders/orders_capture_request.rb +42 -0
  24. data/lib/paypal/paypal_checkout_sdk/orders/orders_create_request.rb +36 -0
  25. data/lib/paypal/paypal_checkout_sdk/orders/orders_get_request.rb +26 -0
  26. data/lib/paypal/paypal_checkout_sdk/orders/orders_patch_request.rb +77 -0
  27. data/lib/paypal/paypal_checkout_sdk/orders/orders_validate_request.rb +34 -0
  28. data/lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb +38 -0
  29. data/lib/paypal/paypal_checkout_sdk/payments/authorizations_get_request.rb +26 -0
  30. data/lib/paypal/paypal_checkout_sdk/payments/authorizations_reauthorize_request.rb +45 -0
  31. data/lib/paypal/paypal_checkout_sdk/payments/authorizations_void_request.rb +27 -0
  32. data/lib/paypal/paypal_checkout_sdk/payments/captures_get_request.rb +26 -0
  33. data/lib/paypal/paypal_checkout_sdk/payments/captures_refund_request.rb +40 -0
  34. data/lib/paypal/paypal_checkout_sdk/payments/refunds_get_request.rb +26 -0
  35. data/lib/paypal/paypal_environment.rb +39 -0
  36. data/lib/paypal/paypal_http_client.rb +56 -0
  37. data/lib/paypal/token_requests.rb +42 -0
  38. data/lib/solidus_paypal_commerce_platform/access_token_authorization_request.rb +1 -1
  39. data/lib/solidus_paypal_commerce_platform/client.rb +4 -4
  40. data/lib/solidus_paypal_commerce_platform/configuration.rb +4 -4
  41. data/lib/solidus_paypal_commerce_platform/engine.rb +11 -3
  42. data/lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/orders/orders_authorize_request.rb +48 -0
  43. data/lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/orders/orders_capture_request.rb +46 -0
  44. data/lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/orders/orders_patch_request.rb +80 -0
  45. data/lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/orders/orders_validate_request.rb +36 -0
  46. data/lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/payments/authorizations_reauthorize_request.rb +50 -0
  47. data/lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/payments/captures_refund_request.rb +43 -0
  48. data/lib/solidus_paypal_commerce_platform/testing_support/factories.rb +2 -1
  49. data/lib/solidus_paypal_commerce_platform/version.rb +1 -1
  50. data/lib/solidus_paypal_commerce_platform.rb +1 -0
  51. data/lib/views/backend/spree/admin/payments/source_views/_paypal_commerce_platform.html.erb +3 -0
  52. data/lib/views/frontend/solidus_paypal_commerce_platform/payments/_payment.html.erb +4 -0
  53. data/lib/views/frontend/spree/checkout/payment/_paypal_commerce_platform.html.erb +17 -3
  54. data/solidus_paypal_commerce_platform.gemspec +9 -8
  55. metadata +52 -78
  56. data/spec/features/backend/new_payment_method_spec.rb +0 -40
  57. data/spec/features/frontend/cart_spec.rb +0 -46
  58. data/spec/features/frontend/checkout_spec.rb +0 -89
  59. data/spec/features/frontend/product_spec.rb +0 -91
  60. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/CHECKOUT.ORDER.COMPLETED.v2.json +0 -121
  61. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/CHECKOUT.ORDER.PROCESSED.v2.json +0 -121
  62. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.COMPLETED.v1.json +0 -50
  63. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.COMPLETED.v2.json +0 -72
  64. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.DENIED.v1.json +0 -50
  65. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.DENIED.v2.json +0 -68
  66. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.REFUNDED.v1.json +0 -51
  67. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.REFUNDED.v2.json +0 -63
  68. data/spec/jobs/solidus_paypal_commerce_platform/webhook_job_spec.rb +0 -44
  69. data/spec/lib/solidus_paypal_commerce_platform/client_spec.rb +0 -21
  70. data/spec/lib/solidus_paypal_commerce_platform/configuration_spec.rb +0 -91
  71. data/spec/models/solidus_paypal_commerce_platform/payment_method_spec.rb +0 -129
  72. data/spec/models/solidus_paypal_commerce_platform/payment_source_spec.rb +0 -62
  73. data/spec/models/solidus_paypal_commerce_platform/paypal_address_spec.rb +0 -67
  74. data/spec/models/solidus_paypal_commerce_platform/paypal_order_spec.rb +0 -33
  75. data/spec/models/solidus_paypal_commerce_platform/state_guesser_spec.rb +0 -38
  76. data/spec/models/solidus_paypal_commerce_platform/wizard_spec.rb +0 -9
  77. data/spec/requests/solidus_paypal_commerce_platform/orders_controller_spec.rb +0 -36
  78. data/spec/requests/solidus_paypal_commerce_platform/shipping_rates_controller_spec.rb +0 -44
  79. data/spec/requests/solidus_paypal_commerce_platform/wizard_controller_spec.rb +0 -44
  80. data/spec/spec_helper.rb +0 -32
  81. data/spec/support/capybara.rb +0 -11
  82. data/spec/support/paypal_sdk_script_tag_helper.rb +0 -13
@@ -1,89 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe "Checkout" do
4
- describe "paypal payment method" do
5
- let(:order) { Spree::TestingSupport::OrderWalkthrough.up_to(:payment) }
6
- let(:paypal_payment_method) { create(:paypal_payment_method) }
7
- let(:failed_response) { OpenStruct.new(status_code: 500) }
8
-
9
- before do
10
- user = create(:user)
11
- order.user = user
12
- order.recalculate
13
-
14
- paypal_payment_method
15
- allow_any_instance_of(Spree::CheckoutController).to receive_messages(
16
- current_order: order, try_spree_current_user: user
17
- )
18
- end
19
-
20
- context "when generating a script tag" do
21
- it "generates a url with the correct credentials attached" do
22
- visit '/checkout/payment'
23
- expect(js_sdk_script_query).to include("client-id=#{paypal_payment_method.preferences[:client_id]}")
24
- end
25
-
26
- it "generates a partner_id attribute with the correct partner code attached" do
27
- visit '/checkout/payment'
28
- expect(js_sdk_script_partner_id).to eq("Solidus_PCP_SP")
29
- end
30
-
31
- it "generates a URL with the correct currency" do
32
- allow(order).to receive(:currency).and_return "EUR"
33
- visit '/checkout/payment'
34
- expect(js_sdk_script_query).to include("currency=EUR")
35
- end
36
-
37
- context "when auto-capture is set to true" do
38
- it "generates a url with intent capture" do
39
- paypal_payment_method.update(auto_capture: true)
40
- visit '/checkout/payment'
41
- expect(js_sdk_script_query).to include("client-id=#{paypal_payment_method.preferences[:client_id]}")
42
- expect(js_sdk_script_query).to include("intent=capture")
43
- end
44
- end
45
- end
46
-
47
- context "when no payment has been made" do
48
- it "fails to process" do
49
- visit '/checkout/payment'
50
- choose(option: paypal_payment_method.id)
51
- click_button("Save and Continue")
52
- expect(page).to have_content("Payments source PayPal order can't be blank")
53
- end
54
- end
55
-
56
- context "when a payment has been made" do
57
- it "proceeds to the next step" do
58
- visit '/checkout/payment'
59
- choose(option: paypal_payment_method.id)
60
- find(:xpath, "//input[@id='payments_source_paypal_order_id']", visible: false).set SecureRandom.hex(8)
61
- click_button("Save and Continue")
62
- expect(page).to have_css(".current", text: "Confirm")
63
- end
64
-
65
- it "records the paypal email address" do
66
- visit '/checkout/payment'
67
- choose(option: paypal_payment_method.id)
68
- find(:xpath, "//input[@id='payments_source_paypal_order_id']", visible: false).set SecureRandom.hex(8)
69
- find(:xpath, "//input[@id='payments_source_paypal_email']", visible: false).set "fake@email.com"
70
- click_button("Save and Continue")
71
- expect(Spree::Payment.last.source.paypal_email).to eq "fake@email.com"
72
- end
73
- end
74
-
75
- context "when a payment fails" do
76
- before { allow_any_instance_of(PayPal::PayPalHttpClient).to receive(:execute) { failed_response } }
77
-
78
- it "redirects the user back to the payments page" do
79
- visit '/checkout/payment'
80
- choose(option: paypal_payment_method.id)
81
- find(:xpath, "//input[@id='payments_source_paypal_order_id']", visible: false).set SecureRandom.hex(8)
82
- click_button("Save and Continue")
83
- click_button("Place Order")
84
- expect(page).to have_current_path("/checkout/payment")
85
- expect(page).to have_content("Your payment was declined")
86
- end
87
- end
88
- end
89
- end
@@ -1,91 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe "Product page", js: true do
4
- describe "paypal button" do
5
- let(:paypal_payment_method) { create(:paypal_payment_method) }
6
- let(:product) { create(:product, variants: [variant, variant_two]) }
7
- let(:store) { create(:store) }
8
- let(:variant) { create(:variant) }
9
- let(:variant_two) { create(:variant) }
10
-
11
- before do
12
- paypal_payment_method
13
- end
14
-
15
- context "when generating a script tag" do
16
- it "generates a url with the correct credentials attached" do
17
- visit "/products/#{product.slug}"
18
- expect(js_sdk_script_query).to include("client-id=#{paypal_payment_method.preferences[:client_id]}")
19
- end
20
-
21
- it "generates a partner_id attribute with the correct partner code attached" do
22
- visit "/products/#{product.slug}"
23
- expect(js_sdk_script_partner_id).to eq("Solidus_PCP_SP")
24
- end
25
-
26
- it "generates a URL with the correct currency" do
27
- allow_any_instance_of(SolidusPaypalCommercePlatform::PricingOptions).to receive(:currency).and_return "EUR"
28
- visit "/products/#{product.slug}"
29
- expect(js_sdk_script_query).to include("currency=EUR")
30
- end
31
-
32
- context "when auto-capture is set to true" do
33
- it "generates a url with intent capture" do
34
- paypal_payment_method.update(auto_capture: true)
35
- visit "/products/#{product.slug}"
36
- expect(js_sdk_script_query).to include("client-id=#{paypal_payment_method.preferences[:client_id]}")
37
- expect(js_sdk_script_query).to include("intent=capture")
38
- end
39
- end
40
- end
41
-
42
- describe "order creation" do
43
- before do
44
- allow_any_instance_of(Spree::Core::ControllerHelpers::Store).to receive(:current_store) { store }
45
- visit "/products/#{product.slug}"
46
-
47
- # Stubbing out paypal methods since their JS doesn't load in correctly on tests
48
- page.execute_script("paypal = {}")
49
- page.execute_script("paypal.render = function(){}")
50
- page.execute_script("paypal.Buttons = function(){return paypal}")
51
-
52
- # Waiting until the paypal button becomes available, because the SPCP namespace
53
- # isn't immediately available
54
- page.find("#paypal-button-container")
55
- end
56
-
57
- it "creates an order successfully" do
58
- page.evaluate_script("SolidusPaypalCommercePlatform.createOrder()")
59
- page.driver.wait_for_network_idle
60
-
61
- expect(Spree::Order.last).not_to be nil
62
- end
63
-
64
- it "sets the Spree number and token variables" do
65
- page.evaluate_script("SolidusPaypalCommercePlatform.createOrder()")
66
- page.driver.wait_for_network_idle
67
-
68
- expect(page.evaluate_script("Spree.current_order_id")).to eq Spree::Order.last.number
69
- expect(page.evaluate_script("Spree.current_order_token")).to eq Spree::Order.last.guest_token
70
- end
71
-
72
- it "uses the specified quantity" do
73
- quantity = 12
74
- fill_in('quantity', with: quantity)
75
-
76
- page.evaluate_script("SolidusPaypalCommercePlatform.createOrder()")
77
- page.driver.wait_for_network_idle
78
-
79
- expect(Spree::Order.last.line_items.first.quantity).to eq quantity
80
- end
81
-
82
- it "uses the selected variant" do
83
- page.choose("variant_id_#{variant_two.id}")
84
- page.evaluate_script("SolidusPaypalCommercePlatform.createOrder()")
85
- page.driver.wait_for_network_idle
86
-
87
- expect(Spree::Order.last.line_items.first.variant_id).to eq variant_two.id
88
- end
89
- end
90
- end
91
- end
@@ -1,121 +0,0 @@
1
- {
2
- "id": "WH-COC11055RA711503B-4YM959094A144403T",
3
- "create_time": "2018-04-16T21:21:49.000Z",
4
- "resource_type": "checkout-order",
5
- "event_type": "CHECKOUT.ORDER.COMPLETED",
6
- "summary": "Checkout Order Completed",
7
- "resource": {
8
- "update_time": "2018-04-01T21:20:49Z",
9
- "create_time": "2018-04-01T21:18:49Z",
10
- "purchase_units": [
11
- {
12
- "reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
13
- "amount": {
14
- "currency_code": "USD",
15
- "value": "100.00"
16
- },
17
- "payee": {
18
- "email_address": "seller@example.com"
19
- },
20
- "shipping": {
21
- "method": "United States Postal Service",
22
- "address": {
23
- "address_line_1": "2211 N First Street",
24
- "address_line_2": "Building 17",
25
- "admin_area_2": "San Jose",
26
- "admin_area_1": "CA",
27
- "postal_code": "95131",
28
- "country_code": "US"
29
- }
30
- },
31
- "payments": {
32
- "captures": [
33
- {
34
- "id": "3C679366HH908993F",
35
- "status": "COMPLETED",
36
- "amount": {
37
- "currency_code": "USD",
38
- "value": "100.00"
39
- },
40
- "seller_protection": {
41
- "status": "ELIGIBLE",
42
- "dispute_categories": [
43
- "ITEM_NOT_RECEIVED",
44
- "UNAUTHORIZED_TRANSACTION"
45
- ]
46
- },
47
- "final_capture": true,
48
- "seller_receivable_breakdown": {
49
- "gross_amount": {
50
- "currency_code": "USD",
51
- "value": "100.00"
52
- },
53
- "paypal_fee": {
54
- "currency_code": "USD",
55
- "value": "3.00"
56
- },
57
- "net_amount": {
58
- "currency_code": "USD",
59
- "value": "97.00"
60
- }
61
- },
62
- "create_time": "2018-04-01T21:20:49Z",
63
- "update_time": "2018-04-01T21:20:49Z",
64
- "links": [
65
- {
66
- "href": "https://api.paypal.com/v2/payments/captures/3C679366HH908993F",
67
- "rel": "self",
68
- "method": "GET"
69
- },
70
- {
71
- "href": "https://api.paypal.com/v2/payments/captures/3C679366HH908993F/refund",
72
- "rel": "refund",
73
- "method": "POST"
74
- }
75
- ]
76
- }
77
- ]
78
- }
79
- }
80
- ],
81
- "links": [
82
- {
83
- "href": "https://api.paypal.com/v2/checkout/orders/5O190127TN364715T",
84
- "rel": "self",
85
- "method": "GET"
86
- }
87
- ],
88
- "id": "5O190127TN364715T",
89
- "gross_amount": {
90
- "currency_code": "USD",
91
- "value": "100.00"
92
- },
93
- "intent": "CAPTURE",
94
- "payer": {
95
- "name": {
96
- "given_name": "John",
97
- "surname": "Doe"
98
- },
99
- "email_address": "buyer@example.com",
100
- "payer_id": "QYR5Z8XDVJNXQ"
101
- },
102
- "status": "COMPLETED"
103
- },
104
- "links": [
105
- {
106
- "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-COC11055RA711503B-4YM959094A144403T",
107
- "rel": "self",
108
- "method": "GET",
109
- "encType": "application/json"
110
- },
111
- {
112
- "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-COC11055RA711503B-4YM959094A144403T/resend",
113
- "rel": "resend",
114
- "method": "POST",
115
- "encType": "application/json"
116
- }
117
- ],
118
- "event_version": "1.0",
119
- "zts": 1494957670,
120
- "resource_version": "2.0"
121
- }
@@ -1,121 +0,0 @@
1
- {
2
- "id": "WH-COC11055RA711503B-4YM959094A144403T",
3
- "create_time": "2018-04-16T21:21:49.000Z",
4
- "resource_type": "checkout-order",
5
- "event_type": "CHECKOUT.ORDER.COMPLETED",
6
- "summary": "Checkout Order Completed",
7
- "resource": {
8
- "update_time": "2018-04-01T21:20:49Z",
9
- "create_time": "2018-04-01T21:18:49Z",
10
- "purchase_units": [
11
- {
12
- "reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
13
- "amount": {
14
- "currency_code": "USD",
15
- "value": "100.00"
16
- },
17
- "payee": {
18
- "email_address": "seller@example.com"
19
- },
20
- "shipping": {
21
- "method": "United States Postal Service",
22
- "address": {
23
- "address_line_1": "2211 N First Street",
24
- "address_line_2": "Building 17",
25
- "admin_area_2": "San Jose",
26
- "admin_area_1": "CA",
27
- "postal_code": "95131",
28
- "country_code": "US"
29
- }
30
- },
31
- "payments": {
32
- "captures": [
33
- {
34
- "id": "3C679366HH908993F",
35
- "status": "COMPLETED",
36
- "amount": {
37
- "currency_code": "USD",
38
- "value": "100.00"
39
- },
40
- "seller_protection": {
41
- "status": "ELIGIBLE",
42
- "dispute_categories": [
43
- "ITEM_NOT_RECEIVED",
44
- "UNAUTHORIZED_TRANSACTION"
45
- ]
46
- },
47
- "final_capture": true,
48
- "seller_receivable_breakdown": {
49
- "gross_amount": {
50
- "currency_code": "USD",
51
- "value": "100.00"
52
- },
53
- "paypal_fee": {
54
- "currency_code": "USD",
55
- "value": "3.00"
56
- },
57
- "net_amount": {
58
- "currency_code": "USD",
59
- "value": "97.00"
60
- }
61
- },
62
- "create_time": "2018-04-01T21:20:49Z",
63
- "update_time": "2018-04-01T21:20:49Z",
64
- "links": [
65
- {
66
- "href": "https://api.paypal.com/v2/payments/captures/3C679366HH908993F",
67
- "rel": "self",
68
- "method": "GET"
69
- },
70
- {
71
- "href": "https://api.paypal.com/v2/payments/captures/3C679366HH908993F/refund",
72
- "rel": "refund",
73
- "method": "POST"
74
- }
75
- ]
76
- }
77
- ]
78
- }
79
- }
80
- ],
81
- "links": [
82
- {
83
- "href": "https://api.paypal.com/v2/checkout/orders/5O190127TN364715T",
84
- "rel": "self",
85
- "method": "GET"
86
- }
87
- ],
88
- "id": "5O190127TN364715T",
89
- "gross_amount": {
90
- "currency_code": "USD",
91
- "value": "100.00"
92
- },
93
- "intent": "CAPTURE",
94
- "payer": {
95
- "name": {
96
- "given_name": "John",
97
- "surname": "Doe"
98
- },
99
- "email_address": "buyer@example.com",
100
- "payer_id": "QYR5Z8XDVJNXQ"
101
- },
102
- "status": "COMPLETED"
103
- },
104
- "links": [
105
- {
106
- "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-COC11055RA711503B-4YM959094A144403T",
107
- "rel": "self",
108
- "method": "GET",
109
- "encType": "application/json"
110
- },
111
- {
112
- "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-COC11055RA711503B-4YM959094A144403T/resend",
113
- "rel": "resend",
114
- "method": "POST",
115
- "encType": "application/json"
116
- }
117
- ],
118
- "event_version": "1.0",
119
- "zts": 1494957670,
120
- "resource_version": "2.0"
121
- }
@@ -1,50 +0,0 @@
1
- {
2
- "id": "WH-7Y7254563A4550640-11V2185806837105M",
3
- "create_time": "2015-02-17T18:51:33Z",
4
- "resource_type": "capture",
5
- "event_type": "PAYMENT.CAPTURE.COMPLETED",
6
- "summary": "Payment completed for $ 7.47 USD",
7
- "resource": {
8
- "parent_payment": "PAY-3YE025760C441402AKTRY2PQ",
9
- "update_time": "2015-02-17T18:50:45Z",
10
- "amount": {
11
- "total": "7.47",
12
- "currency": "USD"
13
- },
14
- "create_time": "2015-02-17T18:50:44Z",
15
- "links": [
16
- {
17
- "href": "https://api.paypal.com/v1/payments/capture/42311647XV020574X",
18
- "rel": "self",
19
- "method": "GET"
20
- },
21
- {
22
- "href": "https://api.paypal.com/v1/payments/capture/42311647XV020574X/refund",
23
- "rel": "refund",
24
- "method": "POST"
25
- },
26
- {
27
- "href": "https://api.paypal.com/v1/payments/payment/PAY-3YE025760C441402AKTRY2PQ",
28
- "rel": "parent_payment",
29
- "method": "GET"
30
- }
31
- ],
32
- "id": "42311647XV020574X",
33
- "state": "completed"
34
- },
35
- "links": [
36
- {
37
- "href": "https://api.paypal.com/v1/notifications/webhooks-events/WH-7Y7254563A4550640-11V2185806837105M",
38
- "rel": "self",
39
- "method": "GET",
40
- "encType": "application/json"
41
- },
42
- {
43
- "href": "https://api.paypal.com/v1/notifications/webhooks-events/WH-7Y7254563A4550640-11V2185806837105M/resend",
44
- "rel": "resend",
45
- "method": "POST",
46
- "encType": "application/json"
47
- }
48
- ],
49
- "event_version": "1.0"
50
- }
@@ -1,72 +0,0 @@
1
- {
2
- "id": "WH-58D329510W468432D-8HN650336L201105X",
3
- "create_time": "2019-02-14T21:50:07.940Z",
4
- "resource_type": "capture",
5
- "event_type": "PAYMENT.CAPTURE.COMPLETED",
6
- "summary": "Payment completed for $ 2.51 USD",
7
- "resource": {
8
- "amount": {
9
- "currency_code": "USD",
10
- "value": "2.51"
11
- },
12
- "seller_protection": {
13
- "status": "ELIGIBLE",
14
- "dispute_categories": [
15
- "ITEM_NOT_RECEIVED",
16
- "UNAUTHORIZED_TRANSACTION"
17
- ]
18
- },
19
- "update_time": "2019-02-14T21:49:58Z",
20
- "create_time": "2019-02-14T21:49:58Z",
21
- "final_capture": true,
22
- "seller_receivable_breakdown": {
23
- "gross_amount": {
24
- "currency_code": "USD",
25
- "value": "2.51"
26
- },
27
- "paypal_fee": {
28
- "currency_code": "USD",
29
- "value": "0.37"
30
- },
31
- "net_amount": {
32
- "currency_code": "USD",
33
- "value": "2.14"
34
- }
35
- },
36
- "links": [
37
- {
38
- "href": "https://api.paypal.com/v2/payments/captures/27M47624FP291604U",
39
- "rel": "self",
40
- "method": "GET"
41
- },
42
- {
43
- "href": "https://api.paypal.com/v2/payments/captures/27M47624FP291604U/refund",
44
- "rel": "refund",
45
- "method": "POST"
46
- },
47
- {
48
- "href": "https://api.paypal.com/v2/payments/authorizations/7W5147081L658180V",
49
- "rel": "up",
50
- "method": "GET"
51
- }
52
- ],
53
- "id": "27M47624FP291604U",
54
- "status": "COMPLETED"
55
- },
56
- "links": [
57
- {
58
- "href": "https://api.paypal.com/v1/notifications/webhooks-events/WH-58D329510W468432D-8HN650336L201105X",
59
- "rel": "self",
60
- "method": "GET",
61
- "encType": "application/json"
62
- },
63
- {
64
- "href": "https://api.paypal.com/v1/notifications/webhooks-events/WH-58D329510W468432D-8HN650336L201105X/resend",
65
- "rel": "resend",
66
- "method": "POST",
67
- "encType": "application/json"
68
- }
69
- ],
70
- "event_version": "1.0",
71
- "resource_version": "2.0"
72
- }
@@ -1,50 +0,0 @@
1
- {
2
- "id": "WH-8Y6524781B2662740-6BA13970S75831204",
3
- "create_time": "2015-10-07T16:58:15Z",
4
- "resource_type": "capture",
5
- "event_type": "PAYMENT.CAPTURE.DENIED",
6
- "summary": "A EUR 0.5 EUR capture payment was denied",
7
- "resource": {
8
- "parent_payment": "PAY-6AG64245W53716013KYKUWNI",
9
- "update_time": "2015-10-07T16:42:57Z",
10
- "amount": {
11
- "total": "0.50",
12
- "currency": "EUR"
13
- },
14
- "create_time": "2015-10-07T16:42:50Z",
15
- "links": [
16
- {
17
- "href": "https://api.paypal.com/v1/payments/capture/1YH34677BD7819356",
18
- "rel": "self",
19
- "method": "GET"
20
- },
21
- {
22
- "href": "https://api.paypal.com/v1/payments/capture/1YH34677BD7819356/refund",
23
- "rel": "refund",
24
- "method": "POST"
25
- },
26
- {
27
- "href": "https://api.paypal.com/v1/payments/payment/PAY-6AG64245W53716013KYKUWNI",
28
- "rel": "parent_payment",
29
- "method": "GET"
30
- }
31
- ],
32
- "id": "1YH34677BD7819356",
33
- "state": "denied"
34
- },
35
- "links": [
36
- {
37
- "href": "https://api.paypal.com/v1/notifications/webhooks-events/WH-8Y6524781B2662740-6BA13970S75831204",
38
- "rel": "self",
39
- "method": "GET",
40
- "encType": "application/json"
41
- },
42
- {
43
- "href": "https://api.paypal.com/v1/notifications/webhooks-events/WH-8Y6524781B2662740-6BA13970S75831204/resend",
44
- "rel": "resend",
45
- "method": "POST",
46
- "encType": "application/json"
47
- }
48
- ],
49
- "event_version": "1.0"
50
- }
@@ -1,68 +0,0 @@
1
- {
2
- "id": "WH-4SW78779LY2325805-07E03580SX1414828",
3
- "create_time": "2019-02-14T22:20:08.370Z",
4
- "resource_type": "capture",
5
- "event_type": "PAYMENT.CAPTURE.DENIED",
6
- "summary": "A AUD 2.51 AUD capture payment was denied",
7
- "resource": {
8
- "amount": {
9
- "currency_code": "AUD",
10
- "value": "2.51"
11
- },
12
- "seller_protection": {
13
- "status": "ELIGIBLE",
14
- "dispute_categories": [
15
- "ITEM_NOT_RECEIVED",
16
- "UNAUTHORIZED_TRANSACTION"
17
- ]
18
- },
19
- "update_time": "2019-02-14T22:20:01Z",
20
- "create_time": "2019-02-14T22:18:14Z",
21
- "final_capture": true,
22
- "seller_receivable_breakdown": {
23
- "gross_amount": {
24
- "currency_code": "AUD",
25
- "value": "2.51"
26
- },
27
- "net_amount": {
28
- "currency_code": "AUD",
29
- "value": "2.51"
30
- }
31
- },
32
- "links": [
33
- {
34
- "href": "https://api.paypal.com/v2/payments/captures/7NW873794T343360M",
35
- "rel": "self",
36
- "method": "GET"
37
- },
38
- {
39
- "href": "https://api.paypal.com/v2/payments/captures/7NW873794T343360M/refund",
40
- "rel": "refund",
41
- "method": "POST"
42
- },
43
- {
44
- "href": "https://api.paypal.com/v2/payments/authorizations/2W543679LP5841156",
45
- "rel": "up",
46
- "method": "GET"
47
- }
48
- ],
49
- "id": "7NW873794T343360M",
50
- "status": "DECLINED"
51
- },
52
- "links": [
53
- {
54
- "href": "https://api.paypal.com/v1/notifications/webhooks-events/WH-4SW78779LY2325805-07E03580SX1414828",
55
- "rel": "self",
56
- "method": "GET",
57
- "encType": "application/json"
58
- },
59
- {
60
- "href": "https://api.paypal.com/v1/notifications/webhooks-events/WH-4SW78779LY2325805-07E03580SX1414828/resend",
61
- "rel": "resend",
62
- "method": "POST",
63
- "encType": "application/json"
64
- }
65
- ],
66
- "event_version": "1.0",
67
- "resource_version": "2.0"
68
- }