Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Bump Adyne (#6691)

Filip Owczarek94774e9ddfa1
diff --git a/poetry.lock b/poetry.lock
index 2598f93ab1..bf7fbf1354 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1,6 +1,6 @@
[[package]]
name = "adyen"
-version = "3.1.0"
+version = "4.0.0"
description = "Adyen Python Api"
category = "main"
optional = false
@@ -2491,11 +2491,11 @@ multidict = ">=4.0"
[metadata]
lock-version = "1.1"
python-versions = "~3.9"
-content-hash = "d2e49e9d002d326192adec0b36ef91c101583dbd06e1917509345ae043d51557"
+content-hash = "4e9dc650b5e373862d1b25e4ef5532f1ee941ef55c11d736d5ccd2ec63bae638"
[metadata.files]
adyen = [
- {file = "Adyen-3.1.0.tar.gz", hash = "sha256:8ac866a5dba790952cdf3bdbbb44a893d9268fa3dd81222db5de5a034b2462c9"},
+ {file = "Adyen-4.0.0.tar.gz", hash = "sha256:f44007fd542d7634bee69f29572442bf9102043141a7d5822ac98539ac5e4d5b"},
]
amqp = [
{file = "amqp-5.0.2-py3-none-any.whl", hash = "sha256:5b9062d5c0812335c75434bf17ce33d7a20ecfedaa0733faec7379868eb4068a"},
@@ -2547,7 +2547,6 @@ billiard = [
{file = "billiard-3.6.3.0.tar.gz", hash = "sha256:d91725ce6425f33a97dfa72fb6bfef0e47d4652acd98a032bd1a7fbf06d5fa6a"},
]
black = [
- {file = "black-20.8b1-py3-none-any.whl", hash = "sha256:70b62ef1527c950db59062cda342ea224d772abdf6adc58b86a45421bab20a6b"},
{file = "black-20.8b1.tar.gz", hash = "sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea"},
]
boto3 = [
@@ -3351,8 +3350,11 @@ psycopg2-binary = [
{file = "psycopg2_binary-2.8.6-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:2dac98e85565d5688e8ab7bdea5446674a83a3945a8f416ad0110018d1501b94"},
{file = "psycopg2_binary-2.8.6-cp38-cp38-win32.whl", hash = "sha256:bd1be66dde2b82f80afb9459fc618216753f67109b859a361cf7def5c7968729"},
{file = "psycopg2_binary-2.8.6-cp38-cp38-win_amd64.whl", hash = "sha256:8cd0fb36c7412996859cb4606a35969dd01f4ea34d9812a141cd920c3b18be77"},
+ {file = "psycopg2_binary-2.8.6-cp39-cp39-macosx_10_9_x86_64.macosx_10_9_intel.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:89705f45ce07b2dfa806ee84439ec67c5d9a0ef20154e0e475e2b2ed392a5b83"},
{file = "psycopg2_binary-2.8.6-cp39-cp39-manylinux1_i686.whl", hash = "sha256:42ec1035841b389e8cc3692277a0bd81cdfe0b65d575a2c8862cec7a80e62e52"},
{file = "psycopg2_binary-2.8.6-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:7312e931b90fe14f925729cde58022f5d034241918a5c4f9797cac62f6b3a9dd"},
+ {file = "psycopg2_binary-2.8.6-cp39-cp39-win32.whl", hash = "sha256:6422f2ff0919fd720195f64ffd8f924c1395d30f9a495f31e2392c2efafb5056"},
+ {file = "psycopg2_binary-2.8.6-cp39-cp39-win_amd64.whl", hash = "sha256:15978a1fbd225583dd8cdaf37e67ccc278b5abecb4caf6b2d6b8e2b948e953f6"},
]
purl = [
{file = "purl-1.5-py2.py3-none-any.whl", hash = "sha256:5ac0e85979da0172d80156701cb3eb9b1eff31f3b43e981ef6dc06251c53a3a4"},
@@ -3515,6 +3517,8 @@ pyyaml = [
{file = "PyYAML-5.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf"},
{file = "PyYAML-5.3.1-cp38-cp38-win32.whl", hash = "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97"},
{file = "PyYAML-5.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee"},
+ {file = "PyYAML-5.3.1-cp39-cp39-win32.whl", hash = "sha256:ad9c67312c84def58f3c04504727ca879cb0013b2517c85a9a253f0cb6380c0a"},
+ {file = "PyYAML-5.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:6034f55dab5fea9e53f436aa68fa3ace2634918e8b5994d82f3621c04ff5ed2e"},
{file = "PyYAML-5.3.1.tar.gz", hash = "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d"},
]
razorpay = [
diff --git a/pyproject.toml b/pyproject.toml
index 28366b653e..93598d6f3e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -65,7 +65,7 @@ pyjwt = "^1.7.1"
python-json-logger = ">=0.1.11,<2.1.0"
pytimeparse = "^1.1.8"
django-redis = "^4.12.1"
-Adyen = "^3.0.0"
+Adyen = "^4.0.0"
google-cloud-pubsub = ">=1.7,<3.0"
uvicorn = {extras = ["standard"], version = "^0.12.2"}
gunicorn = "^20.0.4"
diff --git a/requirements.txt b/requirements.txt
index e3b52aa3a0..0727fa177d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
-adyen==3.1.0
+adyen==4.0.0
amqp==5.0.2; python_version >= "3.6"
aniso8601==7.0.0
asgiref==3.3.1; python_version >= "3.6"
diff --git a/requirements_dev.txt b/requirements_dev.txt
index bc5297f524..8791e9a90b 100644
--- a/requirements_dev.txt
+++ b/requirements_dev.txt
@@ -1,4 +1,4 @@
-adyen==3.1.0
+adyen==4.0.0
amqp==5.0.2; python_version >= "3.6"
aniso8601==7.0.0
apipkg==1.5; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
diff --git a/saleor/payment/gateways/adyen/tests/cassettes/test_capture_payment.yaml b/saleor/payment/gateways/adyen/tests/cassettes/test_capture_payment.yaml
index f8dd46356d..eb382ecabb 100644
--- a/saleor/payment/gateways/adyen/tests/cassettes/test_capture_payment.yaml
+++ b/saleor/payment/gateways/adyen/tests/cassettes/test_capture_payment.yaml
@@ -1,9 +1,9 @@
interactions:
- request:
- body: '{"merchantAccount": "SaleorECOM", "modificationAmount": {"value": "123400",
- "currency": "USD"}, "originalReference": "882595494831959A", "reference": "UGF5bWVudDoyMw==",
+ body: '{"merchantAccount": "SaleorECOM", "modificationAmount": {"value": "8000",
+ "currency": "USD"}, "originalReference": "882595494831959A", "reference": "UGF5bWVudDoxMTQ0",
"applicationInfo": {"adyenLibrary": {"name": "adyen-python-api-library", "version":
- "3.1.0"}}}'
+ "4.0.0"}}}'
headers:
Accept:
- '*/*'
@@ -16,15 +16,14 @@ interactions:
Content-Type:
- application/json
User-Agent:
- - adyen-python-api-library/3.1.0
+ - adyen-python-api-library/4.0.0
x-api-key:
- test_key
method: POST
uri: https://pal-test.adyen.com/pal/servlet/Payment/v64/capture
response:
body:
- string: '{"pspReference":"852595499936560C","response":"[capture-received]",
- "additionalData":{"paymentMethod": "visa"}}'
+ string: '{"pspReference":"852610007697063J","response":"[capture-received]"}'
headers:
Adyen-ServerState:
- MEDIUM
@@ -33,17 +32,17 @@ interactions:
Content-Type:
- application/json;charset=utf-8
Date:
- - Thu, 23 Jul 2020 10:25:36 GMT
+ - Thu, 07 Jan 2021 08:21:37 GMT
Keep-Alive:
- timeout=15, max=100
Server:
- Apache
Set-Cookie:
- - JSESSIONID=9C32083B7E10EBCCFCB8BD5F5E086B37.test3e; Path=/pal; Secure; HttpOnly
+ - JSESSIONID=014140433CC0DF32218EF2A20C65AF6D.test3e; Path=/pal; Secure; HttpOnly
Transfer-Encoding:
- chunked
pspReference:
- - 852595499936560C
+ - 852610007697063J
status:
code: 200
message: OK
diff --git a/saleor/payment/gateways/adyen/tests/cassettes/test_get_payment_gateway_for_checkout.yaml b/saleor/payment/gateways/adyen/tests/cassettes/test_get_payment_gateway_for_checkout.yaml
index a88c0235d8..44b0c981cf 100644
--- a/saleor/payment/gateways/adyen/tests/cassettes/test_get_payment_gateway_for_checkout.yaml
+++ b/saleor/payment/gateways/adyen/tests/cassettes/test_get_payment_gateway_for_checkout.yaml
@@ -1,8 +1,7 @@
interactions:
- request:
body: '{"merchantAccount": "SaleorECOM", "countryCode": "PL", "channel": "web",
- "applicationInfo": {"adyenLibrary": {"name": "adyen-python-api-library", "version":
- "3.1.0"}}}'
+ "amount": {"value": "1000", "currency": "USD"}}'
headers:
Accept:
- '*/*'
@@ -11,70 +10,39 @@ interactions:
Connection:
- keep-alive
Content-Length:
- - '215'
+ - '120'
Content-Type:
- application/json
User-Agent:
- - adyen-python-api-library/3.1.0
+ - adyen-python-api-library/4.0.0
x-api-key:
- test_key
method: POST
uri: https://checkout-test.adyen.com/v64/paymentMethods
response:
body:
- string: "{\"groups\":[{\"name\":\"Credit Card\",\"types\":[\"visa\",\"mc\",\"\
- amex\"]}],\"paymentMethods\":[{\"details\":[{\"items\":[{\"id\":\"66\",\"\
- name\":\"Bank Nowy BFG S.A.\"},{\"id\":\"92\",\"name\":\"Bank Sp\xF3\u0142\
- dzielczy w Brodnicy\"},{\"id\":\"11\",\"name\":\"Bank transfer \\/ postal\"\
- },{\"id\":\"74\",\"name\":\"Banki Sp\xF3\u0142dzielcze\"},{\"id\":\"73\",\"\
- name\":\"BLIK\"},{\"id\":\"90\",\"name\":\"BNP Paribas - p\u0142ac\u0119 z\
- \ Pl@net\"},{\"id\":\"59\",\"name\":\"CinkciarzPAY\"},{\"id\":\"87\",\"name\"\
- :\"Credit Agricole PBL\"},{\"id\":\"83\",\"name\":\"EnveloBank\"},{\"id\"\
- :\"76\",\"name\":\"Getin Bank PBL\"},{\"id\":\"81\",\"name\":\"Idea Cloud\"\
- },{\"id\":\"7\",\"name\":\"ING Corporate customers\"},{\"id\":\"35\",\"name\"\
- :\"Kantor Polski\"},{\"id\":\"93\",\"name\":\"Kasa Stefczyka\"},{\"id\":\"\
- 44\",\"name\":\"Millennium - P\u0142atno\u015Bci Internetowe\"},{\"id\":\"\
- 10\",\"name\":\"Millennium Corporate customers\"},{\"id\":\"68\",\"name\"\
- :\"mRaty\"},{\"id\":\"1\",\"name\":\"mTransfer\"},{\"id\":\"91\",\"name\"\
- :\"Nest Bank\"},{\"id\":\"80\",\"name\":\"Noble Pay\"},{\"id\":\"50\",\"name\"\
- :\"Pay Way Toyota Bank\"},{\"id\":\"45\",\"name\":\"Pay with Alior Bank\"\
- },{\"id\":\"65\",\"name\":\"Paylink Idea Bank\"},{\"id\":\"36\",\"name\":\"\
- Pekao24Przelew\"},{\"id\":\"70\",\"name\":\"Pocztowy24\"},{\"id\":\"6\",\"\
- name\":\"Przelew24\"},{\"id\":\"46\",\"name\":\"P\u0142ac\u0119 z Citi Handlowy\"\
- },{\"id\":\"38\",\"name\":\"P\u0142ac\u0119 z ING\"},{\"id\":\"2\",\"name\"\
- :\"P\u0142ac\u0119 z Inteligo\"},{\"id\":\"4\",\"name\":\"P\u0142ac\u0119\
- \ z iPKO\"},{\"id\":\"75\",\"name\":\"P\u0142ac\u0119 z Plus Bank\"},{\"id\"\
- :\"51\",\"name\":\"P\u0142a\u0107 z BO\u015A\"},{\"id\":\"55\",\"name\":\"\
- Raty z Alior Bankiem PLN\"},{\"id\":\"89\",\"name\":\"Santander\"},{\"id\"\
- :\"52\",\"name\":\"SkyCash\"},{\"id\":\"60\",\"name\":\"T-Mobile us\u0142\
- ugi bankowe\"},{\"id\":\"21\",\"name\":\"VIA - Moje Rachunki\"},{\"id\":\"\
- 84\",\"name\":\"Volkswagen Bank direct\"}],\"key\":\"issuer\",\"type\":\"\
- select\"}],\"name\":\"Local Polish Payment Methods\",\"supportsRecurring\"\
- :true,\"type\":\"dotpay\"},{\"brands\":[\"visa\",\"mc\",\"amex\"],\"details\"\
- :[{\"key\":\"encryptedCardNumber\",\"type\":\"cardToken\"},{\"key\":\"encryptedSecurityCode\"\
- ,\"type\":\"cardToken\"},{\"key\":\"encryptedExpiryMonth\",\"type\":\"cardToken\"\
- },{\"key\":\"encryptedExpiryYear\",\"type\":\"cardToken\"},{\"key\":\"holderName\"\
- ,\"optional\":true,\"type\":\"text\"}],\"name\":\"Credit Card\",\"type\":\"\
- scheme\"},{\"name\":\"Paysafecard\",\"supportsRecurring\":true,\"type\":\"\
- paysafecard\"}]}"
+ string: '{"groups":[{"name":"Credit Card","types":["visa","mc","amex","diners","discover"]}],"paymentMethods":[{"brands":["visa","mc","amex","diners","discover"],"details":[{"key":"encryptedCardNumber","type":"cardToken"},{"key":"encryptedSecurityCode","type":"cardToken"},{"key":"encryptedExpiryMonth","type":"cardToken"},{"key":"encryptedExpiryYear","type":"cardToken"},{"key":"holderName","optional":true,"type":"text"}],"name":"Credit
+ Card","type":"scheme"},{"configuration":{"intent":"capture"},"name":"PayPal","supportsRecurring":true,"type":"paypal"},{"name":"Paysafecard","supportsRecurring":true,"type":"paysafecard"},{"configuration":{"merchantDisplayName":"SaleorECOM","merchantIdentifier":"1000"},"details":[{"key":"applepay.token","type":"applePayToken"}],"name":"Apple
+ Pay","supportsRecurring":true,"type":"applepay"},{"configuration":{"merchantId":"1000","gatewayMerchantId":"SaleorECOM"},"details":[{"key":"paywithgoogle.token","type":"payWithGoogleToken"}],"name":"Google
+ Pay","supportsRecurring":true,"type":"paywithgoogle"}]}'
headers:
Connection:
- Keep-Alive
Content-Type:
- application/json;charset=UTF-8
Date:
- - Thu, 23 Jul 2020 07:41:35 GMT
+ - Thu, 07 Jan 2021 08:30:32 GMT
Keep-Alive:
- timeout=15, max=100
Server:
- Apache
Set-Cookie:
- - JSESSIONID=2B905200701F59F1725544B8148C84DF.test3e; Path=/checkout; Secure;
+ - JSESSIONID=BF32081F757B98CBB0DD5177B5497D87.test3e; Path=/checkout; Secure;
HttpOnly
Transfer-Encoding:
- chunked
pspReference:
- - 881595490095995F
+ - 851610008232020A
status:
code: 200
message: OK
diff --git a/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment.yaml b/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment.yaml
index 01c2a9151b..2b9434fdbc 100644
--- a/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment.yaml
+++ b/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment.yaml
@@ -1,9 +1,11 @@
interactions:
- request:
- body: '{"amount": {"value": "123400", "currency": "USD"}, "reference": "UGF5bWVudDo3",
- "paymentMethod": {"paymentdata": ""}, "returnUrl": "http://127.0.0.1:3000/",
- "merchantAccount": "SaleorECOM", "applicationInfo": {"adyenLibrary": {"name":
- "adyen-python-api-library", "version": "3.1.0"}}}'
+ body: '{"amount": {"value": "8000", "currency": "USD"}, "reference": "UGF5bWVudDoxMTM3",
+ "paymentMethod": {"type": "scheme", "encryptedCardNumber": "test_4646464646464644",
+ "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode":
+ "test_737"}, "returnUrl": "http://mirumee.com/plugins/mirumee.payments.adyen/additional-actions?payment=UGF5bWVudDoxMTM3&checkout=dd45b15c-e50f-4734-9166-cb19b7da75d3",
+ "merchantAccount": "SaleorECOM", "channel": "web", "shopperEmail": "", "applicationInfo":
+ {"adyenLibrary": {"name": "adyen-python-api-library", "version": "4.0.0"}}}'
headers:
Accept:
- '*/*'
@@ -12,37 +14,36 @@ interactions:
Connection:
- keep-alive
Content-Length:
- - '459'
+ - '596'
Content-Type:
- application/json
User-Agent:
- - adyen-python-api-library/3.1.0
+ - adyen-python-api-library/4.0.0
x-api-key:
- test_key
method: POST
uri: https://checkout-test.adyen.com/v64/payments
response:
body:
- string: '{"pspReference":"882595494831959A","resultCode":"Authorised","merchantReference":"UGF5bWVudDoz",
- "additionalData":{"paymentMethod": "visa"}}'
+ string: '{"additionalData":{"paymentMethod":"visa"},"pspReference":"882609854544793A","resultCode":"Authorised","amount":{"currency":"USD","value":8000},"merchantReference":"UGF5bWVudDoxMTM3"}'
headers:
Connection:
- Keep-Alive
Content-Type:
- application/json;charset=UTF-8
Date:
- - Thu, 23 Jul 2020 09:00:31 GMT
+ - Tue, 05 Jan 2021 13:49:04 GMT
Keep-Alive:
- timeout=15, max=100
Server:
- Apache
Set-Cookie:
- - JSESSIONID=AE656F73ABD9FF7E6DFA147F1A36D257.test3e; Path=/checkout; Secure;
+ - JSESSIONID=61CCDC10C5283298648628594A8C50EE.test3e; Path=/checkout; Secure;
HttpOnly
Transfer-Encoding:
- chunked
pspReference:
- - 881595494831497D
+ - 851609854544380B
status:
code: 200
message: OK
diff --git a/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment_with_adyen_auto_capture.yaml b/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment_with_adyen_auto_capture.yaml
index 0b603a3d86..febc8a6926 100644
--- a/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment_with_adyen_auto_capture.yaml
+++ b/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment_with_adyen_auto_capture.yaml
@@ -1,9 +1,11 @@
interactions:
- request:
- body: '{"amount": {"value": "123400", "currency": "USD"}, "reference": "UGF5bWVudDo3",
- "paymentMethod": {"paymentdata": ""}, "returnUrl": "http://127.0.0.1:3000/",
- "merchantAccount": "SaleorECOM", "applicationInfo": {"adyenLibrary": {"name":
- "adyen-python-api-library", "version": "3.1.0"}}}'
+ body: '{"amount": {"value": "8000", "currency": "USD"}, "reference": "UGF5bWVudDoxMTUw",
+ "paymentMethod": {"type": "scheme", "encryptedCardNumber": "test_4646464646464644",
+ "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode":
+ "test_737"}, "returnUrl": "http://mirumee.com/plugins/mirumee.payments.adyen/additional-actions?payment=UGF5bWVudDoxMTUw&checkout=d72ba46f-95ce-4971-b548-2f65c51309b6",
+ "merchantAccount": "SaleorECOM", "channel": "web", "shopperEmail": "", "applicationInfo":
+ {"adyenLibrary": {"name": "adyen-python-api-library", "version": "4.0.0"}}}'
headers:
Accept:
- '*/*'
@@ -12,36 +14,36 @@ interactions:
Connection:
- keep-alive
Content-Length:
- - '443'
+ - '596'
Content-Type:
- application/json
User-Agent:
- - adyen-python-api-library/3.1.0
+ - adyen-python-api-library/4.0.0
x-api-key:
- test_key
method: POST
uri: https://checkout-test.adyen.com/v64/payments
response:
body:
- string: '{"pspReference":"882595494831959A","resultCode":"Authorised","merchantReference":"UGF5bWVudDoz"}'
+ string: '{"additionalData":{"paymentMethod":"visa"},"pspReference":"852610008487439C","resultCode":"Authorised","amount":{"currency":"USD","value":8000},"merchantReference":"UGF5bWVudDoxMTUw"}'
headers:
Connection:
- Keep-Alive
Content-Type:
- application/json;charset=UTF-8
Date:
- - Thu, 23 Jul 2020 09:00:31 GMT
+ - Thu, 07 Jan 2021 08:34:47 GMT
Keep-Alive:
- timeout=15, max=100
Server:
- Apache
Set-Cookie:
- - JSESSIONID=70BB99EA8A7D04F71CD3E6EAF8348CE3.test3e; Path=/checkout; Secure;
+ - JSESSIONID=C26ACD22ECF45C1DD3B450E96D302D4F.test103e; Path=/checkout; Secure;
HttpOnly
Transfer-Encoding:
- chunked
pspReference:
- - 881595494831497D
+ - 881610008487259D
status:
code: 200
message: OK
diff --git a/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment_with_adyen_auto_capture_order_confirmation.yaml b/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment_with_adyen_auto_capture_order_confirmation.yaml
deleted file mode 100644
index fcead20271..0000000000
--- a/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment_with_adyen_auto_capture_order_confirmation.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
-interactions:
-- request:
- body: '{"amount": {"value": "123400", "currency": "USD"}, "reference": "UGF5bWVudDo3",
- "paymentMethod": {"paymentdata": ""}, "returnUrl": "http://127.0.0.1:3000/",
- "merchantAccount": "SaleorECOM", "applicationInfo": {"adyenLibrary": {"name":
- "adyen-python-api-library", "version": "3.0.0"}}}'
- headers:
- Accept:
- - '*/*'
- Accept-Encoding:
- - gzip, deflate
- Connection:
- - keep-alive
- Content-Length:
- - '4444'
- Content-Type:
- - application/json
- User-Agent:
- - adyen-python-api-library/3.0.0
- x-api-key:
- - test_key
- method: POST
- uri: https://checkout-test.adyen.com/v49/payments
- response:
- body:
- string: '{"pspReference":"882595494831959A","resultCode":"Authorised","merchantReference":"UGF5bWVudDoz"}'
- headers:
- Connection:
- - Keep-Alive
- Content-Type:
- - application/json;charset=UTF-8
- Date:
- - Thu, 23 Jul 2020 09:00:31 GMT
- Keep-Alive:
- - timeout=15, max=100
- Server:
- - Apache
- Set-Cookie:
- - JSESSIONID=16B2B5BA678472CFD5D8FEE7C6EB1227.test103e; Path=/checkout; Secure;
- HttpOnly
- Transfer-Encoding:
- - chunked
- pspReference:
- - 881595494831497D
- status:
- code: 200
- message: '200'
-version: 1
diff --git a/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment_with_auto_capture.yaml b/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment_with_auto_capture.yaml
index cc6c7ca765..f1c978d86c 100644
--- a/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment_with_auto_capture.yaml
+++ b/saleor/payment/gateways/adyen/tests/cassettes/test_process_payment_with_auto_capture.yaml
@@ -1,17 +1,11 @@
interactions:
- request:
- body: '{"amount": {"value": "123400", "currency": "USD"}, "reference": "UGF5bWVudDoxNw==",
- "paymentMethod": {"type": "scheme", "holderName": "John Doe", "encryptedCardNumber":
- "adyenjs_0_1_25$I4hADbyBrUvNV2Zv+lQcRZdBtj0pYYjRHweEJ7NgT+Lk91H77GhomGxuSuyQKE71qyOdloMBI/dB9AhYLzM3WkkpOdO903XHQfceMHrbfrMw7yYOcLg99bSYx3E0kgr1jgG0bNSnwG6SHW7bZO+ZC+FJ96juHFwjLIIsWVtZ0SCvhXdMdsvQwIGAQ6ry+J7AdVaAcLRWYQRwVl05CaXOTqoSIiwWgrj9nucbQfKVGaoi/eldsFzbs0Ou72ap9piKo0+1wtj4SMjJUPX8WO37uWZUgH2RjKRDCVAZgc7V2DbaZKmU5o9LHyFxEnjn37zTxf+XiEQWxYpfMFJc0+66WA==$rdYYJn4cYOlzPDauDrb5WW7x6RQzzyJrk8RuipaqxsUeGbmkJRh+JKogznXcLoRDltUcFITY2+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fYZKSGRKf+ftQ0FF4ClKN9rblQDTshVU+XZ6CUj77Z9tZmeUxYAZxr4LKH/ELUoRZjaF5W/bO5XBawRLsh+JfaE="},
- "returnUrl": "http://127.0.0.1:3000/", "merchantAccount": "SaleorECOM", "browserInfo":
- {"acceptHeader": "*/*", "colorDepth": 24, "language": "en-gb", "javaEnabled":
- true, "screenHeight": 1440, "screenWidth": 2560, "userAgent": "Mozilla/5.0 (Macintosh;
- Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1
- Safari/605.1.15", "timeZoneOffset": -120}, "applicationInfo": {"adyenLibrary":
- {"name": "adyen-python-api-library", "version": "3.1.0"}}}'
+ body: '{"amount": {"value": "8000", "currency": "USD"}, "reference": "UGF5bWVudDoxMzY1",
+ "paymentMethod": {"type": "scheme", "encryptedCardNumber": "test_4646464646464644",
+ "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode":
+ "test_737"}, "returnUrl": "http://mirumee.com/plugins/mirumee.payments.adyen/additional-actions?payment=UGF5bWVudDoxMzY1&checkout=4c3b18ff-b18a-43f3-a255-bc3f89607e95",
+ "merchantAccount": "SaleorECOM", "channel": "web", "shopperEmail": "", "applicationInfo":
+ {"adyenLibrary": {"name": "adyen-python-api-library", "version": "4.0.0"}}}'
headers:
Accept:
- '*/*'
@@ -20,44 +14,44 @@ interactions:
Connection:
- keep-alive
Content-Length:
- - '4433'
+ - '596'
Content-Type:
- application/json
User-Agent:
- - adyen-python-api-library/3.1.0
+ - adyen-python-api-library/4.0.0
x-api-key:
- - test_key
+ - test_key
method: POST
uri: https://checkout-test.adyen.com/v64/payments
response:
body:
- string: '{"pspReference":"883596624248178D","resultCode":"Authorised","merchantReference":"UGF5bWVudDoxNw=="}'
+ string: '{"additionalData":{"paymentMethod":"visa"},"pspReference":"853610014786939F","resultCode":"Authorised","amount":{"currency":"USD","value":8000},"merchantReference":"UGF5bWVudDoxMzY1"}'
headers:
Connection:
- Keep-Alive
Content-Type:
- application/json;charset=UTF-8
Date:
- - Wed, 05 Aug 2020 10:44:08 GMT
+ - Thu, 07 Jan 2021 10:19:46 GMT
Keep-Alive:
- timeout=15, max=100
Server:
- Apache
Set-Cookie:
- - JSESSIONID=5C0A57B6D3E7789A25187C45FF6D9ACD.test104e; Path=/checkout; Secure;
+ - JSESSIONID=B07375A76CF0E7D06A7A34DF1515466A.test104e; Path=/checkout; Secure;
HttpOnly
Transfer-Encoding:
- chunked
pspReference:
- - 851596624248090H
+ - 881610014786858J
status:
code: 200
- message: OK
+ message: '200'
- request:
- body: '{"merchantAccount": "SaleorECOM", "modificationAmount": {"value": "123400",
- "currency": "USD"}, "originalReference": "883596624248178D", "reference": "UGF5bWVudDoxNw==",
+ body: '{"merchantAccount": "SaleorECOM", "modificationAmount": {"value": "8000",
+ "currency": "USD"}, "originalReference": "853610014786939F", "reference": "UGF5bWVudDoxMzY1",
"applicationInfo": {"adyenLibrary": {"name": "adyen-python-api-library", "version":
- "3.1.0"}}}'
+ "4.0.0"}}}'
headers:
Accept:
- '*/*'
@@ -66,36 +60,38 @@ interactions:
Connection:
- keep-alive
Content-Length:
- - '264'
+ - '262'
Content-Type:
- application/json
User-Agent:
- - adyen-python-api-library/3.1.0
+ - adyen-python-api-library/4.0.0
x-api-key:
- - test_key
+ - test_key
method: POST
uri: https://pal-test.adyen.com/pal/servlet/Payment/v64/capture
response:
body:
- string: '{"pspReference":"853596624248395G","response":"[capture-received]"}'
+ string: '{"pspReference":"853610014787942J","response":"[capture-received]"}'
headers:
+ Adyen-ServerState:
+ - MEDIUM
Connection:
- Keep-Alive
Content-Type:
- application/json;charset=utf-8
Date:
- - Wed, 05 Aug 2020 10:44:08 GMT
+ - Thu, 07 Jan 2021 10:19:47 GMT
Keep-Alive:
- timeout=15, max=100
Server:
- Apache
Set-Cookie:
- - JSESSIONID=5C0A57B6D3E7789A25187C45FF6D9ACD.test104e; Path=/checkout; Secure;
+ - JSESSIONID=F1D910A5A3FFBDEF31D3B9BBFC4D7554.test4e; Path=/pal; Secure; HttpOnly
Transfer-Encoding:
- chunked
pspReference:
- - 853596624248395G
+ - 853610014787942J
status:
code: 200
- message: OK
+ message: '200'
version: 1
diff --git a/saleor/payment/gateways/adyen/tests/cassettes/test_refund_payment.yaml b/saleor/payment/gateways/adyen/tests/cassettes/test_refund_payment.yaml
index 619fd9bc79..209c6daf5e 100644
--- a/saleor/payment/gateways/adyen/tests/cassettes/test_refund_payment.yaml
+++ b/saleor/payment/gateways/adyen/tests/cassettes/test_refund_payment.yaml
@@ -1,9 +1,9 @@
interactions:
- request:
- body: '{"merchantAccount": "SaleorECOM", "modificationAmount": {"value": "123400",
- "currency": "USD"}, "originalReference": "882595494831959A", "reference": "UGF5bWVudDoxNw==",
+ body: '{"merchantAccount": "SaleorECOM", "modificationAmount": {"value": "8000",
+ "currency": "USD"}, "originalReference": "882595494831959A", "reference": "UGF5bWVudDoxMTU4",
"applicationInfo": {"adyenLibrary": {"name": "adyen-python-api-library", "version":
- "3.1.0"}}}'
+ "4.0.0"}}}'
headers:
Accept:
- '*/*'
@@ -16,14 +16,14 @@ interactions:
Content-Type:
- application/json
User-Agent:
- - adyen-python-api-library/3.1.0
+ - adyen-python-api-library/4.0.0
x-api-key:
- test_key
method: POST
uri: https://pal-test.adyen.com/pal/servlet/Payment/v64/refund
response:
body:
- string: '{"pspReference":"882595499620961A","response":"[refund-received]"}'
+ string: '{"pspReference":"882610009233471H","response":"[refund-received]"}'
headers:
Adyen-ServerState:
- MEDIUM
@@ -32,17 +32,17 @@ interactions:
Content-Type:
- application/json;charset=utf-8
Date:
- - Thu, 23 Jul 2020 10:20:20 GMT
+ - Thu, 07 Jan 2021 08:47:13 GMT
Keep-Alive:
- timeout=15, max=100
Server:
- Apache
Set-Cookie:
- - JSESSIONID=81C9AF517DD090DEC4CCA40F72285FF1.test3e; Path=/pal; Secure; HttpOnly
+ - JSESSIONID=34EEEA766BB7A07B0C79B65D3598AC98.test103e; Path=/pal; Secure; HttpOnly
Transfer-Encoding:
- chunked
pspReference:
- - 882595499620961A
+ - 882610009233471H
status:
code: 200
message: OK
diff --git a/saleor/payment/gateways/adyen/tests/cassettes/test_void_payment.yaml b/saleor/payment/gateways/adyen/tests/cassettes/test_void_payment.yaml
index b0d751916a..a292c02428 100644
--- a/saleor/payment/gateways/adyen/tests/cassettes/test_void_payment.yaml
+++ b/saleor/payment/gateways/adyen/tests/cassettes/test_void_payment.yaml
@@ -1,8 +1,8 @@
interactions:
- request:
- body: '{"merchantAccount": "SaleorECOM", "originalReference": "883597146907178J",
- "reference": "UGF5bWVudDoz", "applicationInfo": {"adyenLibrary": {"name": "adyen-python-api-library",
- "version": "3.0.0"}}}'
+ body: '{"merchantAccount": "SaleorECOM", "originalReference": "852610010025849H",
+ "reference": "UGF5bWVudDoxMTY4", "applicationInfo": {"adyenLibrary": {"name":
+ "adyen-python-api-library", "version": "4.0.0"}}}'
headers:
Accept:
- '*/*'
@@ -11,37 +11,37 @@ interactions:
Connection:
- keep-alive
Content-Length:
- - '188'
+ - '202'
Content-Type:
- application/json
User-Agent:
- - adyen-python-api-library/3.1.0
+ - adyen-python-api-library/4.0.0
x-api-key:
- test_key
method: POST
uri: https://pal-test.adyen.com/pal/servlet/Payment/v64/cancel
response:
body:
- string: '{"pspReference":"853597151490739D","response":"[cancel-received]"}'
+ string: '{"pspReference":"852610010936232E","response":"[cancel-received]"}'
headers:
Adyen-ServerState:
- - MEDIUM
+ - HIGH
Connection:
- Keep-Alive
Content-Type:
- application/json;charset=utf-8
Date:
- - Mon, 23 Nov 2020 10:05:54 GMT
+ - Thu, 07 Jan 2021 09:15:36 GMT
Keep-Alive:
- timeout=15, max=100
Server:
- Apache
Set-Cookie:
- - JSESSIONID=2B67BF77C77565DF7294451B8FAEE350.test4e; Path=/pal; Secure; HttpOnly
+ - JSESSIONID=879F4733269764C93FF1C794B1143DB9.test3e; Path=/pal; Secure; HttpOnly
Transfer-Encoding:
- chunked
pspReference:
- - 853597151490739D
+ - 852610010936232E
status:
code: 200
message: OK
diff --git a/saleor/payment/gateways/adyen/tests/conftest.py b/saleor/payment/gateways/adyen/tests/conftest.py
index 63e8cf992f..8a35eb6c2b 100644
--- a/saleor/payment/gateways/adyen/tests/conftest.py
+++ b/saleor/payment/gateways/adyen/tests/conftest.py
@@ -11,6 +11,13 @@ from ....utils import create_payment
from ..plugin import AdyenGatewayPlugin
[email protected](scope="module")
+def vcr_config():
+ return {
+ "filter_headers": [("x-api-key", "test_key")],
+ }
+
+
@pytest.fixture
def adyen_plugin(settings):
def fun(
@@ -154,3 +161,14 @@ def notification_with_hmac_signature():
"reason": "REFUSED",
"success": "false",
}
+
+
+def adyen_payment_method():
+ return {
+ "type": "scheme",
+ "encryptedCardNumber": "test_4646464646464644",
+ "encryptedExpiryMonth": "test_03",
+ "encryptedExpiryYear": "test_2030",
+ "encryptedSecurityCode": "test_737",
+ }
diff --git a/saleor/payment/gateways/adyen/tests/test_plugin.py b/saleor/payment/gateways/adyen/tests/test_plugin.py
index 252b0902f3..ec23889a37 100644
--- a/saleor/payment/gateways/adyen/tests/test_plugin.py
+++ b/saleor/payment/gateways/adyen/tests/test_plugin.py
@@ -75,10 +75,12 @@ def test_get_payment_gateway_for_checkout(
@pytest.mark.vcr
-def test_process_payment(payment_adyen_for_checkout, checkout_with_items, adyen_plugin):
+def test_process_payment(
+ payment_adyen_for_checkout, checkout_with_items, adyen_plugin, adyen_payment_method
+):
payment_info = create_payment_information(
payment_adyen_for_checkout,
- additional_data={"paymentMethod": {"paymentdata": "", "type": "test"}},
+ additional_data={"paymentMethod": adyen_payment_method},
)
adyen_plugin = adyen_plugin()
response = adyen_plugin.process_payment(payment_info, None)
@@ -87,20 +89,24 @@ def test_process_payment(payment_adyen_for_checkout, checkout_with_items, adyen_
assert response.kind == TransactionKind.AUTH
assert response.amount == Decimal("80.00")
assert response.currency == checkout_with_items.currency
- assert response.transaction_id == "882595494831959A" # ID returned by Adyen
+ assert response.transaction_id == "882609854544793A" # ID returned by Adyen
assert response.error is None
assert response.action_required_data is None
- assert response.payment_method_info == PaymentMethodInfo(brand="visa", type="test")
+ assert response.payment_method_info == PaymentMethodInfo(brand="visa", type="card")
@pytest.mark.vcr
@mock.patch("saleor.payment.gateways.adyen.plugin.call_capture")
def test_process_payment_with_adyen_auto_capture(
- capture_mock, payment_adyen_for_checkout, checkout_with_items, adyen_plugin
+ capture_mock,
+ payment_adyen_for_checkout,
+ checkout_with_items,
+ adyen_plugin,
+ adyen_payment_method,
):
payment_info = create_payment_information(
payment_adyen_for_checkout,
- additional_data={"paymentMethod": {"paymentdata": ""}},
+ additional_data={"paymentMethod": adyen_payment_method},
)
adyen_plugin = adyen_plugin(adyen_auto_capture=True)
response = adyen_plugin.process_payment(payment_info, None)
@@ -112,17 +118,17 @@ def test_process_payment_with_adyen_auto_capture(
assert response.kind == TransactionKind.CAPTURE
assert response.amount == Decimal("80.00")
assert response.currency == checkout_with_items.currency
- assert response.transaction_id == "882595494831959A" # ID returned by Adyen
+ assert response.transaction_id == "852610008487439C" # ID returned by Adyen
assert response.error is None
@pytest.mark.vcr
def test_process_payment_with_auto_capture(
- payment_adyen_for_checkout, checkout_with_items, adyen_plugin
+ payment_adyen_for_checkout, checkout_with_items, adyen_plugin, adyen_payment_method
):
payment_info = create_payment_information(
payment_adyen_for_checkout,
- additional_data={"paymentMethod": {"paymentdata": ""}},
+ additional_data={"paymentMethod": adyen_payment_method},
)
adyen_plugin = adyen_plugin(auto_capture=True)
response = adyen_plugin.process_payment(payment_info, None)
@@ -131,7 +137,7 @@ def test_process_payment_with_auto_capture(
assert response.kind == TransactionKind.CAPTURE
assert response.amount == Decimal("80.00")
assert response.currency == checkout_with_items.currency
- assert response.transaction_id == "853596624248395G" # ID returned by Adyen
+ assert response.transaction_id == "853610014787942J" # ID returned by Adyen
assert response.error is None
assert response.action_required_data is None
@@ -425,47 +431,52 @@ def test_refund_payment(payment_adyen_for_order, order_with_lines, adyen_plugin)
assert response.kind == TransactionKind.REFUND_ONGOING
assert response.amount == Decimal("80.00")
assert response.currency == order_with_lines.currency
- assert response.transaction_id == "882595499620961A" # ID returned by Adyen
+ assert response.transaction_id == "882610009233471H" # ID returned by Adyen
@pytest.mark.vcr
-def test_void_payment(payment_adyen_for_order, order_with_lines, adyen_plugin):
+def test_void_payment(
+ payment_adyen_for_order, order_with_lines, adyen_plugin, adyen_payment_method
+):
payment_info = create_payment_information(
payment_adyen_for_order,
+ payment_token="852610010025849H",
+ additional_data={"paymentMethod": adyen_payment_method},
)
gateway_response = GatewayResponse(
kind=TransactionKind.AUTH,
action_required=False,
- transaction_id="883597146907178J",
+ transaction_id="852610010025849H",
is_success=True,
amount=payment_info.amount,
currency=payment_info.currency,
error="",
raw_response={},
)
+
create_transaction(
payment=payment_adyen_for_order,
payment_information=payment_info,
kind=TransactionKind.AUTH,
gateway_response=gateway_response,
)
-
response = adyen_plugin().void_payment(payment_info, None)
-
assert response.is_success is True
assert response.action_required is False
assert response.kind == TransactionKind.VOID
assert response.amount == Decimal("80.00")
assert response.currency == order_with_lines.currency
- assert response.transaction_id == "853597151490739D" # ID returned by Adyen
+ assert response.transaction_id == "852610010936232E" # ID returned by Adyen
@pytest.mark.vcr
-def test_capture_payment(payment_adyen_for_order, order_with_lines, adyen_plugin):
+def test_capture_payment(
+ payment_adyen_for_order, order_with_lines, adyen_plugin, adyen_payment_method
+):
payment_info = create_payment_information(
payment_adyen_for_order,
payment_token="882595494831959A",
- additional_data={"paymentMethod": {"paymentdata": "", "type": "test"}},
+ additional_data={"paymentMethod": adyen_payment_method},
)
gateway_response = GatewayResponse(
kind=TransactionKind.AUTH,
@@ -490,8 +501,7 @@ def test_capture_payment(payment_adyen_for_order, order_with_lines, adyen_plugin
assert response.kind == TransactionKind.CAPTURE
assert response.amount == Decimal("80.00")
assert response.currency == order_with_lines.currency
- assert response.transaction_id == "852595499936560C" # ID returned by Adyen
- assert response.payment_method_info == PaymentMethodInfo(brand="visa", type="test")
+ assert response.transaction_id == "852610007697063J" # ID returned by Adyen
@mock.patch("saleor.payment.gateways.adyen.utils.apple_pay.requests.post")
diff --git a/saleor/payment/gateways/adyen/tests/webhooks/cassettes/test_handle_authorization_with_auto_capture.yaml b/saleor/payment/gateways/adyen/tests/webhooks/cassettes/test_handle_authorization_with_auto_capture.yaml
index 8ea12268cb..7b0ad7bdc3 100644
--- a/saleor/payment/gateways/adyen/tests/webhooks/cassettes/test_handle_authorization_with_auto_capture.yaml
+++ b/saleor/payment/gateways/adyen/tests/webhooks/cassettes/test_handle_authorization_with_auto_capture.yaml
@@ -1,9 +1,9 @@
interactions:
- request:
- body: '{"merchantAccount": "SaleorECOM", "modificationAmount": {"value": "123400",
- "currency": "USD"}, "originalReference": "853596537720508F", "reference": "UGF5bWVudDoxMA==",
+ body: '{"merchantAccount": "SaleorECOM", "modificationAmount": {"value": "8000",
+ "currency": "USD"}, "originalReference": "853596537720508F", "reference": "UGF5bWVudDoxMTk5",
"applicationInfo": {"adyenLibrary": {"name": "adyen-python-api-library", "version":
- "3.1.0"}}}'
+ "4.0.0"}}}'
headers:
Accept:
- '*/*'
@@ -16,14 +16,14 @@ interactions:
Content-Type:
- application/json
User-Agent:
- - adyen-python-api-library/3.1.0
+ - adyen-python-api-library/4.0.0
x-api-key:
- - test_key
+ - test_key
method: POST
uri: https://pal-test.adyen.com/pal/servlet/Payment/v64/capture
response:
body:
- string: '{"pspReference":"853596621736884E","response":"[capture-received]"}'
+ string: '{"pspReference":"853610013045881J","response":"[capture-received]"}'
headers:
Adyen-ServerState:
- HIGH
@@ -32,18 +32,18 @@ interactions:
Content-Type:
- application/json;charset=utf-8
Date:
- - Wed, 05 Aug 2020 10:02:16 GMT
+ - Thu, 07 Jan 2021 09:50:45 GMT
Keep-Alive:
- timeout=15, max=100
Server:
- Apache
Set-Cookie:
- - JSESSIONID=B33CB1EEE84AD96541DC3468DD28D0F8.test4e; Path=/pal; Secure; HttpOnly
+ - JSESSIONID=F00A8F106CFADD404CBCDF6D896235D3.test4e; Path=/pal; Secure; HttpOnly
Transfer-Encoding:
- chunked
pspReference:
- - 853596621736884E
+ - 853610013045881J
status:
code: 200
- message: OK
+ message: '200'
version: 1