def do_express_checkout_payment(self, token, payerID, amount):
        assert isinstance(token, str)
        assert isinstance(payerID, str)
        assert isinstance(amount, str)
        
        headers = { 'X-VPS-REQUEST-ID': uuid.uuid4(), }
        params = NvpDict(
            #Base parameters
            TRXTYPE='S',
            TENDER='P', #P for paypal, C for credit card
            PARTNER='PayPal',
            VENDOR=self._merchantUser, #same as user for a single user account
            USER=self._user,
            PWD=self._password,
            #Other parameters
            ACTION='D',
            TOKEN=token,
            PAYERID=payerID,
            AMT=amount,
            ORDERDESC=utils.truncate('%s SERVICE' % self._siteDomain, 127, etc=''),
            SHIPTOSTREET='', #required?
            SHIPTOCITY='', #required?
            SHIPTOCOUNTRY='US', #required?
            L_DESCn=utils.truncate('%s SERVICE' % self._siteDomain, 127, etc=''),
        )

        responseData = self._make_request(headers, params)
        return self._make_response_dict(responseData)
 def do_direct_payment(self, amount, acct, expMo, expYear, firstName='', lastName='', ccType='', street1='',
 street2='', city='', state='', postalCode='', countryCode='', cvv2=None):
     
     assert isinstance(amount, str)
     assert isinstance(acct, str)
     assert isinstance(expMo, str)
     assert isinstance(expYear, str)
     assert isinstance(firstName, str)
     assert isinstance(lastName, str)
     assert isinstance(ccType, str)
     assert isinstance(street1, str)
     assert isinstance(street2, str)
     assert isinstance(city, str)
     assert isinstance(state, str)
     assert isinstance(postalCode, str)
     assert isinstance(countryCode, str)
             
     if self._apiMode == 'sandbox':
         self.API_ENDPOINT = self.PAYPAL_NVP_API_URL_SANDBOX
     elif self._apiMode == 'live':
         self.API_ENDPOINT = self.PAYPAL_NVP_API_URL_LIVE
         
     headers = { 'X-VPS-REQUEST-ID': uuid.uuid4(), }
     
     params = NvpDict(
         #Required parameters
         TRXTYPE='S',
         TENDER='C', #P for paypal, C for credit card
         PARTNER='PayPal',
         VENDOR=self._merchantUser, #same as user for a single user account
         USER=self._user,
         PWD=self._password,
         ACCT=acct,
         AMT=amount,
         #^ use userID instead of username b/c username can have underscores and this is an alphanumeric field only
         CURRENCY='USD',
         EXPDATE=expMo + expYear, #like 0308 for March, 2008
         NAME=str(utils.truncate(firstName + ' ' + lastName, 30, etc='')),
         STREET=str(utils.truncate(street1 + street2, 30, etc='')),
         CITY=city,
         STATE=state,
         ZIP=postalCode,
         BILLTOCOUNTRY=countryCode,
     )
     
     # cvv2 is not required, if it is passed then use it
     if cvv2:
         params['CVV2'] = cvv2
         
     responseData = self._make_request(headers, params)
     return self._make_response_dict(responseData)
 def finished(responseText):
     log.msg(
         'HTTP Request to "%s" (timeout=%s) finished: response: "%s"'
         % (requestURL, timeout, utils.truncate(responseText, 180)),
         lvl="d",
         ss="ss_webreq",
     )
     return {"success": True, "data": responseText}