Skip to content

Commit

Permalink
Bugfix for Cybersource. Wrong exception was except
Browse files Browse the repository at this point in the history
Bugfix and added documentation about a feature
Optional parameters
payment.attrs.fingerprint_session_id
payment.attrs.merchant_defined_data
were essentially required otherwise an error was thrown.
Was caused by the wrong exception being captured
  • Loading branch information
Jskarie authored and WhyNotHugo committed Aug 13, 2022
1 parent 821be41 commit ea85be8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/backends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ accomplished by passing your data to the :class:`Payment` instance::

>>> payment.attrs.merchant_defined_data = {'01': 'foo', '02': 'bar'}

Fingerprinting::

Cybersource allows you to pass a fingerprint data to help identify fraud

>>> payment.attrs.fingerprint_session_id


Dotpay
------
Expand Down
4 changes: 2 additions & 2 deletions payments/cybersource/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def _get_params_for_new_payment(self, payment):
}
try:
fingerprint_id = payment.attrs.fingerprint_session_id
except KeyError:
except AttributeError:
pass
else:
params["deviceFingerprintID"] = fingerprint_id
Expand Down Expand Up @@ -446,7 +446,7 @@ def _prepare_items(self, payment):
def _prepare_merchant_defined_data(self, payment):
try:
merchant_defined_data = payment.attrs.merchant_defined_data
except KeyError:
except AttributeError:
return
else:
data = self.client.factory.create("data:MerchantDefinedData")
Expand Down

0 comments on commit ea85be8

Please # to comment.