def process(self): """Attempts to process Capture with transaction details. Returns the values of ``gateway.Capture.process``. Raises: GatewayError: An Oscar error raised when there was an error with the payment API. PaymentError: An Oscar error raised when there was an error processing the payment. """ capture_instance = gateway.Capture(**self.transaction_details) try: return capture_instance.process() except helcim_exceptions.ProcessingError as error: raise oscar_exceptions.GatewayError(str(error)) except helcim_exceptions.PaymentError as error: raise oscar_exceptions.PaymentError(str(error)) except helcim_exceptions.DjangoError: LOG.exception('Capture complete, but errors occured while saving ' 'transaction to database') return None except helcim_exceptions.HelcimError as error: raise oscar_exceptions.GatewayError(str(error))
def process(self): """Attempts to process Verification with transaction details. Returns the values of ``gateway.Verification.process``. Raises: GatewayError: An Oscar error raised when there was an error with the payment API. PaymentError: An Oscar error raised when there was an error processing the payment. """ verification_instance = gateway.Verification( save_token=self.save_token, django_user=self.django_user, **self.transaction_details) try: return verification_instance.process() except helcim_exceptions.ProcessingError as error: raise oscar_exceptions.GatewayError(str(error)) except helcim_exceptions.PaymentError as error: raise oscar_exceptions.PaymentError(str(error)) except helcim_exceptions.DjangoError: LOG.exception( 'Verification complete, but errors occured while saving ' 'transaction to database') except helcim_exceptions.HelcimError as error: raise oscar_exceptions.GatewayError(str(error))