Ejemplo n.º 1
0
def withdraw(transaction_date,medium,payee_id,amount):
    payload = {
        "transaction_date": transaction_date,
        "medium": medium,
        "payee_id": payee_id,
        "amount": amount
    }
    client = nessie.NessieClient('682bc88f420a505fb5d69090d0b8c924', 'customer')
    print(client.api_call("accounts/{}/withdrawals".format(payee_id), "POST", payload))
Ejemplo n.º 2
0
def deposit(transaction_date,medium,payee_id,amount):
    payload = {
        "transaction_date": transaction_date,
        "medium": medium,
        "amount": amount
    }
    client = nessie.NessieClient('682bc88f420a505fb5d69090d0b8c924', 'customer')
    print(client.api_call("accounts/{}/deposits".format(payee_id), "POST", payload))
  #  print("Current balance is :" +client.api_call("accounts/{}".format(payer_id))
Ejemplo n.º 3
0
 def __init__(self,streetNo,streetName,city,state,zip):
     self.streetNo = streetNo
     self.streetName = streetName
     self.city = city
     self.state = state
     self.zip=zip
     self.payload= {
         "first_name":"LL",
         "last_name":'lll',
         "address":
         {"street_number":self.streetNo,
         "street_name":self.streetName,
         "city":self.city,
         "state":self.state,
         "zip":self.zip
         }
     }
     client = nessie.NessieClient('682bc88f420a505fb5d69090d0b8c924','customer');
     self.customer_data = client.api_call("customers", "POST", self.payload)['content']['objectCreated']
     self._id = self.customer_data['_id']
Ejemplo n.º 4
0
    def __init__(self, type, nickname, rewards, balance, customer_id):

        self.type = type
        self.nickname = nickname
        self.rewards = rewards
        self.balance = balance
        self.customer_id = customer_id
        self.payload = {
            'type': self.type,
            'nickname': self.nickname,
            'rewards': self.rewards,
            'balance': self.balance,
        }

        # create an account
        client = nessie.NessieClient('682bc88f420a505fb5d69090d0b8c924',
                                     'customer')
        self.account_data = client.api_call(
            'customers/{}/accounts'.format(customer_id), "POST",
            self.payload)['content']['objectCreated']
        self._id = self.account_data['_id']
Ejemplo n.º 5
0
def show_transfers(account_id):
    client = nessie.NessieClient('682bc88f420a505fb5d69090d0b8c924', 'customer')
    return client.api_call("accounts/{}/transfers".format(account_id),"GET")