Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Clean some format issues
Unknown01afe503857d
diff --git a/docs/payment-gateways/stripe.rst b/docs/payment-gateways/stripe.rstindex 87edb4f07c..60b59bc170 100644--- a/docs/payment-gateways/stripe.rst+++ b/docs/payment-gateways/stripe.rst@@ -8,13 +8,13 @@ This gateway implements payments using `Stripe <https://stripe.com/>`_.================================== ======================================================================================================Environment variable Description================================== ======================================================================================================- ``STRIPE_PUBLIC_KEY`` Your Stripe's public key (test or live)- ``STRIPE_SECRET_KEY`` Your Stripe's secret key (test or live)+ ``STRIPE_PUBLIC_KEY`` Your Stripe public key (test or live)+ ``STRIPE_SECRET_KEY`` Your Stripe secret key (test or live)``STRIPE_STORE_NAME`` Your store name to show in the checkout form``STRIPE_STORE_IMAGE`` An absolute or relative link of your store logo to show in the checkout form``STRIPE_PREFILL`` Prefill the email adddress in the checkout form if set to ``True`` (default)``STRIPE_REMEMBER_ME`` Add "Remember Me" for future purchases in the checkout form if set to ``True`` (default)- ``STRIPE_LOCAL`` Specify auto to display checkout form in the user's preferred language (default)+ ``STRIPE_LOCAL`` Specify ``auto`` to display checkout form in the user's preferred language (default)``STRIPE_ENABLE_BILLING_ADDRESS`` Collect the user's billing address in the checkout form if set to ``True``. The default is ``False````STRIPE_ENABLE_SHIPPING_ADDRESS`` Collect the user's shipping address in the checkout form if set to ``True``. The default is ``False``================================== ======================================================================================================diff --git a/tests/gateway/test_stripe.py b/tests/gateway/test_stripe.pyindex 658efc6e49..a9b9f7809a 100644--- a/tests/gateway/test_stripe.py+++ b/tests/gateway/test_stripe.py@@ -97,9 +97,9 @@ def stripe_charge_success_response():'id': TRANSACTION_TOKEN,'amount': get_amount_for_stripe(TRANSACTION_AMOUNT, TRANSACTION_CURRENCY),- "amount_refunded": 0,+ 'amount_refunded': 0,'currency': get_currency_for_stripe(TRANSACTION_CURRENCY),- "status": "succeeded"}+ 'status': 'succeeded'}@pytest.fixture()@@ -245,14 +245,14 @@ def test_get_client_token():def test_get_error_response_from_exc():- stripe_error = \- stripe.error.StripeError(json_body=dict(message=ERROR_MESSAGE))- invalid_request_error = \- stripe.error.InvalidRequestError(message=ERROR_MESSAGE, param=None)+ stripe_error = stripe.error.StripeError(+ json_body={'message': ERROR_MESSAGE})+ invalid_request_error = stripe.error.InvalidRequestError(+ message=ERROR_MESSAGE, param=None)- assert _get_error_response_from_exc(stripe_error) == \- dict(message=ERROR_MESSAGE)- assert _get_error_response_from_exc(invalid_request_error) == dict()+ assert _get_error_response_from_exc(stripe_error) == {+ 'message': ERROR_MESSAGE}+ assert _get_error_response_from_exc(invalid_request_error) == {}def test_create_transaction_with_charge_success_response(@@ -294,7 +294,7 @@ def test_create_transaction_with_refund_success_response(def test_create_transaction_with_error_response(stripe_payment):payment = stripe_payment- stripe_error_response = dict()+ stripe_error_response = {}txn = _create_transaction(payment=payment, amount=payment.total, kind='ANYKIND',response=stripe_error_response)@@ -359,8 +359,8 @@ def test_capture(stripe_charge_success_response):payment = stripe_authorized_paymentresponse = stripe_charge_success_response- mock_charge_retrieve.return_value = \- Mock(capture=Mock(return_value=response))+ mock_charge_retrieve.return_value = Mock(+ capture=Mock(return_value=response))txn, error = capture(payment, TRANSACTION_AMOUNT, **gateway_params)@@ -383,8 +383,8 @@ def test_partial_capture(stripe_partial_charge_success_response):payment = stripe_authorized_paymentresponse = stripe_partial_charge_success_response- mock_charge_retrieve.return_value = \- Mock(capture=Mock(return_value=response))+ mock_charge_retrieve.return_value = Mock(+ capture=Mock(return_value=response))txn, error = capture(payment, TRANSACTION_AMOUNT, **gateway_params)@@ -418,8 +418,7 @@ def test_capture_error_response(assert not txn.is_successassert txn.amount == payment.totalassert txn.currency == payment.currency- assert txn.gateway_response == \- _get_error_response_from_exc(stripe_error)+ assert txn.gateway_response == _get_error_response_from_exc(stripe_error)@pytest.mark.integration@@ -437,7 +436,7 @@ def test_capture_not_authorized(assert not txn.is_successassert txn.amount == payment.totalassert txn.currency == TRANSACTION_CURRENCY- assert txn.gateway_response == dict()+ assert txn.gateway_response == {}@pytest.mark.integration@@ -485,8 +484,7 @@ def test_charge_error_response(assert not txn.is_successassert txn.amount == payment.totalassert txn.currency == payment.currency- assert txn.gateway_response == \- _get_error_response_from_exc(stripe_error)+ assert txn.gateway_response == _get_error_response_from_exc(stripe_error)@pytest.mark.integration@@ -564,8 +562,7 @@ def test_refund_error_response(assert not txn.is_successassert txn.amount == payment.totalassert txn.currency == TRANSACTION_CURRENCY- assert txn.gateway_response == \- _get_error_response_from_exc(stripe_error)+ assert txn.gateway_response == _get_error_response_from_exc(stripe_error)@pytest.mark.integration@@ -583,7 +580,7 @@ def test_refund_not_charged_or_captured(assert not txn.is_successassert txn.amount == payment.totalassert txn.currency == TRANSACTION_CURRENCY- assert txn.gateway_response == dict()+ assert txn.gateway_response == {}@pytest.mark.integration@@ -635,8 +632,7 @@ def test_void_error_response(assert not txn.is_successassert txn.amount == payment.totalassert txn.currency == TRANSACTION_CURRENCY- assert txn.gateway_response == \- _get_error_response_from_exc(stripe_error)+ assert txn.gateway_response == _get_error_response_from_exc(stripe_error)@pytest.mark.integration@@ -654,4 +650,4 @@ def test_void_not_authorized(assert not txn.is_successassert txn.amount == payment.totalassert txn.currency == TRANSACTION_CURRENCY- assert txn.gateway_response == dict()+ assert txn.gateway_response == {}diff --git a/tests/settings.py b/tests/settings.pyindex c068a1a4f4..387f91ab0f 100644--- a/tests/settings.py+++ b/tests/settings.py@@ -28,5 +28,5 @@ CHECKOUT_PAYMENT_GATEWAYS = {DUMMY: 'Dummy gateway',BRAINTREE: 'Braintree',RAZORPAY: 'Razorpay',- STRIPE: 'Stripe',+ STRIPE: 'Stripe'}