From 73f0b3005d7a9e5d60b69ecd9df3d9d711143714 Mon Sep 17 00:00:00 2001 From: Adam Mueller Date: Fri, 2 Sep 2016 13:33:21 -0700 Subject: [PATCH 1/2] Clean-up gateway spec a tiny bit --- .../solidus_paypal_braintree_gateway.yml | 267 ++++++++---------- .../solidus_paypal_braintree/gateway_spec.rb | 5 +- 2 files changed, 126 insertions(+), 146 deletions(-) diff --git a/spec/fixtures/cassettes/solidus_paypal_braintree_gateway.yml b/spec/fixtures/cassettes/solidus_paypal_braintree_gateway.yml index 71d2c6ee..c9a63fbb 100644 --- a/spec/fixtures/cassettes/solidus_paypal_braintree_gateway.yml +++ b/spec/fixtures/cassettes/solidus_paypal_braintree_gateway.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://api.sandbox.braintreegateway.com/merchants/mwjkkxwcp32ckhnf/transactions + uri: https://api.sandbox.braintreegateway.com/merchants/7rdg92j7bm7fk5h3/transactions body: encoding: UTF-8 string: | @@ -26,78 +26,16 @@ http_interactions: X-Apiversion: - '4' Authorization: - - Basic YTkyOThmNDNiMzBjNjk5ZGIzMDcyY2M0YTAwZjdmNDk6N3JkZzkyajdibTdmazVoMw== - Content-Type: - - application/xml - response: - status: - code: 401 - message: Unauthorized - headers: - Date: - - Thu, 01 Sep 2016 22:27:50 GMT - Content-Type: - - application/xml; charset=utf-8 - Transfer-Encoding: - - chunked - X-Frame-Options: - - SAMEORIGIN - - SAMEORIGIN - X-Xss-Protection: - - 1; mode=block - X-Content-Type-Options: - - nosniff - Www-Authenticate: - - Basic realm="Braintree API" - Vary: - - Accept-Encoding - Content-Encoding: - - gzip - Cache-Control: - - no-cache - X-Request-Id: - - acfc2d14-0ebd-4237-aaf4-814a69252495 - X-Runtime: - - '0.026260' - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - body: - encoding: ASCII-8BIT - string: !binary |- - H4sIAGaryFcAA/IICQlQcEoszky2UnBMTk4tLlZISc3LTE3R4wIAAAD//wMA - aO1LWhsAAAA= - http_version: - recorded_at: Thu, 01 Sep 2016 22:28:27 GMT -- request: - method: post - uri: https://api.sandbox.braintreegateway.com/merchants/mwjkkxwcp32ckhnf/client_token - body: - encoding: UTF-8 - string: | - - - 2 - - headers: - Accept-Encoding: - - gzip - Accept: - - application/xml - User-Agent: - - Braintree Ruby Gem 2.66.0 - X-Apiversion: - - '4' - Authorization: - - Basic YTkyOThmNDNiMzBjNjk5ZGIzMDcyY2M0YTAwZjdmNDk6N3JkZzkyajdibTdmazVoMw== + - Basic bXdqa2t4d2NwMzJja2huZjphOTI5OGY0M2IzMGM2OTlkYjMwNzJjYzRhMDBmN2Y0OQ== Content-Type: - application/xml response: status: - code: 401 - message: Unauthorized + code: 201 + message: Created headers: Date: - - Thu, 01 Sep 2016 22:27:51 GMT + - Fri, 02 Sep 2016 20:34:22 GMT Content-Type: - application/xml; charset=utf-8 Transfer-Encoding: @@ -109,27 +47,65 @@ http_interactions: - 1; mode=block X-Content-Type-Options: - nosniff - Www-Authenticate: - - Basic realm="Braintree API" + X-Authentication: + - basic_auth + X-User: + - 3v249hqtptsg744y Vary: - Accept-Encoding Content-Encoding: - gzip + Etag: + - W/"3b4833b9db137b18be7a5f9d327274df" Cache-Control: - - no-cache + - max-age=0, private, must-revalidate X-Request-Id: - - f37fa0da-fd8d-4405-8a3c-386c253254ae + - 7f1a5a7c-2bac-4490-9bc1-03dfe9eaa7ca X-Runtime: - - '0.022600' + - '0.441452' Strict-Transport-Security: - max-age=31536000; includeSubDomains body: encoding: ASCII-8BIT string: !binary |- - H4sIAGeryFcAA/IICQlQcEoszky2UnBMTk4tLlZISc3LTE3R4wIAAAD//wMA - aO1LWhsAAAA= + H4sIAE7iyVcAA+xYS3PbNhC+51d4dIepl2UpIzNxYjfjjg+ZJD60Fw9IrETU + JMACoCzl13dBkBQpgrEP6Uxm2pu0++GxD+x+y/W7fZae7UBpLsXVaHI+Hp2B + iCXjYns1evj2G1mO3oVv1kZRoWlsEBW+OTtbcxZmajFT84yuA/xjZ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/F1C9IRRjFDgW295zso8TRCaJZk8Dj6bRV+Sv + +2iq2YMkHFNQHTo9vumPJQJwoyow9qUhi0ZFlr+SWTf4ZodqxjlSiPbYUyKG + JhfnIY0Etsns9/XgYnMbebyuSbu9aouZaIlFCkKac7xSX+4MDvoW/8tOwKEq + 4wbz+HEj1eORK/2XXeIZhn8tFzSS6u24JphSP/8tIh0rng/y45a+aVkl+Sc5 + 8jHJCFJQYr3pKQEnSLyWMl4sXvnkHMsECDZ9D7lnXJdVzKsDt4usW9hATxqa + S7GF9O/W3RSJs/2ggXYNFLZG78hAQoWA/q4Y851lLxuAId5hj5XPxEWzp0U3 + RIXSbnZhYHA013V/6qj8sWkNPv7ju5jeN5xXwmFvHYDNWfmvYYdAzFSk674N + izj2zDUYkQHbreV5YcCXGhWxIFwg/S7cIGk/XKE8p+lj9R1oHQzhuuS2ZWuX + A89PGPIg8OX9Slb8UQqcLbMucR5El3Q1wRJD8LnZPAS0YyM9U7U1+kV2ijBs + 8+Vnn7D8/R72WBNTcIWrrW4WOOex8PP1H+RyvprNVmx+eXE5iacbNoMZTBeX + q5aXa2bRHUpQ/PX6/pZMNixazi7YkkbRxXg5x8J6ivtZJNO55PUcEwlhsbUX + uLn98PCJLC/ZeHqxmsWT+apki0559COQoc9n7aHVV6tKLzuP3n55vLshbHF5 + MR9HiwmeOF2xSR2JznmKHL9JhL/LRNSolriNbj5ShDcSauxRWD/xNEUxZqKp + ps2qC97e3326+3B/i5V8CFLPC7kp05KFH68/f3v4cosWIf07iuvPEwOflU56 + 5LF+hth5J91G2VL6Vw58sX4ZVudA07T6Rap+Y53twjf/AAAA//8DAMH9qZGh + FwAA http_version: - recorded_at: Thu, 01 Sep 2016 22:28:28 GMT + recorded_at: Fri, 02 Sep 2016 20:34:22 GMT - request: method: post uri: https://api.sandbox.braintreegateway.com/merchants/7rdg92j7bm7fk5h3/transactions @@ -165,7 +141,7 @@ http_interactions: message: Created headers: Date: - - Thu, 01 Sep 2016 22:31:03 GMT + - Fri, 02 Sep 2016 20:34:23 GMT Content-Type: - application/xml; charset=utf-8 Transfer-Encoding: @@ -186,56 +162,56 @@ http_interactions: Content-Encoding: - gzip Etag: - - W/"25be859aad7a1ac36310be7163479fe0" + - W/"506bcda25df5effdc754bcac541996e8" Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 864ed6c3-8597-49ca-97ba-9b5d125cdac1 + - fc469160-b274-453d-b09d-30c1136fe222 X-Runtime: - - '0.490781' + - '0.472109' Strict-Transport-Security: - max-age=31536000; includeSubDomains body: encoding: ASCII-8BIT string: !binary |- - H4sIACesyFcAA+xYS3PbNhC+51d4dIdJvWwpIzNxYjfjjg+ZJD60Fw9ILkXU - JMACoCz113dBkBQpgrE7k85kpr1Jux8e+8Dut9y82+fZ2Q6kYoJfTabn/uQM - eCRixrdXk4dvv5DV5F3wZqMl5YpGGlHBm7OzDYuD8HL1HNL1buPhHyNTmupS - BQq0znD5xqsFRqcPBQSKZrDxqp9GFpVS4lkHwpQgeCQED19vNt5QbMA0FyXX - wXLp++e+v/Hq/0aVg4xSyjWhUWSEBO+jNOShyPTGc2mr25YhcejOOMuuJlqW - MPHs7hT3kq+CChkj0qGIJFANMaH6zFh/NYnxr2Y5TIKZP70g/pr402+z2dv5 - 9K0//x190C6o1pdF/M/WHxfUnlZaoAXmjw3ecna5XC/nsyZ4KE2YVJpwmsPp - /VGZ0XFdJPKC8oNDAzllmUP+DKFi2rVXkQrukid0P/Cq1zVrE7LMZF1romuT - H2+h0hIAkyKOJSjlcsFeA49NKEYhmYhoxrRrewlbfHEuPwl8XFn1PJz3xQyV - h3FzrNqsJjQrUjp7FWr+EoqXGA0WDSPVCQ7alJQ8dj2TVqPqNKdS0kNPiY7s - lCLXJgWVmqFrqjIEOeBT7a9wbU5LnQrJ/np5+862IdVR6sSkrCj+z8WfNBe7 - 0akrI0kYZLGqc2GnCEgpJEEfFYIrcJpW4Tqm99HBHbao7wKaLfpRc+/yXUxl - xm43XDkUGugWG8MzPaDm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gc7qK/eVms6HJ5XwNr5ds + s+p5ueUXw9EExV+vP92SzfqCxYsFi9cXl3Hkb7CwnuJ+FtWsXfJypom0sNza + C9zcvr//SBbLJInBXy03LKk4Y608+hHI1Ee0/ujqqlWVl2uP3n55uLsh1Acf + Fsl6HQFdREu/jcTgPEWOXybC32UqWlRP3Ed3nyrCGwkt9ihsn3iWoRgz0TQz + Z9MHbz/dfbx7/+kWK/kUpJ0aClOlJQs/XH/+dv/lFi1CEngUtx8pJj4unfTI + Y/0MsfPOh42yp3SvnPhy/TyszYGuaY2LVPvGBtuFr/4BAAD//wMAHRS8f6kX + AAA= http_version: - recorded_at: Thu, 01 Sep 2016 22:31:40 GMT + recorded_at: Fri, 02 Sep 2016 20:34:23 GMT - request: method: post uri: https://api.sandbox.braintreegateway.com/merchants/7rdg92j7bm7fk5h3/client_token @@ -265,7 +241,7 @@ http_interactions: message: Created headers: Date: - - Thu, 01 Sep 2016 22:31:03 GMT + - Fri, 02 Sep 2016 20:34:24 GMT Content-Type: - application/xml; charset=utf-8 Transfer-Encoding: @@ -286,41 +262,44 @@ http_interactions: Content-Encoding: - gzip Etag: - - W/"08b3516b43e58c0700c152fe3b626656" + - W/"8cc2b6eb6a69110d84853cb2ce2f8886" Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 928ece74-35fb-485e-bce3-0cb1b8787df3 + - d9497b7e-44f8-4ef9-bf25-9a93ccb6c5dc X-Runtime: - - '0.124676' + - '0.109371' Strict-Transport-Security: - max-age=31536000; includeSubDomains body: encoding: ASCII-8BIT string: !binary |- - H4sIACesyFcAA6RVX2+bOhR/76eo+r47YsLukNpOTVoIKHYWQmzsN8DpAtgQ - lQQCn36HpO06KXeadB+iCHx8zvn9OYfbb0etrpvNS51V5d3N6B/j5npTppXM - yh93N+vQ+fT15tv91W2qsk25/7Svik15f3V9fdvE6rC533Q+EpHfx8w+eHnV - zaf+VkZBlZj+bqMdY3gfaHUQiHbpzN8l5TJbZH6xCP2C5NjEuddi1+v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PXoD+N/o/2 + l7gr/oWZiMoUWTqfmz1w0JO4fz5HHQE8Y23zqv7v/kHPNjO4q7ADjxqrIwFc + QV/0wKR1Ap+f+KPZhTLSOLKGdHjh/8rMdbDVYLeYQtXl8B/wqt2Gn+cfasNO + bBnawTy86neH4ZyqJSrVWxbbI/Q//PaeP6j5gV3snA+Z5K/5H69549V8zgjs + EcCibePLXoC8R/Bty5WeEuushn4lNrcJ7jbIqugW9BFRGMw967IHxWnSbheB + /72WqjySwtxgxdXLbvuF/fp+U96hUEfvpv4QlRdNZz3ssg3oXKzrtmBGkPOl + 2muKA9B16vuCn9VikaFg8nYU+ZOnYW5AW7Pc73BHnZ3qL9ppk9/f4FIcpjHs + 0sRVMS//5mZFE3IitZenqoYE/WsMmumA8aytpOgUTmZEPXOsAbirnr1g+MVa + tAWXYiTTftNzwK/uopzJCUMOOty5QreeNg8P9x8u9++7+w9vb+afAAAA//8D + AGJXsZLQBwAA http_version: - recorded_at: Thu, 01 Sep 2016 22:31:40 GMT + recorded_at: Fri, 02 Sep 2016 20:34:24 GMT recorded_with: VCR 3.0.3 diff --git a/spec/models/solidus_paypal_braintree/gateway_spec.rb b/spec/models/solidus_paypal_braintree/gateway_spec.rb index f0494457..770e195a 100644 --- a/spec/models/solidus_paypal_braintree/gateway_spec.rb +++ b/spec/models/solidus_paypal_braintree/gateway_spec.rb @@ -4,6 +4,7 @@ vcr_options = { cassette_name: "solidus_paypal_braintree_gateway", + match_requests_on: [:method, :uri, :body], record: :new_episodes } @@ -23,10 +24,10 @@ it 'returns a successful billing response', aggregate_failures: true do expect(purchase).to be_a ActiveMerchant::Billing::Response - expect(purchase.success?).to be true + expect(purchase).to be_success + expect(purchase).to be_test expect(purchase.message).to eq 'settling' expect(purchase.authorization).to be_present - expect(purchase.test).to be true end end From 6bc2cc994e6b923a538132c65176ba5dfb545241 Mon Sep 17 00:00:00 2001 From: Adam Mueller Date: Fri, 2 Sep 2016 13:35:03 -0700 Subject: [PATCH 2/2] Allow voiding a transaction --- .../solidus_paypal_braintree/gateway.rb | 9 +- .../solidus_paypal_braintree_gateway.yml | 418 +++++++++++++----- .../solidus_paypal_braintree/gateway_spec.rb | 19 + 3 files changed, 331 insertions(+), 115 deletions(-) diff --git a/app/models/solidus_paypal_braintree/gateway.rb b/app/models/solidus_paypal_braintree/gateway.rb index 3cd50971..5cc33c44 100644 --- a/app/models/solidus_paypal_braintree/gateway.rb +++ b/app/models/solidus_paypal_braintree/gateway.rb @@ -49,9 +49,14 @@ def credit(_money, _source, _response_code, _gateway_options) raise NotImplementedError end + # Used to cancel a transaction before it is settled. + # + # @api public + # @param response_code [String] the transaction id of the payment to void # @return [Response] - def void(_response_code, _source, _gateway_options) - raise NotImplementedError + def void(response_code, _source, _gateway_options) + result = Braintree::Transaction.void(response_code) + Response.build(result) end def create_profile(_payment) diff --git a/spec/fixtures/cassettes/solidus_paypal_braintree_gateway.yml b/spec/fixtures/cassettes/solidus_paypal_braintree_gateway.yml index c9a63fbb..1b51a54d 100644 --- a/spec/fixtures/cassettes/solidus_paypal_braintree_gateway.yml +++ b/spec/fixtures/cassettes/solidus_paypal_braintree_gateway.yml @@ -35,7 +35,7 @@ http_interactions: message: Created headers: Date: - - Fri, 02 Sep 2016 20:34:22 GMT + - Fri, 02 Sep 2016 20:34:51 GMT Content-Type: - application/xml; charset=utf-8 Transfer-Encoding: @@ -56,56 +56,55 @@ http_interactions: Content-Encoding: - gzip Etag: - - W/"3b4833b9db137b18be7a5f9d327274df" + - W/"f9ca91dbc80957aa95a1318d413ff453" Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - 7f1a5a7c-2bac-4490-9bc1-03dfe9eaa7ca + - 1045cb1c-9369-4e8a-a8f1-cc8186d11c17 X-Runtime: - - '0.441452' + - '0.600035' Strict-Transport-Security: - max-age=31536000; includeSubDomains body: encoding: ASCII-8BIT string: !binary |- - H4sIAE7iyVcAA+xYS3PbNhC+51d4dIepl2UpIzNxYjfjjg+ZJD60Fw9IrETU - JMAC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NA29TZpaXdVDH + mjbJW8KJdewA7cjqTdO9klkH0QhqN2pdYprDMiWeDpietJ825ZpYLRUJdFcd + KhufSVYmFZ/uuK2VOVAp+J8l1HcIxXgKHJPt4DrZywkil0Szp5FL0+pr8te/ + NHXvQVKOIaj2vRrf1scKAThRfTD2piGLRkVevJJZt/h2hrrHOVCIbttTIcY6 + F+chjQS2jez3TeNiYxt5vG5Iu91qh5loiUkKIlpw3NJQ7gwOhhb/y07Apirn + BuP4cS3V44Er/Zdd4mmGfy4XtJL67rgimFE//y1jnShejPLjjr4tWRX5JwXy + MckIUlBivelJAUdI3JYyXixu+WgdywQIFn0PuWdcV1nMqwM3i2xK2EhNGutL + sYQM99afFImzfdBAu0YSW6t3ZCClQsBwVjzzrWUva4Ax3mGXlc/EneZAi26I + S6Vd78LAYGuum/rUU/nPptP4+JfvYwZvOK+Ew846AIuz8m/DNoEYqUjXfROW + SeLpa/BERmy3lhelAV9o1MSCcIH0u3SNpH24QnlBs8f6HSgMxnB9ctuxtc+B + F0cMeRT48nwVK/4oBfaWeZ84j6IruppiiiF43WwcAtqxlp6u2hr9IjtFGJb5 + 6tknqv6/hx3mxAxc4uqq2wHOeSz6fP0boTGszlbnsLg4P79I6CVbrtkZXbCO + lxtm0W9KUPz1+v6WsOWUzi6XNFkk8WyVzDGxHuN+FMl0Lnk9x0RCWG7sBm5u + Pzx8wmu2XCyW89V0tZxVbNEpD34EMvZ81m1afbmq8rLz6O2Xx7sbssA2LJ4v + 6PICIDmbzZuT6K2nyOFNIvpVpqJBdcRddPtIEd1IaLAHYXPFswzFGImm7jbr + Knh7f/fp7sP9LWbyMUjTLxSmCksWfbz+/O3hyy1ahPTvIG6eJ0aelY5q5CF/ + Rlh5Z/1C2VH6R468WL8Ma2KgLVrDJNXcsd500Zu/AQAA//8DAJB5kZyhFwAA http_version: - recorded_at: Fri, 02 Sep 2016 20:34:22 GMT + recorded_at: Fri, 02 Sep 2016 20:34:51 GMT - request: method: post uri: https://api.sandbox.braintreegateway.com/merchants/7rdg92j7bm7fk5h3/transactions @@ -141,7 +140,202 @@ http_interactions: message: Created headers: Date: - - Fri, 02 Sep 2016 20:34:23 GMT + - Fri, 02 Sep 2016 20:34:52 GMT + Content-Type: + - application/xml; charset=utf-8 + Transfer-Encoding: + - chunked + X-Frame-Options: + - SAMEORIGIN + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Authentication: + - basic_auth + X-User: + - 3v249hqtptsg744y + Vary: + - Accept-Encoding + Content-Encoding: + - gzip + Etag: + - W/"cc4e5f98e45d538f1eb6fa5639e036ac" + Cache-Control: + - max-age=0, private, must-revalidate + X-Request-Id: + - ac5d24fd-170f-4ead-bb7b-84dafd945ea1 + X-Runtime: + - '0.457735' + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAGziyVcAA+xYS3PbNhC+51d4dIdJPWJbGZmJE7sZd3LIJPGhvXhAYCki + JgEWAGWpv74LvkSaYOxDOpOZ9ibtfnjsA7vfcvN2n2cnO9BGKHk5m5+GsxOQ + THEht5ezu2+/kYvZ2+jVxmoqDWUWUdGrk5ON4BF7sMmCsmQT4B8nM5ba0kQG + rM1w+SZoBE5nDwVEhmawCaqfTsZKrfGsAxFGETwSoruv15tgLHZgmqtS2uj1 + 6zA8DcNN0Px3qhw0S6m0hDLmhATvYyzkscrsJvBpq9uWMfHoTqTILmdWlzAL + 6t0p7qVfBFWaI9KjYBqoBU6oPXHWX844/rUih1m0COdnJFyTcPFtEb5Zrt68 + nv+JPugWVOvLgr98/QLXHxc0njZWoQXuTx28ebharS7WYRs8lCZCG0skzeHp + /VGZ0WkdU3lB5cGjgZyKzCN/hNgI69urSJX0yRO6H3k16Ju1iUXmsq4z0bfJ + z7fQWA2AScG5BmN8LthbkNyFYhKSKUYzYX3ba9jii/P5SeHjyqrn4b0vZqg+ + TJtTq91qQrMipYsXoZbPoWSJ0RBsHKlecNCmpJTc90w6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J253lRWnBlxoNvSBCIgkv63HSfcBCeUGz++Zr0CaYwg0pbs/W + IRNePeHJk8Dn96u48QclccLMh/R5El2R1hRLDMHn5vIQ0I5EeWZrZ/SzHBVh + 2Oyrjz9R9fsd7LEqZlAXrr66W1A7j0efr/4gSzhfnbMlzDll68U5C5N4vQxh + 3vNyyy+GowmKv159uiEhX9LFBQ/nqzksWHiGhfUp7mdRzdolL2eaSAvLrbvA + 9c37u48kWfA4OTuPz9Zn84oz1sqjH4FMfUTrj66+WlV5ufbozZf722tytr5A + T1KIz9fL1fmStZEYnKfJ8ctE9LtKZYvqifvo7lNFdK2gxR6F7RPPMhRjJtpm + 5mz64M2n24+37z/dYCWfgrRTQ2GrtOTRh6vP3+6+3KBFSAKP4vYjxcTHpSc9 + 8lg/I+y882Gj7Cn9Kye+XD8Pa3Oga1rjItW+scF20at/AAAA//8DAMc4AxSp + FwAA + http_version: + recorded_at: Fri, 02 Sep 2016 20:34:52 GMT +- request: + method: post + uri: https://api.sandbox.braintreegateway.com/merchants/7rdg92j7bm7fk5h3/transactions + body: + encoding: UTF-8 + string: | + + + 1 + fake-paypal-future-nonce + sale + + headers: + Accept-Encoding: + - gzip + Accept: + - application/xml + User-Agent: + - Braintree Ruby Gem 2.66.0 + X-Apiversion: + - '4' + Authorization: + - Basic bXdqa2t4d2NwMzJja2huZjphOTI5OGY0M2IzMGM2OTlkYjMwNzJjYzRhMDBmN2Y0OQ== + Content-Type: + - application/xml + response: + status: + code: 201 + message: Created + headers: + Date: + - Fri, 02 Sep 2016 20:34:53 GMT + Content-Type: + - application/xml; charset=utf-8 + Transfer-Encoding: + - chunked + X-Frame-Options: + - SAMEORIGIN + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Authentication: + - basic_auth + X-User: + - 3v249hqtptsg744y + Vary: + - Accept-Encoding + Content-Encoding: + - gzip + Etag: + - W/"1430dce29ace257cc12e4437905f4bc7" + Cache-Control: + - max-age=0, private, must-revalidate + X-Request-Id: + - e623107d-4740-4d5b-93ec-3c3adbd62946 + X-Runtime: + - '0.282920' + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAG3iyVcAA+xYS2/kNgy+768I5q54XpnMLhxns0i6SLGHors5tJdAtuix + GllyJXkys7++lF9jx/ImBYqih97G5CeKIiny04TXh1yc7UEbruTVbHE+n52B + TBTjcnc1e/j2E9nOrqN3odVUGppYREXvzs5CzqKnufku1+vLMMAPJzOW2tJE + tLSZ0vw7sDBoRE5rjwVEhgoIg+qnkyWl1rjbkXCjCG4K0cPX2zAYix2Y5qqU + NkIX52HQfDh5DjrJqLSEJokTEnTHWMhjJWwY+LSVs2VMPLozycXVzOoSZkFt + naIt/Sao0gyRHkWigVpghNozd/SrGcNPy3OYRcv5YkPm78l8+W05/7Baf7hY + /Y4B6BZU68uC/b31pwVNmI1VeAL3UeXupYcoTLk2lkiag0cp6LQuUXlB5dGj + gZxy4ZE/Q2y49dkqMiV98pQeRkEN+qcKYy4Eluy/fEJjNQDWBGMajPGF4GBB + MpeJSYhQCRXc+sxr2OF988VJ4cUS1dXw+osFqo/Tx6nVbjWhosjo8k2o1Wso + WWI2eDLOVC85eKa0lMx3SzqNaaqcak2PAyUGsteIfEYKqi3H0BiwVkAOeFOH + K3zGTx3rNfM9szG1SebFZLwo/q/F/2gt9rPTNEaSchDMNLWwNwS0VppgjAol + DXiPVuF6Rx+io3ucUD8EtCaGWfNb+SGmOsZ+P145FjroDufCMz2i5g+oqxxH + jRknNiy0SnA3jEN7O2gF9wbjBB7uuJi7WT2lnVhpsVCjmwI1e0chphBVBBnj + ziuM8Rg28nKveOLykGJ+cQWWSAx6fJbSTXrcpR7nEyhLD6TmIF4VHCAv2mkd + KyWAylmUUmEc/ekALTvAU5CEatZUslVP4LtqMfdJq3ax9l0ItEicC95mUHBd + ZzRX0mZRGIxEI+QRqB4CK0mzWzOOiWsi1t8rnEeZElVc/Q2B53QHpNQ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Sep 2016 20:34:53 GMT +- request: + method: put + uri: https://api.sandbox.braintreegateway.com/merchants/7rdg92j7bm7fk5h3/transactions/k0szn447/void + body: + encoding: UTF-8 + string: '' + headers: + Accept-Encoding: + - gzip + Accept: + - application/xml + User-Agent: + - Braintree Ruby Gem 2.66.0 + X-Apiversion: + - '4' + Authorization: + - Basic bXdqa2t4d2NwMzJja2huZjphOTI5OGY0M2IzMGM2OTlkYjMwNzJjYzRhMDBmN2Y0OQ== + Content-Type: + - application/xml + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 02 Sep 2016 20:34:54 GMT Content-Type: - application/xml; charset=utf-8 Transfer-Encoding: @@ -162,56 +356,54 @@ http_interactions: Content-Encoding: - gzip Etag: - - W/"506bcda25df5effdc754bcac541996e8" + - W/"f58b1f86b79b85c730357d6065fbdb52" Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - fc469160-b274-453d-b09d-30c1136fe222 + - 937124f6-7e6b-4ed7-9069-94a438608ee6 X-Runtime: - - '0.472109' + - '0.181728' Strict-Transport-Security: - max-age=31536000; includeSubDomains body: encoding: ASCII-8BIT string: !binary |- - H4sIAE/iyVcAA+xYS3PbNhC+51d4dIdJSZYjZWgmTuxm3Mkhk8SH9uIBiaWI - mgRYAJSl/Pou+BIpgrEP6Uxm2pu0++GxD+x+y+DtPs/OdqA0l+JqNj/3Z2cg - Ysm42F7N7r/9Rtazt+GrwCgqNI0NosJXZ2cBZ+GcLemc0X3g4R8r04aaUoca - jMlweeA1AqszhwJCTTMIvOqnlcWlUnjWgXAtCR4J4f3Xm8Abiy2Y5rIUJlyt - fP/c9wOv+W9VOag4pcIQGsdWSPA+2kAeycwEnktb3baMiEN3Jnh2NTOqhJlX - 705xL/UiqFQMkQ5FrIAaYISaM2v91YzhX8NzmIULf35J/A3xF98W/pvlxZvF - 4k/0QbegWl8W7OXrl7j+uKDxtDYSLbB/6uCt1hf+69Xlug0eShOutCGC5nB6 - f1RmdFoXy7yg4uDQQE555pA/QaS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qU1N0BhZfoKZtxAOVPzY9fu8/fogZfag4Ew4H5wCcQtp/DffWwUxF + VurbsEwSD33HiEzY7iwvSgu+1GgmKOESWWZZv5fc1xmUF1Q8Nl87wmAKN+Rw + PVuHVK9P4yZBr+9VEb/X9urYoc2wqxCsMJd6gFdPlee96Ox8hXchCAdY9Tkj + qn5/gAN2QAF1p+qruwW1t1j068ffyWqVLNZsm16vFqvVFV0uFlfzdBUnPbe2 + M3NItlH85ePnOwKL6812vlhs43Rxvd7G2Elf4v4t+lQ75Hz2hFSn3LkL3N59 + eviZbDfbdAnx6m1ytah4UK08+RHI1Geh/mNsMgi1R+9+e7y/JavlJtmuN5vt + 9ppt2BLaSAzO0+T01o5+UZlsUT1xH909vqNb1e14ErY1LQSKMQ9t84pqpt7d + 5/uf7z99vsPWPQVpmXBhq6T0mTr5jeTFJJzukh7gOb2q7eke9h4GbakMpm70 + 5m8AAAD//wMAHDKbTz4WAAA= http_version: - recorded_at: Fri, 02 Sep 2016 20:34:23 GMT + recorded_at: Fri, 02 Sep 2016 20:34:54 GMT - request: method: post uri: https://api.sandbox.braintreegateway.com/merchants/7rdg92j7bm7fk5h3/client_token @@ -241,7 +433,7 @@ http_interactions: message: Created headers: Date: - - Fri, 02 Sep 2016 20:34:24 GMT + - Fri, 02 Sep 2016 20:34:54 GMT Content-Type: - application/xml; charset=utf-8 Transfer-Encoding: @@ -262,44 +454,44 @@ http_interactions: Content-Encoding: - gzip Etag: - - W/"8cc2b6eb6a69110d84853cb2ce2f8886" + - W/"371d511e036c520c2e44ff7905f622eb" Cache-Control: - max-age=0, private, must-revalidate X-Request-Id: - - d9497b7e-44f8-4ef9-bf25-9a93ccb6c5dc + - 051799fe-403e-47d3-8822-8701c076e654 X-Runtime: - - '0.109371' + - '0.139364' Strict-Transport-Security: - max-age=31536000; includeSubDomains body: encoding: ASCII-8BIT string: !binary |- - H4sIAFDiyVcAA6RVXY+bOhB9769Y7XtvwSy9Rdpt1SQLAQWnIQSw38DOlg8b -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OvQ50L7N1pNC1 + /34zmgV16jPV7DNxvP6wMkoqbNA9Am3iBmpzptnGRgCeXQta+n2eACatKCBm + 2ky3+Pb7nzXTmS+3c4U9US1WqBqP+cp974pCYevlFJQfepyiiaSQ6w9czn2k + sZLZt87D+5WhQb1TPv6dNnO+xCjyNQfPI8nlv25zI/ePPjaJfcbJxWAOr+hf + 1vgPbspn0Iw5heT3aa/FFUs9HgEWLC6cQH3IpRKIoY5twK/707cZt4iOVF92 + OOUBTlQu9d3rEc8T8MQ6vPr56i9P5sibuMtXkAPmmwm7OsSv+/4sPcEPjn2i + zoXPum/Nga5AwyYGnbwl0WWv0mvRb/Mh+SIp+CJddmRrwAwpPXPMaeYa9Cfx + /9H+GnfDvzATcZVppspWxgAcDDgZXs4RhwPPSAlf1f/ZP+jZ5TpzJXbgUaFN + zIEr6IscqTDP4PMzezL6nYgVppljNv7i/8bM9UQQ2C0Gl3UZfAe8crehl/mH + 2kTYHdX2MA+v+t0jOCdr8Vr2lif2BP2PP73nj3J+YBc7l2Mu2Gv+p1veeDWf + Swx7BLAo2+S6FyDvCXzbMamnQCptoF+BjG2K+lAza7IFfXi8i1aeed2D/Dxr + t4/B/15HZB5BYG6Q5OrXbvuB/fZ+k94hUEft5/40Iq6aLgfYZSHoXAZNV1I9 + Ktha7jXJAeg6933FTxtu5Vo0ezuO/dnTMDegrVEd9qgnzl72F++V2e+/4ZIc + Zgns0tSVMb++rYyapPiMG6/IZA0B+jcINFMB40XZCN5LnFSPB+qYI3BXv3hB + 98uAdyUTfMLzflMLwC/vooKKGUMBOixcrprP4ePjw7vr/fvm4d3vN/N3AAAA + //8DAClJQu3QBwAA http_version: - recorded_at: Fri, 02 Sep 2016 20:34:24 GMT + recorded_at: Fri, 02 Sep 2016 20:34:54 GMT recorded_with: VCR 3.0.3 diff --git a/spec/models/solidus_paypal_braintree/gateway_spec.rb b/spec/models/solidus_paypal_braintree/gateway_spec.rb index 770e195a..825d8e30 100644 --- a/spec/models/solidus_paypal_braintree/gateway_spec.rb +++ b/spec/models/solidus_paypal_braintree/gateway_spec.rb @@ -57,6 +57,25 @@ end end + describe "#void" do + subject(:void) { gateway.void(response_code, source, {}) } + + let(:response_code) do + result = Braintree::Transaction.sale( + amount: 1, + payment_method_nonce: source.nonce + ) + result.transaction.id + end + + it 'returns a successful billing response', aggregate_failures: true do + expect(void).to be_a ActiveMerchant::Billing::Response + expect(void).to be_success + expect(void).to be_test + expect(void.message).to eq 'voided' + end + end + describe '.generate_token', :braintree_integration do subject { gateway.generate_token }