o
    Q?h|                     @   st   d dl Z d dlmZ d dlmZmZmZ d dlmZ d dl	m
Z
 d dlmZ defdd	Zd
d ZdefddZdS )    NHTTPBasicAuth)SERVER_TIMESTAMP
ArrayUniondb)getAppCredentials)	API_Error)saveShopdatac           
      C   s   |  d}| d| d}}|  d|  d|  d}}}|  dg }|  dg }t|d	|d
| d| dd	| t|||td ||d}	|	S )NcurrentUseruidenterpriseIdapiKey	apiSecretnamestoreIdsstores5z5--Shipstation)r   
platformIdr   platformShopIdplatformNameappId	createdAtr   r   r   	updatedAturlplatformShopIdsplatformShops)getr	   r   )
r
   r   r   r   r   r   r   r   r   shop r!   O/var/www/html/riverr-enterprise-integrations-main/functions/Shipstation/Auth.pysaveShipstation
   s,   
"r#   c                 C   s
   t | |S )Nr   )r   r   r!   r!   r"   Authorization"   s   
r$   c                 C   s8   |  d|  d}}d}tjd|t||d}| S )Nr   r   z$https://ssapi.shipstation.com/storesGET)auth)r   requestsrequestr$   json)r
   r   r   r   responser!   r!   r"   	getStores&   s   r+   )r'   requests.authr   configs.firebaser   r   r   functions.Applicationsr   functions.Responser   functions.Shopsr	   dictr#   r$   r+   r!   r!   r!   r"   <module>   s    