o
    mDWjd  ã                   @   s@   d dl Z d dlmZmZ d dlmZmZmZ dd„ Zdd„ Z	dS )é    N)Ú	IopClientÚ
IopRequest)ÚAPP_KEYÚ
APP_SECRETÚACCESS_TOKENc                 C   sb   t dttƒ}tdƒ}| d| ¡ | d|¡ | d|¡ | d|¡ | d|¡ | |t¡}|jS )Nú"https://api-sg.aliexpress.com/syncz#aliexpress.ds.product.wholesale.getÚship_to_countryÚ
product_idÚtarget_currencyÚtarget_languageÚremove_personal_benefit)r   r   r   r   Úadd_api_paramÚexecuter   Úbody)ÚshipToCountryÚ	productIdÚtargetCurrencyÚtargetLanguageÚremovePersonalBenefitÚclientÚrequestÚresponse© r   úl/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/mama_care_api/ali_express_ds/ds/drop_shipping.pyÚ
getProduct   s   r   c                 C   sL   | ||||||dœ}t dttƒ}tdƒ}	|	 dt |¡¡ | |	t¡}
|
j	S )N)Úquantityr   r   ÚselectedSkuIdÚlanguageÚcurrencyÚlocaler   zaliexpress.ds.freight.queryÚqueryDeliveryReq)
r   r   r   r   r   ÚjsonÚdumpsr   r   r   )r   r   r   r   r   r   r   Údatar   r   r   r   r   r   Ú
getFreight   s   ù
r$   )
r!   Ú"ali_express_ds.iop.ali_express_sdkr   r   Úmama_care_api.settingsr   r   r   r   r$   r   r   r   r   Ú<module>   s
   