# Path: paystackapi/transaction.py
# class Transaction(PayStackBase):
#     """docstring for Transaction."""
# 
#     @classmethod
#     def initialize(cls, **kwargs):
#         """
#         Initialize transaction.
# 
#         Args:
#             reference: unique transaction reference
#             amount: amount
#             email: email address
#             plan: specified plan(optional)
# 
#         Returns:
#             Json data from paystack API.
#         """
# 
#         return cls().requests.post('transaction/initialize', data=kwargs)
# 
#     @classmethod
#     def charge(cls, **kwargs):
#         """
#         Charge authorization.
# 
#         Args:
#             reference: Unique transaction reference
#             authorization_code: Authorization code for the transaction
#             email: Email Address of the user with the authorization code
#             amount: Amount in kobo
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.post('transaction/charge_authorization',
#                                    data=kwargs)
# 
#     @classmethod
#     def charge_token(cls, **kwargs):
#         """
#         Charge token.
# 
#         Args:
#             reference: unique transaction reference
#             token: paystack token
#             email: Email Address
#             amount: Amount in Kobo
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.post('transaction/charge_token', data=kwargs)
# 
#     @classmethod
#     def get(cls, transaction_id):
#         """
#         Get a single transaction.
# 
#         Args:
#             transaction_id: Transaction id(integer).
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get(f"transaction/{transaction_id}")
# 
#     @classmethod
#     def list(cls):
#         """
#         List transactions.
# 
#         Args:
#             No argument required.
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get('transaction')
# 
#     @classmethod
#     def totals(cls):
#         """
#         Get totals.
# 
#         Args:
#             No argument required.
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get('transaction/totals')
# 
#     @classmethod
#     def verify(cls, reference):
#         """
#         Verify transactions.
# 
#         Args:
#             reference: a unique value needed for transaction.
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get(f"transaction/verify/{reference}")
# 
# Path: paystackapi/tests/base_test_case.py
# class BaseTestCase(unittest.TestCase):
# 		
# 	def endpoint_url(self, path):
# 		if path[0] == '/':
# 			return 'https://api.paystack.co{}'.format(path)
# 		return 'https://api.paystack.co/{}'.format(path)


import httpretty
from paystackapi.transaction import Transaction
from paystackapi.tests.base_test_case import BaseTestCase
        response = Transaction.initialize(
            reference='getupall', amount=12000,
            email='samuel.james@andela.com')
        self.assertTrue(response['status'])

    @httpretty.activate
    def test_charge(self):
        httpretty.register_uri(
            httpretty.POST,
            self.endpoint_url("/transaction/charge_authorization"),
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        response = Transaction.charge(
            reference='getupall', authorization_code='authorization_code',
            email='email', amount='amount')
        self.assertTrue(response['status'])

    @httpretty.activate
    def test_charge_token(self):
        httpretty.register_uri(
            httpretty.POST,
            self.endpoint_url("/transaction/charge_token"),
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )


# Path: paystackapi/transaction.py
# class Transaction(PayStackBase):
#     """docstring for Transaction."""
# 
#     @classmethod
#     def initialize(cls, **kwargs):
#         """
#         Initialize transaction.
# 
#         Args:
#             reference: unique transaction reference
#             amount: amount
#             email: email address
#             plan: specified plan(optional)
# 
#         Returns:
#             Json data from paystack API.
#         """
# 
#         return cls().requests.post('transaction/initialize', data=kwargs)
# 
#     @classmethod
#     def charge(cls, **kwargs):
#         """
#         Charge authorization.
# 
#         Args:
#             reference: Unique transaction reference
#             authorization_code: Authorization code for the transaction
#             email: Email Address of the user with the authorization code
#             amount: Amount in kobo
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.post('transaction/charge_authorization',
#                                    data=kwargs)
# 
#     @classmethod
#     def charge_token(cls, **kwargs):
#         """
#         Charge token.
# 
#         Args:
#             reference: unique transaction reference
#             token: paystack token
#             email: Email Address
#             amount: Amount in Kobo
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.post('transaction/charge_token', data=kwargs)
# 
#     @classmethod
#     def get(cls, transaction_id):
#         """
#         Get a single transaction.
# 
#         Args:
#             transaction_id: Transaction id(integer).
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get(f"transaction/{transaction_id}")
# 
#     @classmethod
#     def list(cls):
#         """
#         List transactions.
# 
#         Args:
#             No argument required.
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get('transaction')
# 
#     @classmethod
#     def totals(cls):
#         """
#         Get totals.
# 
#         Args:
#             No argument required.
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get('transaction/totals')
# 
#     @classmethod
#     def verify(cls, reference):
#         """
#         Verify transactions.
# 
#         Args:
#             reference: a unique value needed for transaction.
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get(f"transaction/verify/{reference}")
# 
# Path: paystackapi/tests/base_test_case.py
# class BaseTestCase(unittest.TestCase):
# 		
# 	def endpoint_url(self, path):
# 		if path[0] == '/':
# 			return 'https://api.paystack.co{}'.format(path)
# 		return 'https://api.paystack.co/{}'.format(path)


# Path: paystackapi/tests/test_transaction.py
import httpretty
from paystackapi.transaction import Transaction
from paystackapi.tests.base_test_case import BaseTestCase

        response = Transaction.initialize(
            reference='getupall', amount=12000,
            email='samuel.james@andela.com')
        self.assertTrue(response['status'])

    @httpretty.activate
    def test_charge(self):
        httpretty.register_uri(
            httpretty.POST,
            self.endpoint_url("/transaction/charge_authorization"),
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        response = Transaction.charge(
            reference='getupall', authorization_code='authorization_code',
            email='email', amount='amount')
        self.assertTrue(response['status'])

    @httpretty.activate
    def test_charge_token(self):
        httpretty.register_uri(
            httpretty.POST,
            self.endpoint_url("/transaction/charge_token"),
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )


        response = Transaction.charge_token(