Browse files

initial commit

  • Loading branch information...
1 parent 4d913df commit 083a3f0ffb03da7330a74c24d8697086485230a5 Jonathan Vanasco committed with Feb 16, 2010
Showing with 345 additions and 228 deletions.
  1. +17 −2 README.md
  2. +2 −3 paypal/sdk/__init__.py
  3. +9 −1 paypal/sdk/exceptions.py
  4. +211 −181 paypal/sdk/interface.py
  5. +9 −3 paypal/sdk/response.py
  6. +67 −19 paypal/sdk/settings.py
  7. +30 −19 paypal/test.py
View
19 README.md
@@ -5,9 +5,24 @@ To run test suite:
python paypal/test.py
-The meat is in `paypal.sdk.methods`. The docs are in the docstrings and tests.
+The meat is in `paypal.sdk.interface`. The docs are in the docstrings and tests.
+
+- Create a paypal.sdk.interface.Interface object
+- pass it configuration args
+- that interface is how you access paypal.
+
+Pat Collins' original was useful, but had the config info hardcoded into a Settings object.
+
+So I refactored hid code into more of an OOP concept.
+
+basically, you create a sdk.Interface() instace with the account details. that creates an internal config object of the PayPalConfig() class ( was settings.py ). this could be overriden by making a raw config object and explicitly setting it.
+
+all of the original methods were migrated to the the Interface class -- and alphabetized -- as methods of that class.
+
+the end result -- which i was going for -- is that i can now construct an interface with the account settings -- and not worry about editing config files and having to manually place this library in every project. It's also easier to lookup info.
+
+-- Jonathan Vanasco ( jonathan@2xlp.com )
-A set of credentials are included, but please don't use them. Honor system folks. Use the instructions in Addendum A to create your own test account and get API credentials.
WHY?
----
View
5 paypal/sdk/__init__.py
@@ -1,4 +1,3 @@
# coding=utf-8
-from exceptions import ApiError
-from settings import *
-from methods import *
+
+from interface import Interface
View
10 paypal/sdk/exceptions.py
@@ -1,4 +1,12 @@
# coding=utf-8
-class ApiError(Exception):
+class Error(Exception):
+ """Parent Error"""
+ def __init__(self, message):
+ self.message = message
+ def __str__(self):
+ return repr(self.message)
+
+
+class ApiError(Error):
pass
View
392 paypal/sdk/interface.py
@@ -1,193 +1,223 @@
# coding=utf-8
-"""
-Methods to take advantage of the Website Payments Pro and Express Checkout
-PayPal APIs.
-"""
+from settings import PayPalConfig
import socket
import urllib
import urllib2
from urlparse import urlsplit, urlunsplit
-from settings import *
from response import Response
from exceptions import ApiError
-API_AUTHENTICATION_MODES = ("3TOKEN", "UNIPAY")
-
-def call(method, **kwargs):
- """
- Wrapper method for executing all API commands over HTTP. This method is
- further used to implement wrapper methods listed here:
-
- https://www.x.com/docs/DOC-1374
-
- ``method`` must be a supported NVP method listed at the above address.
-
- ``kwargs`` will be a hash of
- """
- socket.setdefaulttimeout(HTTP_TIMEOUT)
-
- urlvalues = {
- 'METHOD': method,
- 'VERSION': VERSION
- }
-
- if API_AUTHENTICATION_MODE not in API_AUTHENTICATION_MODES:
- raise ApiError("Not a supported auth mode. Use one of: %s" % \
- ", ".join(API_AUTHENTICATION_MODES))
- headers = {}
- if(API_AUTHENTICATION_MODE == "3TOKEN"):
- # headers['X-PAYPAL-SECURITY-USERID'] = API_USERNAME
- # headers['X-PAYPAL-SECURITY-PASSWORD'] = API_PASSWORD
- # headers['X-PAYPAL-SECURITY-SIGNATURE'] = API_SIGNATURE
- urlvalues['USER'] = API_USERNAME
- urlvalues['PWD'] = API_PASSWORD
- urlvalues['SIGNATURE'] = API_SIGNATURE
- elif(API_AUTHENTICATION_MODE == "UNIPAY"):
- # headers['X-PAYPAL-SECURITY-SUBJECT'] = SUBJECT
- urlvalues['SUBJECT'] = SUBJECT
- # headers['X-PAYPAL-REQUEST-DATA-FORMAT'] = 'NV'
- # headers['X-PAYPAL-RESPONSE-DATA-FORMAT'] = 'NV'
- # print(headers)
- for k,v in kwargs.iteritems():
- urlvalues[k.upper()] = v
-
- data = urllib.urlencode(urlvalues)
- req = urllib2.Request(API_ENDPOINT, data, headers)
- response = Response(urllib2.urlopen(req).read())
-
- if not response.success:
- raise ApiError(response)
- return response
-
-def address_verify(email, street, zip):
- """Shortcut for the AddressVerify method.
-
- ``email``::
- Email address of a PayPal member to verify.
- Maximum string length: 255 single-byte characters
- Input mask: ?@?.??
- ``street``::
- First line of the billing or shipping postal address to verify.
-
- To pass verification, the value of Street must match the first three
- single-byte characters of a postal address on file for the PayPal member.
-
- Maximum string length: 35 single-byte characters.
- Alphanumeric plus - , . ‘ # \
- Whitespace and case of input value are ignored.
- ``zip``::
- Postal code to verify.
-
- To pass verification, the value of Zip mustmatch the first five
- single-byte characters of the postal code ofthe verified postal
- address for the verified PayPal member.
-
- Maximumstring length: 16 single-byte characters.
- Whitespace and case of input value are ignored.
- """
- return call('AddressVerify', **locals())
-
-def do_authorization(transactionid, amt):
- """Shortcut for the DoAuthorization method.
-
- Use the TRANSACTIONID from DoExpressCheckoutPayment for the
- ``transactionid``. The latest version of the API does not support the
- creation of an Order from `DoDirectPayment`.
-
- The `amt` should be the same as passed to `DoExpressCheckoutPayment`.
-
- Flow for a payment involving a `DoAuthorization` call::
-
- 1. One or many calls to `SetExpressCheckout` with pertinent order
- details, returns `TOKEN`
- 1. `DoExpressCheckoutPayment` with `TOKEN`, `PAYMENTACTION` set to
- Order, `AMT` set to the amount of the transaction, returns
- `TRANSACTIONID`
- 1. `DoAuthorization` with `TRANSACTIONID` and `AMT` set to the
- amount of the transaction.
- 1. `DoCapture` with the `AUTHORIZATIONID` (the `TRANSACTIONID`
- returned by `DoAuthorization`)
-
- """
- kwargs.update(locals())
- return call('DoAuthorization', **kwargs)
-
-def do_direct_payment(paymentaction="Sale", **kwargs):
- """Shortcut for the DoDirectPayment method.
-
- ``paymentaction`` could be 'Authorization' or 'Sale'
-
- To issue a Sale immediately::
-
- charge = {
- 'amt': '10.00',
- 'creditcardtype': 'Visa',
- 'acct': '4812177017895760',
- 'expdate': '012010',
- 'cvv2': '962',
- 'firstname': 'John',
- 'lastname': 'Doe',
- 'street': '1 Main St',
- 'city': 'San Jose',
- 'state': 'CA',
- 'zip': '95131',
- 'countrycode': 'US',
- 'currencycode': 'USD',
- }
- direct_payment("Sale", **charge)
-
- Or, since "Sale" is the default:
-
- direct_payment(**charge)
-
- To issue an Authorization, simply pass "Authorization" instead of "Sale".
-
- You may also explicitly set ``paymentaction`` as a keyword argument:
-
- ...
- direct_payment(paymentaction="Sale", **charge)
- """
- kwargs.update(locals())
- return call('DoDirectPayment', **kwargs)
-
-def do_capture(authorizationid, amt, completetype='Complete', **kwargs):
- """Shortcut for the DoCapture method.
-
- Use the TRANSACTIONID from DoAuthorization, DoDirectPayment or
- DoExpressCheckoutPayment for the ``authorizationid``.
-
- The `amt` should be the same as the authorized transaction.
- """
- kwargs.update(locals())
- return call('DoCapture', **kwargs)
-
-def get_transaction_details(transactionid):
- """Shortcut for the GetTransactionDetails method.
-
- Use the TRANSACTIONID from DoAuthorization, DoDirectPayment or
- DoExpressCheckoutPayment for the ``transactionid``.
- """
- return call('GetTransactionDetails', **locals())
-
-def do_void(authorizationid, note=''):
- """Shortcut for the DoVoid method.
-
- Use the TRANSACTIONID from DoAuthorization, DoDirectPayment or
- DoExpressCheckoutPayment for the ``authorizationid``.
- """
- return call('DoVoid', **locals())
-
-def set_express_checkout(amt, returnurl, cancelurl, token='', **kwargs):
- """Shortcut for the SetExpressCheckout method.
- """
- kwargs.update(locals())
- return call('SetExpressCheckout', **kwargs)
-
-def get_express_checkout_details(token):
- """Shortcut for the GetExpressCheckoutDetails method.
- """
- return call('GetExpressCheckoutDetails', token=token)
+class Interface(object):
+
+ def __init__( self , **kwargs ):
+ """core paypal interface"""
+
+ self.config= PayPalConfig( **kwargs )
+
+
+
+ def call( self , method , **kwargs ):
+ """
+ Wrapper method for executing all API commands over HTTP. This method is
+ further used to implement wrapper methods listed here:
+
+ https://www.x.com/docs/DOC-1374
+
+ ``method`` must be a supported NVP method listed at the above address.
+
+ ``kwargs`` will be a hash of
+ """
+ socket.setdefaulttimeout( self.config.HTTP_TIMEOUT )
+
+ urlvalues = {
+ 'METHOD': method,
+ 'VERSION': self.config.VERSION
+ }
+
+ headers = {}
+ if( self.config.API_AUTHENTICATION_MODE == "3TOKEN" ):
+ # headers['X-PAYPAL-SECURITY-USERID'] = API_USERNAME
+ # headers['X-PAYPAL-SECURITY-PASSWORD'] = API_PASSWORD
+ # headers['X-PAYPAL-SECURITY-SIGNATURE'] = API_SIGNATURE
+ urlvalues['USER'] = self.config.API_USERNAME
+ urlvalues['PWD'] = self.config.API_PASSWORD
+ urlvalues['SIGNATURE'] = self.config.API_SIGNATURE
+ elif( self.config.API_AUTHENTICATION_MODE == "UNIPAY" ):
+ # headers['X-PAYPAL-SECURITY-SUBJECT'] = SUBJECT
+ urlvalues['SUBJECT'] = self.config.SUBJECT
+ # headers['X-PAYPAL-REQUEST-DATA-FORMAT'] = 'NV'
+ # headers['X-PAYPAL-RESPONSE-DATA-FORMAT'] = 'NV'
+ # print(headers)
+ for k,v in kwargs.iteritems():
+ urlvalues[k.upper()] = v
+
+ data = urllib.urlencode(urlvalues)
+ req = urllib2.Request( self.config.API_ENDPOINT , data , headers )
+ response = Response( urllib2.urlopen(req).read() , self.config )
+
+ if not response.success:
+ print response
+ print response.__dict__
+ raise ApiError(response)
+
+ return response
+
+
+
+ def address_verify( self, email , street , zip ):
+ """Shortcut for the AddressVerify method.
+
+ ``email``::
+ Email address of a PayPal member to verify.
+ Maximum string length: 255 single-byte characters
+ Input mask: ?@?.??
+ ``street``::
+ First line of the billing or shipping postal address to verify.
+
+ To pass verification, the value of Street must match the first three
+ single-byte characters of a postal address on file for the PayPal member.
+
+ Maximum string length: 35 single-byte characters.
+ Alphanumeric plus - , . ‘ # \
+ Whitespace and case of input value are ignored.
+ ``zip``::
+ Postal code to verify.
+
+ To pass verification, the value of Zip mustmatch the first five
+ single-byte characters of the postal code ofthe verified postal
+ address for the verified PayPal member.
+
+ Maximumstring length: 16 single-byte characters.
+ Whitespace and case of input value are ignored.
+ """
+ args= locals()
+ del args['self']
+ return self.call('AddressVerify', **args)
+
+
+
+ def do_authorization( self, transactionid , amt ):
+ """Shortcut for the DoAuthorization method.
+
+ Use the TRANSACTIONID from DoExpressCheckoutPayment for the
+ ``transactionid``. The latest version of the API does not support the
+ creation of an Order from `DoDirectPayment`.
+
+ The `amt` should be the same as passed to `DoExpressCheckoutPayment`.
+
+ Flow for a payment involving a `DoAuthorization` call::
+
+ 1. One or many calls to `SetExpressCheckout` with pertinent order
+ details, returns `TOKEN`
+ 1. `DoExpressCheckoutPayment` with `TOKEN`, `PAYMENTACTION` set to
+ Order, `AMT` set to the amount of the transaction, returns
+ `TRANSACTIONID`
+ 1. `DoAuthorization` with `TRANSACTIONID` and `AMT` set to the
+ amount of the transaction.
+ 1. `DoCapture` with the `AUTHORIZATIONID` (the `TRANSACTIONID`
+ returned by `DoAuthorization`)
+
+ """
+ args= locals()
+ del args['self']
+ return self.call('DoAuthorization', **args)
+
+
+
+ def do_capture( self , authorizationid , amt , completetype='Complete' , **kwargs ):
+ """Shortcut for the DoCapture method.
+
+ Use the TRANSACTIONID from DoAuthorization, DoDirectPayment or
+ DoExpressCheckoutPayment for the ``authorizationid``.
+
+ The `amt` should be the same as the authorized transaction.
+ """
+ kwargs.update(locals())
+ del kwargs['self']
+ return self.call('DoCapture', **kwargs)
+
+
+
+ def do_direct_payment( self , paymentaction="Sale" , **kwargs):
+ """Shortcut for the DoDirectPayment method.
+
+ ``paymentaction`` could be 'Authorization' or 'Sale'
+
+ To issue a Sale immediately::
+
+ charge = {
+ 'amt': '10.00',
+ 'creditcardtype': 'Visa',
+ 'acct': '4812177017895760',
+ 'expdate': '012010',
+ 'cvv2': '962',
+ 'firstname': 'John',
+ 'lastname': 'Doe',
+ 'street': '1 Main St',
+ 'city': 'San Jose',
+ 'state': 'CA',
+ 'zip': '95131',
+ 'countrycode': 'US',
+ 'currencycode': 'USD',
+ }
+ direct_payment("Sale", **charge)
+
+ Or, since "Sale" is the default:
+
+ direct_payment(**charge)
+
+ To issue an Authorization, simply pass "Authorization" instead of "Sale".
+
+ You may also explicitly set ``paymentaction`` as a keyword argument:
+
+ ...
+ direct_payment(paymentaction="Sale", **charge)
+ """
+ kwargs.update(locals())
+ del kwargs['self']
+ return self.call('DoDirectPayment', **kwargs)
+
+
+
+ def do_void( self , authorizationid , note='' ):
+ """Shortcut for the DoVoid method.
+
+ Use the TRANSACTIONID from DoAuthorization, DoDirectPayment or
+ DoExpressCheckoutPayment for the ``authorizationid``.
+ """
+ args= locals()
+ del args['self']
+ return self.call('DoVoid', **args)
+
+
+
+ def get_express_checkout_details( self , token):
+ """Shortcut for the GetExpressCheckoutDetails method.
+ """
+ return self.call('GetExpressCheckoutDetails', token=token)
+
+
+
+ def get_transaction_details( self , transactionid ):
+ """Shortcut for the GetTransactionDetails method.
+
+ Use the TRANSACTIONID from DoAuthorization, DoDirectPayment or
+ DoExpressCheckoutPayment for the ``transactionid``.
+ """
+ args= locals()
+ del args['self']
+ return self.call('GetTransactionDetails', **args)
+
+
+
+ def set_express_checkout( self , amt , returnurl , cancelurl , token='' , **kwargs ):
+ """Shortcut for the SetExpressCheckout method.
+ """
+ kwargs.update(locals())
+ del kwargs['self']
+ return self.call('SetExpressCheckout', **kwargs)
+
View
12 paypal/sdk/response.py
@@ -1,15 +1,20 @@
# coding=utf-8
from cgi import parse_qs
-from settings import ACK_SUCCESS, ACK_SUCCESS_WITH_WARNING
+
class Response(object):
- def __init__(self, query_string):
+
+
+ def __init__(self , query_string , config ):
self.raw = parse_qs(query_string)
+ self.config = config
+
def __str__(self):
return str(self.raw)
+
def __getattr__(self, key):
key = key.upper()
try:
@@ -20,6 +25,7 @@ def __getattr__(self, key):
except KeyError:
raise AttributeError(self)
+
def success(self):
- return self.ack.upper() in (ACK_SUCCESS, ACK_SUCCESS_WITH_WARNING)
+ return self.ack.upper() in ( self.config.ACK_SUCCESS , self.config.ACK_SUCCESS_WITH_WARNING )
success = property(success)
View
86 paypal/sdk/settings.py
@@ -1,30 +1,78 @@
# coding=utf-8
-API_ENDPOINT = "https://api-3t.sandbox.paypal.com/nvp"
+from exceptions import *
-# 3TOKEN or UNIPAY
-API_AUTHENTICATION_MODE = "3TOKEN"
+class PayPalConfig(object):
-# 3TOKEN credentials
-API_USERNAME = "patcol_1257523559_biz_api1.gmail.com"
-API_PASSWORD = "1257523570"
-API_SIGNATURE = "AFcWxV21C7fd0v3bYYYRCpSSRl31AZEdoFKAMvYbAXdM9nKSDcaUlXDp"
+ _valid_= {
+ 'API_ENVIRONMENT' : ['sandbox','production'],
+ 'API_AUTHENTICATION_MODE' : ['3TOKEN','CERTIFICATE'],
+ }
-# UNIPAY credential
-# SUBJECT = "patcol_1257523559_biz@gmail.com"
+ _API_ENDPOINTS= {
+ '3TOKEN': {
+ 'sandbox' : 'https://api-3t.sandbox.paypal.com/nvp',
+ 'production' : 'https://api-3t.paypal.com/nvp',
+ }
+ }
-# TODO: implement use of API via http proxy
-USE_PROXY = False
-PROXY_HOST = "127.0.0.1"
-PROXY_PORT = "808"
+ _PAYPAL_URL_BASE= {
+ 'sandbox' : 'https://www.sandbox.paypal.com/webscr?',
+ 'production' : 'https://www.paypal.com/webscr?',
+ }
-# in seconds
-HTTP_TIMEOUT = 15
+ VERSION = "60.0"
-PAYPAL_URL = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token="
+ # defaults
+ API_ENVIRONMENT= 'sandbox'
+ API_AUTHENTICATION_MODE= '3TOKEN'
-VERSION = "60.0"
+ # 3TOKEN credentials
+ API_USERNAME = None
+ API_PASSWORD = None
+ API_SIGNATURE = None
+
+ API_ENDPOINT= None
+ PAYPAL_URL_BASE= None
+
+ # UNIPAY credentials
+ UNIPAY_SUBJECT = None
+
+ # in seconds
+ HTTP_TIMEOUT = 15
+
+ ACK_SUCCESS = "SUCCESS"
+ ACK_SUCCESS_WITH_WARNING = "SUCCESSWITHWARNING"
+
+
+
+ def __init__(self, **kwargs):
+
+ if 'API_ENVIRONMENT' not in kwargs:
+ kwargs['API_ENVIRONMENT']= self.API_ENVIRONMENT
+ if kwargs['API_ENVIRONMENT'] not in self._valid_['API_ENVIRONMENT']:
+ raise ApiError('Invalid API_ENVIRONMENT')
+
+ if 'API_AUTHENTICATION_MODE' not in kwargs:
+ kwargs['API_AUTHENTICATION_MODE']= self.API_AUTHENTICATION_MODE
+ if kwargs['API_AUTHENTICATION_MODE'] not in self._valid_['API_AUTHENTICATION_MODE']:
+ raise ApiError("Not a supported auth mode. Use one of: %s" % \
+ ", ".join(self._valid_['API_AUTHENTICATION_MODE']))
+
+ # set the endpoints
+ self.API_ENDPOINT= self._API_ENDPOINTS[self.API_AUTHENTICATION_MODE][self.API_ENVIRONMENT]
+ self.PAYPAL_URL_BASE= self._PAYPAL_URL_BASE[self.API_ENVIRONMENT]
+
+ # set the 3TOKEN required fields
+ if self.API_AUTHENTICATION_MODE == '3TOKEN':
+ for arg in ('API_USERNAME','API_PASSWORD','API_SIGNATURE'):
+ if arg not in kwargs:
+ raise ApiError('Missing in PayPalConfig: %s ' % arg )
+ setattr( self , arg , kwargs[arg] )
+
+ for arg in ( 'HTTP_TIMEOUT' ):
+ if arg in kwargs:
+ setattr( self , arg , kwargs[arg] )
+
-ACK_SUCCESS = "SUCCESS"
-ACK_SUCCESS_WITH_WARNING = "SUCCESSWITHWARNING"
View
49 paypal/test.py
@@ -1,73 +1,84 @@
# coding=utf-8
-from sdk import *
+import sdk
import unittest
+interface= sdk.Interface(
+ API_USERNAME = "#####",
+ API_PASSWORD = "#####",
+ API_SIGNATURE = "#####",
+)
+
+email_per= '#####'
+email_biz= '#####'
+visa_acct= '#####'
+visa_expr= '#####'
+
class TestDirectPayment(unittest.TestCase):
def setUp(self):
self.credit_card = {
'amt': '10.00',
'creditcardtype': 'Visa',
- 'acct': '4812177017895760',
- 'expdate': '012010',
- 'cvv2': '962',
+ 'acct': visa_acct,
+ 'expdate': visa_expr,
+ 'cvv2': '123',
'firstname': 'John',
'lastname': 'Doe',
- 'street': '1 Main St',
- 'city': 'San Jose',
+ 'street': '1313 Mockingbird Lane',
+ 'city': 'Beverly Hills',
'state': 'CA',
- 'zip': '95131',
+ 'zip': '90110',
'countrycode': 'US',
'currencycode': 'USD',
}
# def test_address_verify(self):
- # print(address_verify("patcol_1257523559_biz@gmail.com", "1 Main St", "95131"))
+ # print(address_verify(email_biz, "1 Main St", "95131"))
def test_sale(self):
- sale = do_direct_payment('Sale', **self.credit_card)
+ sale = interface.do_direct_payment('Sale', **self.credit_card)
self.assertTrue(sale.success)
- details = get_transaction_details(sale.TRANSACTIONID)
+ details = interface.get_transaction_details(sale.TRANSACTIONID)
self.assertTrue(details.success)
self.assertEqual(details.PAYMENTSTATUS.upper(), 'COMPLETED')
self.assertEqual(details.REASONCODE.upper(), 'NONE')
def test_abbreviated_sale(self):
- sale = do_direct_payment(**self.credit_card)
+ sale = interface.do_direct_payment(**self.credit_card)
self.assertTrue(sale.success)
- details = get_transaction_details(sale.TRANSACTIONID)
+ details = interface.get_transaction_details(sale.TRANSACTIONID)
self.assertTrue(details.success)
self.assertEqual(details.PAYMENTSTATUS.upper(), 'COMPLETED')
self.assertEqual(details.REASONCODE.upper(), 'NONE')
def test_authorize_and_delayed_capture(self):
# authorize payment
- auth = do_direct_payment('Authorization', **self.credit_card)
+ auth = interface.do_direct_payment('Authorization', **self.credit_card)
self.assertTrue(auth.success)
self.assertEqual(auth.AMT, self.credit_card['amt'])
# capture payment
- captured = do_capture(auth.TRANSACTIONID, auth.AMT)
+ captured = interface.do_capture(auth.TRANSACTIONID, auth.AMT)
self.assertTrue(captured.success)
self.assertEqual(auth.TRANSACTIONID, captured.PARENTTRANSACTIONID)
self.assertEqual(captured.PAYMENTSTATUS.upper(), 'COMPLETED')
self.assertEqual(captured.REASONCODE.upper(), 'NONE')
def test_authorize_and_void(self):
# authorize payment
- auth = do_direct_payment('Authorization', **self.credit_card)
+ auth = interface.do_direct_payment('Authorization', **self.credit_card)
self.assertTrue(auth.success)
self.assertEqual(auth.AMT, self.credit_card['amt'])
# void payment
note = 'Voided the authorization.'
- void = do_void(auth.TRANSACTIONID, note)
+ void = interface.do_void(auth.TRANSACTIONID, note)
self.assertTrue(void.success)
self.assertEqual(auth.TRANSACTIONID, void.AUTHORIZATIONID)
- details = get_transaction_details(auth.TRANSACTIONID)
+ details = interface.get_transaction_details(auth.TRANSACTIONID)
self.assertTrue(details.success)
self.assertEqual(details.PAYMENTSTATUS.upper(), 'VOIDED')
@@ -92,9 +103,9 @@ def test_authorize_and_delayed_capture(self):
A call to `DoAuthorization`.
A call to `DoCapture`.
"""
- setexp = set_express_checkout(amt='10.00', returnurl=self.returnurl, \
+ setexp = interface.set_express_checkout(amt='10.00', returnurl=self.returnurl, \
cancelurl=self.cancelurl, paymentaction='Order', \
- email='patcol_1257541103_per@gmail.com')
+ email=email_per)
self.assertTrue(setexp.success)
# print(setexp)
# getexp = get_express_checkout_details(token=setexp.token)

0 comments on commit 083a3f0

Please sign in to comment.