def section_e(): """ Force """ results = collections.OrderedDict() results['section'] = 'e' order = Order(message_type='FC', cc_num='4788250000028291', order_id='501', cc_expiry='1116', prior_auth_id='654544', amount='12.00') results['1'] = order.charge() order = Order(message_type='FC', cc_num='5454545454545454', order_id='502', cc_expiry='1116', prior_auth_id='15X92Z', amount='11.00') results['2a'] = result = order.charge() tx_ref_num = result['TxRefNum'] tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='11.00', order_id=order.order_id) results['2b'] = reversal.void() order = Order(message_type='FC', cc_num='371449635398431', order_id='503', cc_expiry='1116', prior_auth_id='198543', amount='1055.00') results['3'] = order.charge() order = Order(message_type='FC', cc_num='6011000995500000', order_id='504', cc_expiry='1116', prior_auth_id='098756', amount='10.00') results['4a'] = result = order.charge() tx_ref_num = result['TxRefNum'] tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='10.00', order_id=order.order_id) results['4b'] = reversal.reversal() order = Order(message_type='FC', cc_num='3566002020140006', order_id='505', cc_expiry='1116', prior_auth_id='8B957Y', amount='29.00') results['5'] = order.charge() return results
def section_b(): """ Auth Capture and Online Reversal Transactions """ results = collections.OrderedDict() results['section'] = 'b' order = Order(message_type='AC', cc_num='4788250000028291', order_id='201', cc_expiry='1116', zip_code='11111', cvd='111', amount='30.00') results['1a'] = result = order.charge() tx_ref_num = result['TxRefNum'] tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='30.00', order_id=order.order_id) results['1b'] = reversal.reversal() order = Order(message_type='AC', cc_num='4788250000028291', order_id='202', cc_expiry='1116', zip_code='L6L2X9', cvd='111', amount='38.01') results['2'] = order.charge() order = Order(message_type='AC', cc_num='4788250000028291', order_id='203', cc_expiry='1116', zip_code='22222', cvd='222', amount='85.00') results['3'] = order.charge() order = Order(message_type='AC', cc_num='4788250000028291', order_id='204', cc_expiry='1116', zip_code='11111', cvd='555', amount='125.00') results['4'] = order.charge() order = Order(message_type='AC', cc_num='5454545454545454', order_id='205', cc_expiry='1116', zip_code='L6L2X9', amount='41.00') results['5a'] = result = order.charge() tx_ref_num = result['TxRefNum'] tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='41.00', order_id=order.order_id) results['5b'] = reversal.reversal() order = Order(message_type='AC', cc_num='5454545454545454', order_id='206', cc_expiry='1116', zip_code='88888', cvd='666', amount='11.02') results['6'] = order.charge() order = Order(message_type='AC', cc_num='5454545454545454', order_id='207', cc_expiry='1116', zip_code='L6L2X9', cvd='666', amount='70.00') results['7'] = order.charge() order = Order(message_type='AC', cc_num='5454545454545454', order_id='208', cc_expiry='1116', zip_code='55555', cvd='222', amount='100.00') results['8'] = order.charge() order = Order(message_type='AC', cc_num='371449635398431', order_id='209', cc_expiry='1116', zip_code='L6L2X9', amount='1055.00') results['9'] = order.charge() order = Order(message_type='AC', cc_num='371449635398431', order_id='210', cc_expiry='1116', zip_code='44444', amount='55.00') results['10a'] = result = order.charge() tx_ref_num = result['TxRefNum'] tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='55.00', order_id=order.order_id) results['10b'] = reversal.reversal() order = Order(message_type='AC', cc_num='371449635398431', order_id='211', cc_expiry='1116', zip_code='66666', cvd='2222', amount='75.00') results['11'] = order.charge() order = Order(message_type='AC', cc_num='6011000995500000', order_id='212', cc_expiry='1116', zip_code='77777', amount='10.00') results['12'] = order.charge() order = Order(message_type='AC', cc_num='6011000995500000', order_id='213', cc_expiry='1116', zip_code='77777', amount='15.00') results['13a'] = result = order.charge() tx_ref_num = result['TxRefNum'] tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='15.00', order_id=order.order_id) results['13b'] = reversal.reversal() order = Order(message_type='AC', cc_num='6011000995500000', order_id='214', cc_expiry='1116', zip_code='L6L2X9', cvd='444', amount='63.03') results['14'] = result = order.charge() order = Order(message_type='AC', cc_num='3566002020140006', order_id='215', cc_expiry='1116', zip_code='33333', amount='29.00') results['15'] = result = order.charge() return results
def section_a(): """ Auth Only, Mark for Capture, and Online Reversals Transactions """ results = collections.OrderedDict() results['section'] = 'a' order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='4788250000028291', order_id='101', cc_expiry='1116', zip_code='11111', cvd='111', amount='30.00') result = order.charge() results['1a'] = result print(result) if 'TxRefNum' in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='30', order_id=order.order_id) results['1b'] = reversal.reversal() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='4788250000028291', order_id='102', cc_expiry='1116', zip_code='L6L2X9', cvd='111', amount='38.01') results['2'] = order.charge() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='4788250000028291', order_id='103', cc_expiry='1116', zip_code='22222', cvd='222', amount='85.00') result = order.charge() results['3a'] = result if 'TxRefNum' in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='85.00', tx_ref_num=tx_ref_num) results['3b'] = capture.request() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='4788250000028291', order_id='104', cc_expiry='1116', zip_code='66666', amount='0.00') result = order.charge() results['4'] = result #tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='4788250000028291', order_id='105', cc_expiry='1116', zip_code='11111', cvd='555', amount='125.00') result = order.charge() results['5a'] = result if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='75.00', tx_ref_num=tx_ref_num) results['5b'] = capture.request() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='5454545454545454', order_id='106', cc_expiry='1116', zip_code='L6L2X9', amount='41.00') result = results['6a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='41.00', order_id=order.order_id) results['6b'] = reversal.reversal() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='5454545454545454', order_id='107', cc_expiry='1116', zip_code='88888', cvd='666', amount='11.02') results['7'] = order.charge() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='5454545454545454', order_id='108', cc_expiry='1116', zip_code='L6L2X9', cvd='666', amount='70.00') result = results['8a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='70.00', tx_ref_num=tx_ref_num) results['8b'] = capture.request() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='5454545454545454', order_id='109', cc_expiry='1116', zip_code='55555', cvd='222', amount='100.00') result = results['9a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='70.00', tx_ref_num=tx_ref_num) results['9b'] = capture.request() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='5454545454545454', order_id='110', cc_expiry='1116', zip_code='88888', amount='0.00') results['10'] = order.charge() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='371449635398431', order_id='111', cc_expiry='1116', zip_code='L6L2X9', amount='1055.00') result = results['11a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='500.00', tx_ref_num=tx_ref_num) results['11b'] = capture.request() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='371449635398431', order_id='112', cc_expiry='1116', zip_code='44444', amount='55.00') result = results['12a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='55.00', order_id=order.order_id) results['12b'] = reversal.reversal() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='371449635398431', order_id='113', cc_expiry='1116', zip_code='44444', cvd='2222', amount='75.00') result = results['13a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='75.00', tx_ref_num=tx_ref_num) results['13b'] = capture.request() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='371449635398431', order_id='114', cc_expiry='1116', zip_code='22222', amount='0.00') results['14'] = order.charge() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='6011000995500000', order_id='115', cc_expiry='1116', zip_code='77777', amount='10.00') result = results['15a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='10.00', tx_ref_num=tx_ref_num) results['15b'] = capture.request() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='6011000995500000', order_id='116', cc_expiry='1116', zip_code='77777', amount='15.00') result = results['16a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='15.00', order_id=order.order_id) results['16b'] = reversal.reversal() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='6011000995500000', order_id='117', cc_expiry='1116', zip_code='L6L2X9', cvd='444', amount='63.03') results['17'] = order.charge() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='6011000995500000', order_id='118', cc_expiry='1116', zip_code='L6L2X9', cvd='444', amount='63.03') results['18'] = order.charge() order = Order(merchant_id=merchant_id, username=username, password=password, message_type='A', cc_num='3566002020140006', order_id='119', cc_expiry='1116', zip_code='33333', amount='29.00') results['19'] = order.charge() return results
def section_a(): """ Auth Only, Mark for Capture, and Online Reversals Transactions """ results = collections.OrderedDict() results['section'] = 'a' order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='4788250000028291', order_id='101', cc_expiry='1116', zip_code='11111', cvd='111', amount='30.00') result = order.charge() results['1a'] = result print(result) if 'TxRefNum' in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='30', order_id=order.order_id) results['1b'] = reversal.reversal() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='4788250000028291', order_id='102', cc_expiry='1116', zip_code='L6L2X9', cvd='111', amount='38.01') results['2'] = order.charge() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='4788250000028291', order_id='103', cc_expiry='1116', zip_code='22222', cvd='222', amount='85.00') result = order.charge() results['3a'] = result if 'TxRefNum' in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='85.00', tx_ref_num=tx_ref_num) results['3b'] = capture.request() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='4788250000028291', order_id='104', cc_expiry='1116', zip_code='66666', amount='0.00') result = order.charge() results['4'] = result #tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='4788250000028291', order_id='105', cc_expiry='1116', zip_code='11111', cvd='555', amount='125.00') result = order.charge() results['5a'] = result if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='75.00', tx_ref_num=tx_ref_num) results['5b'] = capture.request() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='5454545454545454', order_id='106', cc_expiry='1116', zip_code='L6L2X9', amount='41.00') result = results['6a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='41.00', order_id=order.order_id) results['6b'] = reversal.reversal() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='5454545454545454', order_id='107', cc_expiry='1116', zip_code='88888', cvd='666', amount='11.02') results['7'] = order.charge() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='5454545454545454', order_id='108', cc_expiry='1116', zip_code='L6L2X9', cvd='666', amount='70.00') result = results['8a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='70.00', tx_ref_num=tx_ref_num) results['8b'] = capture.request() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='5454545454545454', order_id='109', cc_expiry='1116', zip_code='55555', cvd='222', amount='100.00') result = results['9a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='70.00', tx_ref_num=tx_ref_num) results['9b'] = capture.request() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='5454545454545454', order_id='110', cc_expiry='1116', zip_code='88888', amount='0.00') results['10'] = order.charge() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='371449635398431', order_id='111', cc_expiry='1116', zip_code='L6L2X9', amount='1055.00') result = results['11a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='500.00', tx_ref_num=tx_ref_num) results['11b'] = capture.request() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='371449635398431', order_id='112', cc_expiry='1116', zip_code='44444', amount='55.00') result = results['12a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='55.00', order_id=order.order_id) results['12b'] = reversal.reversal() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='371449635398431', order_id='113', cc_expiry='1116', zip_code='44444', cvd='2222', amount='75.00') result = results['13a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='75.00', tx_ref_num=tx_ref_num) results['13b'] = capture.request() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='371449635398431', order_id='114', cc_expiry='1116', zip_code='22222', amount='0.00') results['14'] = order.charge() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='6011000995500000', order_id='115', cc_expiry='1116', zip_code='77777', amount='10.00') result = results['15a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] capture = MarkForCapture(order_id=order.order_id, amount='10.00', tx_ref_num=tx_ref_num) results['15b'] = capture.request() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='6011000995500000', order_id='116', cc_expiry='1116', zip_code='77777', amount='15.00') result = results['16a'] = order.charge() if "TxRefNum" in result: tx_ref_num = result['TxRefNum'] #tx_ref_idx = result['TxRefIdx'] reversal = Reversal(tx_ref_num=tx_ref_num, tx_ref_idx='0', amount='15.00', order_id=order.order_id) results['16b'] = reversal.reversal() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='6011000995500000', order_id='117', cc_expiry='1116', zip_code='L6L2X9', cvd='444', amount='63.03') results['17'] = order.charge() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='6011000995500000', order_id='118', cc_expiry='1116', zip_code='L6L2X9', cvd='444', amount='63.03') results['18'] = order.charge() order = Order(merchant_id=MERCHANT_ID, message_type='A', cc_num='3566002020140006', order_id='119', cc_expiry='1116', zip_code='33333', amount='29.00') results['19'] = order.charge() return results