Skip to content

Commit

Permalink
fix: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aht007 committed Dec 13, 2024
1 parent 86e5143 commit db30155
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion commerce_coordinator/apps/commercetools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def translate_refund_status_to_transaction_status(refund_status: str):
'failed': TransactionState.FAILURE,
'canceled': TransactionState.FAILURE,
}
return translations.get(refund_status.lower(), refund_status)
return translations.get(refund_status.lower(), TransactionState.SUCCESS)


def _create_retired_hash_withsalt(value_to_retire, salt):
Expand Down
4 changes: 0 additions & 4 deletions commerce_coordinator/apps/paypal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,14 @@ def post(self, request):
crc = zlib.crc32(body)

message = f"{transmission_id}|{timestamp}|{webhook_id}|{crc}"

signature = base64.b64decode(request.headers.get("paypal-transmission-sig"))

certificate = self._get_certificate(request.headers.get("paypal-cert-url"))

cert = x509.load_pem_x509_certificate(
certificate.encode("utf-8"), default_backend()
)
public_key = cert.public_key()

try:
# TODO: In future we can move this logic over to redis to avoid hitting the database
public_key.verify(
signature, message.encode("utf-8"), padding.PKCS1v15(), hashes.SHA256()
)
Expand Down
2 changes: 1 addition & 1 deletion commerce_coordinator/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def root(*path_fragments):
}

STRIPE_WEBHOOK_ENDPOINT_SECRET = 'SET-ME-PLEASE'
PAYPAL_WEBHOOK_ID="SET-ME-PLEASE"
PAYPAL_WEBHOOK_ID = 'SET-ME-PLEASE'

# PAYMENT PROCESSING
PAYMENT_PROCESSOR_CONFIG = {
Expand Down

0 comments on commit db30155

Please sign in to comment.