Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Test for existing customer transaction
Jakub Draganeke11023e1782b
diff --git a/tests/gateway/cassettes/test_authorize_with_customer_id.yaml b/tests/gateway/cassettes/test_authorize_with_customer_id.yamlnew file mode 100644index 0000000000..2f4d11f9ae--- /dev/null+++ b/tests/gateway/cassettes/test_authorize_with_customer_id.yaml@@ -0,0 +1,96 @@+interactions:+- request:+ body: <transaction><amount>100.0</amount><customer_id>810066863</customer_id><options><submit_for_settlement+ type="boolean">true</submit_for_settlement></options><order_id type="integer">1</order_id><billing><first_name>John</first_name><last_name>Doe</last_name><company>Mirumee+ Software</company><postal_code>53-601</postal_code><street_address>Tęczowa+ 7</street_address><extended_address></extended_address><locality>WROCŁAW</locality><region></region><country_code_alpha2>PL</country_code_alpha2></billing><risk_data><customer_ip></customer_ip></risk_data><customer><email>[email protected]</email></customer><type>sale</type></transaction>+ headers:+ Accept:+ - application/xml+ Accept-Encoding:+ - gzip+ Connection:+ - keep-alive+ Content-Length:+ - '647'+ Content-type:+ - application/xml+ User-Agent:+ - Braintree Python 3.49.0+ X-ApiVersion:+ - '5'+ method: POST+ uri: https://api.sandbox.braintreegateway.com/merchants/9m6qhfxsqzm3cgzw/transactions+ response:+ body:+ string: !!binary |+ H4sIAA2PE10AA8RY23LbNhB9z1dolJm80SQlWZETmWla124ydZxJnYv84gEJUIRNAgwA6uKv74I3+ kSIoqzPt9E3cPVgAe8NZzd9tkniwIkJSzs6H7okzHBAWcEzZ8nz49fbSmg3feS/mSiAmUaAA5b0Y+ DOYUe2cr4YfpTzm34UPLpEIqk57M/IQqRfB9yMW9JErFJCFMze0SoLFqmxJPopjM7fynlgWZELD3+ 1qKSW3AE4v3+9cvc7oo1GCU8Y8pzHefEceZ2+ak1CRFBhJiyUBBooQXHS6jIEkIkD9UaCdjUBMrv+ kPmWQTdgND4fKpGRoV1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F6BK05StnxH2IoKzjTgXMJz6/MN0Lraftn4BEkREJ9PXOdi8bvQRATFKoITE+8re2R8+ DcSmIStAmPhU7fTFZ6nKBMQQEnKZxZp1NlD7mvpV0HQaHr4dtCErz4u2gscNRCUo3SdlBn0R3jX2+ uMO0pO0+y0NLaxELSHPXrrJyF8dZkE8LuxPsZPuUM7i6PPW/f8vwlRvjq2h1d3n2sHBnTpAsHJzI+ PeapS74cI3QSG7IjY/RnRsqqhVUQWgp9X3jY8U9Hwczxp5MZIjNyitwJwThA4WiCR6cT4P59SwvL+ K8ISbkn82FPVtb6kyO2qLkc/K6KQ92LbYif1y54jCBgqM0S3AhhWQJGkRw4wNb62UI6UO/LTnDIL+ l/YNioVHJbjgAQu0RIxAO8q/6+M1eJTk0DmJh1IKx+jKi0va3Vv+xxc/Ztj+/91QS8oEKZ4imAGM+ 1DPzZSBo2ktfG/r64ci5uZUCXeLYAoZoaY8aKmgPCccSyoiFI+/to99jC55eA/fGVOZ1a9SRwgqv+ Sq2n8/eNtdCru2drGwVeq/8kgXv1VG+tL57kCDFGulYh5ivNIUJC+l5/vS1fW0U0O1pwg58JWYwW+ mCiY5qsxtK0yx6Yxl5i3b2M6/wsdCScb7QB4BYX5GHpGg0wFNm0ymAWBYeyAiPTcXd88zRQ5NLIV+ BAPhB6ANer0JWz71FmXApLNiJtRMp+jE97oTz+0+UJuLNpzSpqxNOtoLet5WTmCfs1WzXBUBqbGg+ FHWOEjh6yI3TqLRCAWPOgUmtHlr7srcq0z49I2rNxePe/Ow5uic709HUPR3N3PHc7sH1MX4dAXSQ+ 8VcxaidETj6J7P9/77XljJuvRN/y5j8TNeMwJ9nBPx4OrjX+uVGv6I6e5r8r+hfsqBL+42Pks0/R+ Yvwl9Uen4c2Pu+0iuVsHP65bjKr1Qnkv/gYAAP//AwDwN4xn6xYAAA==+ headers:+ Cache-Control:+ - max-age=0, private, must-revalidate+ Content-Encoding:+ - gzip+ Content-Security-Policy:+ - frame-ancestors 'self'+ Content-Type:+ - application/xml; charset=utf-8+ Date:+ - Wed, 26 Jun 2019 15:28:13 GMT+ ETag:+ - W/"28e2684be1cc92eb4a235606b105596c"+ Strict-Transport-Security:+ - max-age=31536000; includeSubDomains+ Transfer-Encoding:+ - chunked+ Vary:+ - Accept-Encoding+ X-Authentication:+ - basic_auth+ X-BroxyId:+ - 01-1561562892.756-79.110.196.19-4630334+ X-Content-Type-Options:+ - nosniff+ X-Frame-Options:+ - SAMEORIGIN+ X-Request-Id:+ - 01-1561562892.756-79.110.196.19-4630334+ X-Runtime:+ - '0.707386'+ X-User:+ - wgs3tg8h39pyypyc+ X-XSS-Protection:+ - 1; mode=block+ status:+ code: 201+ message: Created+version: 1diff --git a/tests/gateway/test_braintree.py b/tests/gateway/test_braintree.pyindex 6b3b96798e..5c69223308 100644--- a/tests/gateway/test_braintree.py+++ b/tests/gateway/test_braintree.py@@ -363,6 +363,22 @@ def test_authorize_and_save_customer_id(assert response.customer_id == CUSTOMER_ID[email protected](filter_headers=["authorization"])+def test_authorize_with_customer_id(payment_dummy, sandbox_braintree_gateway_config):+ CUSTOMER_ID = "810066863" # retrieved from sandbox+ payment = payment_dummy++ payment_info = create_payment_information(payment, None)+ payment_info.amount = 100.00+ payment_info.customer_id = CUSTOMER_ID++ response = authorize(payment_info, sandbox_braintree_gateway_config)+ assert not response.error+ assert response.customer_id == CUSTOMER_ID+ assert response.is_success++@pytest.mark.integration@patch("saleor.payment.gateways.braintree.get_braintree_gateway")def test_refund(