def submit(self, request, transaction, mobile: str=None, valid_card_number: str=None, callback: str=None):
    "Submits a transaction to Pay.ir.\n\n        When called, the method submits the necessary information about the transaction to Pay.ir and returns a\n        HttpResponseRedirect object that can redirect the user to the gateway, if nothing goes wrong. In case of an\n        error, a GatewayError is raised, containing the error_code and error_message reported by Pay.ir.\n\n        :param request: The WSGIRequest object passed to the view.\n        :param transaction: A transaction object (or a similar class) that's already been saved to the database.\n        :param mobile: (Optional) Phone number of the payer. If provided, payer's saved card numbers will be listed for them in the gateway.\n        :param valid_card_number: (Optional) Specifies a single card number as the only one that can complete the transaction.\n        :param callback: (Optional) Overrides the default callback of the gateway.\n        "
    payload = self._prepare_submission_payload(request, transaction, mobile, valid_card_number, (callback or self.default_callback))
    response = requests.post(self.submission_url, data=payload)
    data = response.json()
    if response:
        transaction.token = data['token']
        transaction.save()
        return redirect(f'https://pay.ir/pg/{transaction.token}')
    raise exceptions.GatewayError(error_code=data['errorCode'], error_message=data['errorMessage'])
Submits a transaction to Pay.ir.

When called, the method submits the necessary information about the transaction to Pay.ir and returns a
HttpResponseRedirect object that can redirect the user to the gateway, if nothing goes wrong. In case of an
error, a GatewayError is raised, containing the error_code and error_message reported by Pay.ir.

:param request: The WSGIRequest object passed to the view.
:param transaction: A transaction object (or a similar class) that's already been saved to the database.
:param mobile: (Optional) Phone number of the payer. If provided, payer's saved card numbers will be listed for them in the gateway.
:param valid_card_number: (Optional) Specifies a single card number as the only one that can complete the transaction.
:param callback: (Optional) Overrides the default callback of the gateway.
def submit(self, request, transaction, mobile: str=None, valid_card_number: str=None, callback: str=None):
    "Submits a transaction to Pay.ir.\n\n        When called, the method submits the necessary information about the transaction to Pay.ir and returns a\n        HttpResponseRedirect object that can redirect the user to the gateway, if nothing goes wrong. In case of an\n        error, a GatewayError is raised, containing the error_code and error_message reported by Pay.ir.\n\n        :param request: The WSGIRequest object passed to the view.\n        :param transaction: A transaction object (or a similar class) that's already been saved to the database.\n        :param mobile: (Optional) Phone number of the payer. If provided, payer's saved card numbers will be listed for them in the gateway.\n        :param valid_card_number: (Optional) Specifies a single card number as the only one that can complete the transaction.\n        :param callback: (Optional) Overrides the default callback of the gateway.\n        "
    payload = self._prepare_submission_payload(request, transaction, mobile, valid_card_number, (callback or self.default_callback))
    response = requests.post(self.submission_url, data=payload)
    data = response.json()
    if response:
        transaction.token = data['token']
        transaction.save()
        return redirect(f'https://pay.ir/pg/{transaction.token}')
    raise exceptions.GatewayError(error_code=data['errorCode'], error_message=data['errorMessage'])