Example #1
0
 def testcreate(self, dwollaparse='dwolla'):
     checkouts.create({
         'orderItems': {
             frozenset({
                 'name': 'Prime Rib Sandwich',
                 'description': 'A somewhat tasty non-vegetarian sandwich',
                 'quantity': '1',
                 'price': '15.00'
             })
         },
         'destinationId': '812-740-4294',
         'total': 15.00,
         'notes': 'blahhh',
         'metadata': frozenset({
             'key1': 'something',
             'key2': 'another thing'
         })}, dwollaparse='dwolla')
     checkouts.r._post_without_token.assert_any_call('/offsitegateway/checkouts', {'client_secret': 'SOME ID', 'purchaseOrder': {'destinationId': '812-740-4294', 'total': 15.0, 'notes': 'blahhh', 'orderItems': set([frozenset(['price', 'description', 'name', 'quantity'])]), 'metadata': frozenset(['key2', 'key1'])}, 'client_id': 'SOME ID'}, {'dwollaparse': 'dwolla'})
 def testcreate(self, dwollaparse='dwolla'):
     checkouts.create(
         {
             'orderItems': {
                 frozenset({
                     'name': 'Prime Rib Sandwich',
                     'description':
                     'A somewhat tasty non-vegetarian sandwich',
                     'quantity': '1',
                     'price': '15.00'
                 })
             },
             'destinationId':
             '812-740-4294',
             'total':
             15.00,
             'notes':
             'blahhh',
             'metadata':
             frozenset({
                 'key1': 'something',
                 'key2': 'another thing'
             })
         },
         dwollaparse='dwolla')
     checkouts.r._post_without_token.assert_any_call(
         '/offsitegateway/checkouts', {
             'client_secret': 'SOME ID',
             'purchaseOrder': {
                 'destinationId':
                 '812-740-4294',
                 'total':
                 15.0,
                 'notes':
                 'blahhh',
                 'orderItems':
                 set([
                     frozenset(['price', 'description', 'name', 'quantity'])
                 ]),
                 'metadata':
                 frozenset(['key2', 'key1'])
             },
             'client_id': 'SOME ID'
         }, {'dwollaparse': 'dwolla'})
Example #3
0
  The following is a quick-start example for the checkouts endpoints.
'''

from dwolla import checkouts

# Step 1: Create checkout session with items from
# http://docs.dwolla.com/#checkouts

test = checkouts.create({
    'orderItems': {
        frozenset({
            'name': 'Prime Rib Sandwich',
            'description': 'A somewhat tasty non-vegetarian sandwich',
            'quantity': '1',
            'price': '15.00'
        })
    },
    'destinationId': '812-740-4294',
    'total': 15.00,
    'notes': 'blahhh',
    'metadata': frozenset({
        'key1': 'something',
        'key2': 'another thing'
    })})

# Step 2: Verify the recently created checkout

checkouts.get(test['CheckoutId'])

# Step 3: Complete the checkout

checkouts.complete('Order ID here')