This shouldn't go here. It should go in [trans_start_url](https://github.com/wraithan/webpay/blob/1d64e26d77d13521490aa4e23556cfaa2048de18/webpay/pay/views.py#L157). The function you put it in only needs to check the pending status because that's a possible way to optimize the flow.