Exemple #1
0
 def api_settlement(self, data):
     """
     Method for create split order
     :param data: split order data
     :return: api response
     """
     if self.api.api_protocol != "2.0":
         raise Exception("This method allowed only for v2.0")
     params = {
         "order_type": data.get("order_type", "settlement"),
         "order_id": data.get("order_id") or helper.generate_order_id(),
         "operation_id": data.get("operation_id", ""),
         "receiver": data.get("receiver", []),
     }
     helper.check_data(params)
     params.update(data)
     return "/settlement/", params
Exemple #2
0
 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
Exemple #3
0
    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
Exemple #4
0
 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
Exemple #5
0
    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
Exemple #6
0
 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)
Exemple #7
0
 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)
Exemple #8
0
    def settlement(self, data):
        """
        Method for create split order
        :param data: split order data
        :return: api response
        """
        if self.api.api_protocol != '2.0':
            raise Exception('This method allowed only for v2.0')
        path = '/settlement/'
        params = {
            'order_type': data.get('order_type', 'settlement'),
            'order_id': data.get('order_id') or helper.generate_order_id(),
            'operation_id': data.get('operation_id', ''),
            'receiver': data.get('receiver', [])
        }
        helper.check_data(params)
        params.update(data)
        result = self.api.post(path, data=params, headers=self.__headers__)

        return self.response(result)
Exemple #9
0
 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
Exemple #10
0
 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)