| Line 20... |
Line 20... |
| 20 |
from shop2020.clients.UserClient import UserClient
|
20 |
from shop2020.clients.UserClient import UserClient
|
| 21 |
from shop2020.model.v1.user.impl.CartDataAccessors import create_line_item, create_order
|
21 |
from shop2020.model.v1.user.impl.CartDataAccessors import create_line_item, create_order
|
| 22 |
from shop2020.model.v1.user.impl import Dataservice
|
22 |
from shop2020.model.v1.user.impl import Dataservice
|
| 23 |
from shop2020.clients.TransactionClient import TransactionClient
|
23 |
from shop2020.clients.TransactionClient import TransactionClient
|
| 24 |
from shop2020.clients.PaymentClient import PaymentClient
|
24 |
from shop2020.clients.PaymentClient import PaymentClient
|
| 25 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, TransactionStatus
|
25 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, TransactionStatus, OrderSource
|
| 26 |
from shop2020.thriftpy.payments.ttypes import Attribute, PaymentStatus
|
26 |
from shop2020.thriftpy.payments.ttypes import Attribute, PaymentStatus
|
| 27 |
from shop2020.utils.Utils import to_java_date
|
27 |
from shop2020.utils.Utils import to_java_date
|
| 28 |
|
28 |
|
| 29 |
RTGS_GATEWAY_ID = 6
|
29 |
RTGS_GATEWAY_ID = 6
|
| 30 |
PAYMETHOD_ATTR = 'payMethod'
|
30 |
PAYMETHOD_ATTR = 'payMethod'
|
| Line 110... |
Line 110... |
| 110 |
print "Amount paid is not equal to the total amount of bulk order."
|
110 |
print "Amount paid is not equal to the total amount of bulk order."
|
| 111 |
return
|
111 |
return
|
| 112 |
|
112 |
|
| 113 |
txn_id = create_transaction(user, items)
|
113 |
txn_id = create_transaction(user, items)
|
| 114 |
create_payment(user, amount, txn_id, rtgs_id, rtgs_bank, rtgs_branch, ifsc)
|
114 |
create_payment(user, amount, txn_id, rtgs_id, rtgs_bank, rtgs_branch, ifsc)
|
| 115 |
transaction_client.changeTransactionStatus(txn_id, TransactionStatus.AUTHORIZED, "Payment received for the order", 0, 0);
|
115 |
transaction_client.changeTransactionStatus(txn_id, TransactionStatus.AUTHORIZED, "Payment received for the order", 0, 0, OrderSource.WEBSITE);
|
| 116 |
transaction_client.changeTransactionStatus(txn_id, TransactionStatus.IN_PROCESS, "RTGS Payment accepted", 0, 0);
|
116 |
transaction_client.changeTransactionStatus(txn_id, TransactionStatus.IN_PROCESS, "RTGS Payment accepted", 0, 0, OrderSource.WEBSITE);
|
| 117 |
|
117 |
|
| 118 |
def main():
|
118 |
def main():
|
| 119 |
parser = optparse.OptionParser()
|
119 |
parser = optparse.OptionParser()
|
| 120 |
parser.add_option("-f", "--file", dest="file",
|
120 |
parser.add_option("-f", "--file", dest="file",
|
| 121 |
help="Excel file with bulk orders.")
|
121 |
help="Excel file with bulk orders.")
|