Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Revert dummy charge kind back to capture
Michał Jelonek8570c563db4d
diff --git a/saleor/payment/gateways/dummy/__init__.py b/saleor/payment/gateways/dummy/__init__.pyindex 1803875af7..f8cb707a1a 100644--- a/saleor/payment/gateways/dummy/__init__.py+++ b/saleor/payment/gateways/dummy/__init__.py@@ -100,6 +100,4 @@ def charge(auth_resp = authorize(payment, payment_token)if auth_resp['error']:return auth_resp- capture_resp = capture(payment, payment_token, amount)- capture_resp['kind'] = 'charge'- return [auth_resp, capture_resp]+ return [auth_resp, capture(payment, payment_token, amount)]diff --git a/tests/api/test_payment.py b/tests/api/test_payment.pyindex 1e250ea788..58cc113d99 100644--- a/tests/api/test_payment.py+++ b/tests/api/test_payment.py@@ -284,9 +284,9 @@ def test_payment_charge_success(payment.refresh_from_db()assert payment.charge_status == ChargeStatus.CHARGEDassert payment.transactions.count() == 2- charge_txn, auth_txn = payment.transactions.all()+ capture_txn, auth_txn = payment.transactions.all()assert auth_txn.kind == TransactionKind.AUTH- assert charge_txn.kind == TransactionKind.CHARGE+ assert capture_txn.kind == TransactionKind.CAPTUREdef test_payment_charge_gateway_error(diff --git a/tests/gateway/test_dummy.py b/tests/gateway/test_dummy.pyindex 0150677979..fa42dd2900 100644--- a/tests/gateway/test_dummy.py+++ b/tests/gateway/test_dummy.py@@ -12,12 +12,12 @@ from saleor.payment.gateways.dummy.forms import DummyPaymentFormdef test_charge_success(payment_dummy):gateway_charge(payment=payment_dummy, payment_token='fake-token')- charge_txn = payment_dummy.transactions.last()+ capture_txn = payment_dummy.transactions.last()- assert charge_txn.is_success- assert charge_txn.kind == TransactionKind.CHARGE- assert charge_txn.payment == payment_dummy- assert charge_txn.amount == payment_dummy.total+ assert capture_txn.is_success+ assert capture_txn.kind == TransactionKind.CAPTURE+ assert capture_txn.payment == payment_dummy+ assert capture_txn.amount == payment_dummy.totalpayment_dummy.refresh_from_db()assert payment_dummy.charge_status == ChargeStatus.CHARGED