Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(47)  |  Call(36)  |  Derive(0)  |  Import(11)
Exception to be used for ANTICIPATED payment errors (eg card number wrong,
expiry date has passed).  The message passed here will be shown to the end
user.

src/d/j/django-oscar-datacash-0.7/datacash/facade.py   django-oscar-datacash(Download)
import random
 
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from oscar.apps.payment.exceptions import UnableToTakePayment, InvalidGatewayRequestError
        elif response.is_declined():
            msg = self.get_friendly_decline_message(response)
            raise UnableToTakePayment(msg)
        else:
            # If there's a customer friendly version of this error, raise
            friendly_msg = self.get_friendly_error_message(response)
            if friendly_msg:
                raise UnableToTakePayment(friendly_msg)
            raise InvalidGatewayRequestError(response.reason)
 
        """
        if amount == 0:
            raise UnableToTakePayment("Order amount must be non-zero")
        if currency is None:
            currency = settings.DATACASH_CURRENCY
        """
        if amount == 0:
            raise UnableToTakePayment("Order amount must be non-zero")
        if currency is None:
            currency = settings.DATACASH_CURRENCY

src/d/j/django-oscar-datacash-HEAD/datacash/facade.py   django-oscar-datacash(Download)
import random
 
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from oscar.apps.payment.exceptions import UnableToTakePayment, InvalidGatewayRequestError
        elif response.is_declined():
            msg = self.get_friendly_decline_message(response)
            raise UnableToTakePayment(msg)
        else:
            # If there's a customer friendly version of this error, raise
            friendly_msg = self.get_friendly_error_message(response)
            if friendly_msg:
                raise UnableToTakePayment(friendly_msg)
            raise InvalidGatewayRequestError(response.reason)
 
        """
        if amount == 0:
            raise UnableToTakePayment("Order amount must be non-zero")
        if currency is None:
            currency = settings.DATACASH_CURRENCY
        """
        if amount == 0:
            raise UnableToTakePayment("Order amount must be non-zero")
        if currency is None:
            currency = settings.DATACASH_CURRENCY

src/d/j/django-oscar-paypal-0.8.1/paypal/payflow/facade.py   django-oscar-paypal(Download)
        **address_fields)
    if not txn.is_approved:
        raise exceptions.UnableToTakePayment(txn.respmsg)
    return txn
 
        except models.PayflowTransaction.DoesNotExist:
            raise exceptions.UnableToTakePayment(
                "No authorization transaction found with PNREF=%s" % pnref)
        pnref = auth_txn
 
    txn = gateway.delayed_capture(order_number, pnref, amt)
    if not txn.is_approved:
        raise exceptions.UnableToTakePayment(txn.respmsg)
        order_number, pnref, amt)
    if not txn.is_approved:
        raise exceptions.UnableToTakePayment(txn.respmsg)
    return txn
 
        except models.PayflowTransaction.DoesNotExist:
            raise exceptions.UnableToTakePayment(
                "No authorization transaction found with PNREF=%s" % pnref)
        pnref = auth_txn
 

src/d/j/django-oscar-paypal-HEAD/paypal/payflow/facade.py   django-oscar-paypal(Download)
        **address_fields)
    if not txn.is_approved:
        raise exceptions.UnableToTakePayment(txn.respmsg)
    return txn
 
        except models.PayflowTransaction.DoesNotExist:
            raise exceptions.UnableToTakePayment(
                "No authorization transaction found with PNREF=%s" % pnref)
        pnref = auth_txn
 
    txn = gateway.delayed_capture(order_number, pnref, amt)
    if not txn.is_approved:
        raise exceptions.UnableToTakePayment(txn.respmsg)
        order_number, pnref, amt)
    if not txn.is_approved:
        raise exceptions.UnableToTakePayment(txn.respmsg)
    return txn
 
        except models.PayflowTransaction.DoesNotExist:
            raise exceptions.UnableToTakePayment(
                "No authorization transaction found with PNREF=%s" % pnref)
        pnref = auth_txn
 

src/d/j/django-oscar-paymentexpress-0.1.1/paymentexpress/facade.py   django-oscar-paymentexpress(Download)
from paymentexpress.models import OrderTransaction
 
from oscar.apps.payment.exceptions import (UnableToTakePayment,
                                           InvalidGatewayRequestError)
import random
    def _check_amount(self, amount):
        if amount == 0 or amount is None:
            raise UnableToTakePayment("Order amount must be non-zero")
 
    def _get_merchant_reference(self, order_number, txn_type):
 
        elif response.is_declined():
            raise UnableToTakePayment(self._get_friendly_decline_message())
 
        else:

src/d/j/django-oscar-sagepay-0.1.2/sagepay/facade.py   django-oscar-sagepay(Download)
from django.conf import settings
 
from oscar.apps.payment.exceptions import UnableToTakePayment, InvalidGatewayRequestError
 
from .gateway import Gateway
 
        if amount == 0:
            raise UnableToTakePayment("Order amount must be non-zero")
 
        print("skasakskakskakskakjksjkjsakjakjkjkjkajkjaskajskjsaksajkjaskjsakjsakjsjsakjasjakzjakjaskjasj====")
        elif response.is_declined():
            msg = self.get_friendly_decline_message()
            raise UnableToTakePayment(msg)
 
        elif response.is_rejected():
            msg = self.get_friendly_rejected_message()
            raise UnableToTakePayment(msg)
        else:
            msg = self.get_friendly_error_message(response)
            raise UnableToTakePayment(msg)
 
 

src/d/j/django-oscar-accounts-HEAD/accounts/checkout/gateway.py   django-oscar-accounts(Download)
from django.db.models import get_model
from django.utils.translation import ugettext_lazy as _
from oscar.apps.payment.exceptions import UnableToTakePayment
 
from accounts import facade, exceptions, core, codes
        except Account.DoesNotExist:
            raise UnableToTakePayment(
                _("No active account found with code %s") % code)
 
        # We verify each transaction
        try:
            Transfer.objects.verify_transfer(
                account, destination, amount, user)
        except exceptions.AccountException, e:
            raise UnableToTakePayment(str(e))

src/d/j/django-account-balances-0.4/accounts/checkout/gateway.py   django-account-balances(Download)
from django.db.models import get_model
from django.utils.translation import ugettext_lazy as _
from oscar.apps.payment.exceptions import UnableToTakePayment
 
from accounts import facade, exceptions, core, codes
        except Account.DoesNotExist:
            raise UnableToTakePayment(
                _("No active account found with code %s") % code)
 
        # We verify each transaction
        try:
            Transfer.objects.verify_transfer(
                account, destination, amount, user)
        except exceptions.AccountException, e:
            raise UnableToTakePayment(str(e))

src/d/j/django-oscar-accounts-0.3/accounts/checkout/gateway.py   django-oscar-accounts(Download)
from django.db.models import get_model
from django.utils.translation import ugettext_lazy as _
from oscar.apps.payment.exceptions import UnableToTakePayment
 
from accounts import facade, exceptions, core, codes
        except Account.DoesNotExist:
            raise UnableToTakePayment(
                _("No active account found with code %s") % code)
 
        # We verify each transaction
        try:
            Transfer.objects.verify_transfer(
                account, destination, amount, user)
        except exceptions.AccountException, e:
            raise UnableToTakePayment(str(e))

src/d/j/django-oscar-accounts-HEAD/sandbox/apps/checkout/views.py   django-oscar-accounts(Download)
        if allocations.total != total:
            raise exceptions.UnableToTakePayment(
                "Your account allocations do not cover the order total")
 
        try:
            gateway.redeem(order_number, self.request.user, allocations)
        except act_exceptions.AccountException:
            raise exceptions.UnableToTakePayment(
                "An error occurred with the account redemption")

  1 | 2  Next