File: test_buttons.py

package info (click to toggle)
python-paypal 1.2.5-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 220 kB
  • sloc: python: 945; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 989 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# coding=utf-8

import unittest
from . import interface_factory

interface = interface_factory.get_interface_obj()


class ButtonTests(unittest.TestCase):
    """
    These test the BM button API available in Payments Standard and up. This
    is the cheapest and most direct route towards accepting payments.
    """

    def test_create_button(self):
        """
        Tests the creation of a simple button. This particular one is not
        stored on the PayPal account.
        """
        button_params = {
            'BUTTONCODE': 'ENCRYPTED',
            'BUTTONTYPE': 'BUYNOW',
            'BUTTONSUBTYPE': 'SERVICES',
            'BUYNOWTEXT': 'PAYNOW',
            'L_BUTTONVAR0': 'notify_url=http://test.com',
            'L_BUTTONVAR1': 'amount=5.00',
            'L_BUTTONVAR2': 'item_name=Testing',
            'L_BUTTONVAR3': 'item_number=12345',
        }
        response = interface.bm_create_button(**button_params)
        self.assertEqual(response.ACK, 'Success')