Example #1
0
	def get_merchants(self,**args):
		"""
		Merchant listesini al

		@type	args: dict
		@param	args: API call icin url parametreleri. desteklenen bazi parametreler: 
			      status, start (default==0), max (default==-1), fields (default==""), startLetter

		@rtype: L{cimri.api.cimriservice.data.merchant.MerchantInfo}
		@return: MerchantInfo listesi ya da hata durumunda None
		"""

		self.logger.info("api call...")

		#sample:  http://glacier.cimri.com:8080/cimri-service/merchants
		packet=self.call("merchants",args=args)
		if packet is None:
			return None
		
		#parse and return merchants
		return MerchantInfo.list_from_json(packet,["merchant"])
Example #2
0
	def get_merchant(self,id,**args):
		"""
		Belli bir merchantin bilgilerini al

		@type 	id: string
		@param 	id: merchantId

		@type	args: dict
		@param	args: API call icin url parametreleri. desteklenen bazi parametreler: 
				fields (default=="")

		@rtype: L{cimri.api.cimriservice.data.merchant.MerchantInfo}
		@return: MerchantInfo ya da hata durumunda None
		"""

		self.logger.info("api call...")
		
		#sample:  http://glacier.cimri.com:8080/cimri-service/merchants/2158
		packet=self.call(Template("merchants/$id").substitute(id=str(id)),args=args)
		if packet is None:
			return None

		#parse and return response
		return MerchantInfo.from_json(packet)