Exemple #1
0
 def tagged_void(self, sale, **kwargs):
     #
     # Tagged Void
     #
     defaults = dict(gateway_id=os.environ.get('FD_GATEWAY_ID'),
                     password=os.environ.get('FD_PASSWORD'),
                     transaction_type="33",
                     transaction_tag=sale['transaction_tag'],
                     amount=sale['amount'],
                     authorization_num=sale['authorization_num'])
     defaults.update(kwargs)
     return firstdata.FirstData(os.environ.get('FD_KEY'),
                                os.environ.get('FD_SECRET'),
                                **defaults).process(test=True)
Exemple #2
0
 def refund(self, **kwargs):
     #
     # Refund
     #
     defaults = dict(gateway_id=os.environ.get('FD_GATEWAY_ID'),
                     password=os.environ.get('FD_PASSWORD'),
                     transaction_type="04",
                     cardholder_name="Daffy Duck",
                     cc_number="4111111111111111",
                     amount="10.00",
                     cc_expiry="1215")
     defaults.update(kwargs)
     return firstdata.FirstData(os.environ.get('FD_KEY'),
                                os.environ.get('FD_SECRET'),
                                **defaults).process(test=True)
Exemple #3
0
 def test_http_fetch(self):
     httpclient = tornado.httpclient.AsyncHTTPClient()
     fd = firstdata.FirstData(os.environ.get('FD_KEY'),
                              os.environ.get('FD_SECRET'),
                              gateway_id=os.environ.get('FD_GATEWAY_ID'),
                              password=os.environ.get('FD_PASSWORD'),
                              transaction_type="01",
                              cardholder_name="Daffy Duck",
                              amount="10.00",
                              cc_number="4111111111111111",
                              cc_expiry="1215")
     fd.process(httpclient=httpclient,
                callback=self.handle_fetch,
                test=True)
     self.wait()
Exemple #4
0
 def refund_transarmor(self, transarmor, **kwargs):
     #
     # Refund w/ TransArmor
     #
     defaults = dict(gateway_id=os.environ.get('FD_GATEWAY_ID'),
                     password=os.environ.get('FD_PASSWORD'),
                     transaction_type="04",
                     cardholder_name="Daffy Duck",
                     transarmor_token=transarmor['transarmor_token'],
                     amount=transarmor['amount'],
                     credit_card_type=transarmor['credit_card_type'],
                     cc_expiry=transarmor['cc_expiry'])
     defaults.update(kwargs)
     return firstdata.FirstData(os.environ.get('FD_KEY'),
                                os.environ.get('FD_SECRET'),
                                **defaults).process(test=True)
Exemple #5
0
 def pre_authorization_transarmor(self, sale, **kwargs):
     #
     # Pre-Authoization w/ TransArmor Token for $15.00
     #
     defaults = dict(gateway_id=os.environ.get('FD_GATEWAY_ID'),
                     password=os.environ.get('FD_PASSWORD'),
                     transaction_type="01",
                     transarmor_token=sale['transarmor_token'],
                     cardholder_name="Daffy Duck",
                     amount="15.00",
                     credit_card_type=sale['credit_card_type'],
                     cc_expiry=sale['cc_expiry'])
     defaults.update(kwargs)
     return firstdata.FirstData(os.environ.get('FD_KEY'),
                                os.environ.get('FD_SECRET'),
                                **defaults).process(test=True)
Exemple #6
0
 def void_transarmor(self, sale, **kwargs):
     #
     # Tip > 15% => Void
     #
     defaults = dict(gateway_id=os.environ.get('FD_GATEWAY_ID'),
                     password=os.environ.get('FD_PASSWORD'),
                     transaction_type="33",
                     amount="10.00",
                     transarmor_token=sale['transarmor_token'],
                     cc_expiry=sale['cc_expiry'],
                     credit_card_type=sale['credit_card_type'],
                     authorization_num=sale['authorization_num'],
                     transaction_tag=sale['transaction_tag'])
     defaults.update(kwargs)
     return firstdata.FirstData(os.environ.get('FD_KEY'),
                                os.environ.get('FD_SECRET'),
                                **defaults).process(test=True)
Exemple #7
0
 def tagged_pre_authorization_complete_transarmor(self, sale, **kwargs):
     #
     # Tagged Pre-Authorization Completion w/ TransArmor
     #
     defaults = dict(gateway_id=os.environ.get('FD_GATEWAY_ID'),
                     password=os.environ.get('FD_PASSWORD'),
                     transaction_type="32",
                     cardholder_name=sale['cardholder_name'],
                     transarmor_token=sale['transarmor_token'],
                     amount=sale['amount'],
                     credit_card_type=sale['credit_card_type'],
                     authorization_num=sale['authorization_num'],
                     transaction_tag=sale['transaction_tag'],
                     cc_expiry=sale['cc_expiry'])
     defaults.update(kwargs)
     return firstdata.FirstData(os.environ.get('FD_KEY'),
                                os.environ.get('FD_SECRET'),
                                **defaults).process(test=True)
Exemple #8
0
 def test_http_fetch(self):
     httpclient = tornado.httpclient.AsyncHTTPClient()
     fd = firstdata.FirstData(
         os.environ.get('FD_KEY'),
         os.environ.get('FD_SECRET'),
         cc_expiry='1215',
         cc_verification_str1=None,
         credit_card_type='Visa',
         cc_verification_str2='',
         cc_number='4111111111111111',
         track1='B4111111111111111^SMITH/JOHN^15124041234567891234',
         cardholder_name='Customer',
         amount='10.00',
         track2='4111111111111111=151224041234567891234',
         transaction_type='01',
         cvd_presence_ind=0,
         zip_code=None,
         gateway_id=os.environ.get('FD_GATEWAY_ID'),
         password=os.environ.get('FD_PASSWORD'))
     fd.process(httpclient=httpclient,
                callback=self.handle_fetch,
                test=True)
     self.wait()