def METHOD_NAME(
    mocked_gateway, mocked_logger, razorpay_payment, gateway_config
):
    # Data to be passed
    payment_token = "123"
    # Assign the side effect to the gateway's `capture()` method,
    # that should trigger the expected error.
    mocked_gateway.return_value.payment.capture.side_effect = BadRequestError()
    payment_info = create_payment_information(
        razorpay_payment, payment_token=payment_token, amount=TRANSACTION_AMOUNT
    )
    # Attempt charging
    response = capture(payment_info, gateway_config)
    # Ensure an error was returned
    assert response.error == errors.INVALID_REQUEST
    assert not response.is_success
    # Ensure the response is correctly set
    assert response.kind == TransactionKind.CAPTURE
    assert response.transaction_id == payment_token
    # Ensure the HTTP error was logged
    assert mocked_logger.call_count == 1