def api_p2pcredit(self, data): """ Method P2P card credit :param data: order data :return: api response """ self.order_id = data.get("order_id") or helper.generate_order_id() order_desc = data.get("order_desc") or helper.get_desc(self.order_id) params = { "order_id": self.order_id, "order_desc": order_desc, "amount": data.get("amount", ""), "currency": data.get("currency", ""), } helper.check_data(params) params.update(data) return "/p2pcredit/", params
def _required(self, data): """ Required data to send :param data: :return: parameters to send """ self.order_id = data.get('order_id') or helper.generate_order_id() order_desc = data.get('order_desc') or helper.get_desc(self.order_id) params = { 'order_id': self.order_id, 'order_desc': order_desc, 'amount': data.get('amount', ''), 'currency': data.get('currency', '') } helper.check_data(params) params.update(data) return params
def api_recurring(self, data): """ Method for recurring payment :param data: order data :return: api response """ self.order_id = data.get("order_id") or helper.generate_order_id() order_desc = data.get("order_desc") or helper.get_desc(self.order_id) params = { "order_id": self.order_id, "order_desc": order_desc, "amount": data.get("amount", ""), "currency": data.get("currency", ""), "rectoken": data.get("rectoken", ""), } helper.check_data(params) params.update(data) return "/recurring/", params
def _required(self, data): """ Required data to send :param data: :return: parameters to send """ self.order_id = data.get("order_id", helper.generate_order_id()) order_desc = data.get("order_desc", helper.get_desc(self.order_id)) params = { "order_id": self.order_id, "order_desc": order_desc, "amount": data.get("amount", ""), "currency": data.get("currency", ""), } helper.check_data(params) params.update(data) return params
def p2pcredit(self, data): """ Method P2P card credit :param data: order data :return: api response """ path = '/p2pcredit/' self.order_id = data.get('order_id') or helper.generate_order_id() order_desc = data.get('order_desc') or helper.get_desc(self.order_id) params = { 'order_id': self.order_id, 'order_desc': order_desc, 'amount': data.get('amount', ''), 'currency': data.get('currency', '') } helper.check_data(params) params.update(data) result = self.api.post(path, data=params, headers=self.__headers__) return self.response(result)
def recurring(self, data): """ Method for recurring payment :param data: order data :return: api response """ path = '/recurring/' self.order_id = data.get('order_id') or helper.generate_order_id() order_desc = data.get('order_desc') or helper.get_desc(self.order_id) params = { 'order_id': self.order_id, 'order_desc': order_desc, 'amount': data.get('amount', ''), 'currency': data.get('currency', ''), 'rectoken': data.get('rectoken', '') } helper.check_data(params) params.update(data) result = self.api.post(path, data=params, headers=self.__headers__) return self.response(result)
def api_step_one(self, data): """ Accept purchase Pcidss step one :param data: order data :return: payment result or step two data """ self.order_id = data.get("order_id") or helper.generate_order_id() order_desc = data.get("order_desc") or helper.get_desc(self.order_id) params = { "order_id": self.order_id, "order_desc": order_desc, "currency": data.get("currency", ""), "amount": data.get("amount", ""), "card_number": data.get("card_number", ""), "cvv2": data.get("cvv2", ""), "expiry_date": data.get("expiry_date", ""), } helper.check_data(params) params.update(data) return "/3dsecure_step1/", params
def step_one(self, data): """ Accept purchase Pcidss step one :param data: order data :return: payment result or step two data """ path = '/3dsecure_step1/' self.order_id = data.get('order_id') or helper.generate_order_id() order_desc = data.get('order_desc') or helper.get_desc(self.order_id) params = { 'order_id': self.order_id, 'order_desc': order_desc, 'currency': data.get('currency', ''), 'amount': data.get('amount', ''), 'card_number': data.get('card_number', ''), 'cvv2': data.get('cvv2', ''), 'expiry_date': data.get('expiry_date', '') } helper.check_data(params) params.update(data) result = self.api.post(path, data=params, headers=self.__headers__) return self.response(result)