require_relative 'base' require 'json' class Customer < Base def create_customer(data) base_url = petra_object.base_url required_parameters = ["email"] check_passed_parameters(required_parameters, data) response = post_request("#{base_url}/customer", data) return response end def get_customers(page =1, per_page=50) base_url = petra_object.base_url response = get_request("#{base_url}/customer?perPage=#{per_page}&page=#{page}") return response end def get_customer(reference) base_url = petra_object.base_url response = get_request("#{base_url}/customer/#{reference}") return response end def update_customer(reference, payload) base_url = petra_object.base_url required_parameters = ['first_name','last_name'] check_passed_parameters(required_parameters, payload) response = put_request("#{base_url}/customer/#{reference}", payload) return response end end