Exemple #1
0
 def with_hosted_payment_data(self, value):
     client = ServicesContainer.instance().get_client('default')
     if client.supports_hosted_payments:
         self.hosted_payment_data = value
         return self
     raise BuilderException(
         'Your current gateway does not support hosted payments.')
 def test_container_instance(self):
     """
     Ensures configured gateway instance is available
     """
     gateway = ServicesContainer.instance().get_client("default")
     self.assertIsNotNone(gateway)
     self.assertTrue(isinstance(gateway, PorticoConnector))
Exemple #3
0
    def execute(self):
        """
        Executes the builder against the gateway.
        :return: Transaction
        """
        TransactionBuilder.execute(self)

        client = ServicesContainer.instance().get_client()
        return client.manage_transaction(self)
Exemple #4
0
    def execute(self, config_name=None):
        """
        Executes the builder against the gateway.
        :return: Report
        """

        if config_name is None:
            config_name = "default"

        client = ServicesContainer.instance().get_client(config_name)
        return client.process_report(self)
Exemple #5
0
    def execute(self, config_name=None):
        """
        Executes the builder against the gateway.
        :return: RecurringEntity
        """

        if config_name is None:
            config_name = "default"

        TransactionBuilder.execute(self)

        client = ServicesContainer.instance().get_recurring_client(config_name)
        return client.process_recurring(self)
Exemple #6
0
    def execute(self, config_name=None):
        """
        Executes the builder against the gateway.
        :return: Transaction
        """

        if config_name is None:
            config_name = "default"

        TransactionBuilder.execute(self)

        client = ServicesContainer.instance().get_client(config_name)
        return client.manage_transaction(self)
Exemple #7
0
    def serialize(self, config_name=None):
        """
        Serializes an authorization builder for hosted payment page requests.
        Requires the gateway and account support hosted payment pages.
        :return: string
        """

        if config_name is None:
            config_name = "default"

        self.transaction_modifier = TransactionModifier.HostedRequest
        TransactionBuilder.execute(self)

        client = ServicesContainer.instance().get_client(config_name)
        if client and client.supports_hosted_payments:
            return client.serialize_request(self)
        raise BuilderException(
            'Your current gateway does not support hosted payments.')