killbill / killbill-adyen-plugin

Kill Bill plugin for Adyen
https://killbill.io
Apache License 2.0
10 stars 31 forks source link

Improve logging #54

Closed andrenpaes closed 8 years ago

andrenpaes commented 8 years ago

Adds latency to log entries, only logging one event per transaction (with an error flag attribute included).

Also refactors a bit the notification handling code, also adding latency to log entries.

Here are a few examples of log entries for Transaction Operations:

# Hpp
op='createHppRequest', merchantAccount='MyCityDealDE', amount='10', amount='10', paymentTransactionExternalKey='fd623240-262f-4f0c-b32f-22f5e6f25199', error=false

# Payments
op='authorize', merchantAccount='MyCityDealDE', amount='10', amount='10', paymentTransactionExternalKey='eb5859d2-3691-4b63-b504-7f7c7a820526', PurchaseResult{result='Authorised', authCode='75613', pspReference='8814725091152670', reason='null', resultCode='Authorised', reference='null', paymentTransactionExternalKey='eb5859d2-3691-4b63-b504-7f7c7a820526', adyenCallErrorStatus=null, additionalData={authCode='75613', refusalReasonRaw='AUTHORISED', avsResult='5 No AVS data provided', avsResultRaw='5', acquirerReference='7F54NDV1I6P', cvcResult='1 Matches', cvcResultRaw='1', acquirerCode='TestPmmAcquirer'}}, duration=3024, error=false
op='cancel', merchantAccount='MyCityDealDE', pspReference='1a24b4f3-a4b5-4ddc-9bd4-16dcdec207fd', paymentTransactionExternalKey='d3fae27a-eeb3-4baa-ba5b-02be55ec8ce4', pspReference='1a24b4f3-a4b5-4ddc-9bd4-16dcdec207fd', UnSuccessfulAdyenCall{responseStatus=RESPONSE_INVALID, exceptionMessage='HTTP response '422: Unprocessable Entity' when communicating with https://pal-test.adyen.com/pal/servlet/Payment/v12', exceptionClass='org.apache.cxf.transport.http.HTTPException', duration=176 }, error=true

op='authorize', merchantAccount='MyCityDealDE', amount='10', amount='10', paymentTransactionExternalKey='2485f71c-1cfa-4baf-ba24-cf09c6732954', PurchaseResult{result='Authorised', authCode='23053', pspReference='8514725091166343', reason='null', resultCode='Authorised', reference='null', paymentTransactionExternalKey='2485f71c-1cfa-4baf-ba24-cf09c6732954', adyenCallErrorStatus=null, additionalData={authCode='23053', refusalReasonRaw='AUTHORISED', avsResult='5 No AVS data provided', avsResultRaw='5', acquirerReference='7CA6B5NDF1P', cvcResult='1 Matches', cvcResultRaw='1', acquirerCode='TestPmmAcquirer'}}, duration=965, error=false
op='capture', merchantAccount='MyCityDealDE', amount='5', amount='5', paymentTransactionExternalKey='75679349-688d-4f5c-b14c-e6f9f72e0519', pspReference='8514725091166343', PaymentModificationResponse{adyenCallErrorStatus=null, pspReference='8614725091175632', response='[capture-received]', additionalData={}}, duration=181, error=false
op='capture', merchantAccount='MyCityDealDE', amount='5', amount='5', paymentTransactionExternalKey='829e26a5-1592-440e-9fe7-4d861adaa718', pspReference='8514725091166343', PaymentModificationResponse{adyenCallErrorStatus=null, pspReference='8814725091172702', response='[capture-received]', additionalData={}}, duration=340, error=false

op='authorize', merchantAccount='MyCityDealDE', amount='10', amount='10', paymentTransactionExternalKey='8666c104-6738-49e2-8727-d727516717d2', PurchaseResult{result='Authorised', authCode='8047', pspReference='7914725091176134', reason='null', resultCode='Authorised', reference='null', paymentTransactionExternalKey='8666c104-6738-49e2-8727-d727516717d2', adyenCallErrorStatus=null, additionalData={authCode='8047', refusalReasonRaw='AUTHORISED', avsResult='5 No AVS data provided', avsResultRaw='5', acquirerReference='7F54NDV25OG', cvcResult='1 Matches', cvcResultRaw='1', acquirerCode='TestPmmAcquirer'}}, duration=525, error=false
op='cancel', merchantAccount='MyCityDealDE', paymentTransactionExternalKey='c5afe094-40bb-462e-a026-caecd1285300', pspReference='7914725091176134', PaymentModificationResponse{adyenCallErrorStatus=null, pspReference='8814725091182719', response='[cancel-received]', additionalData={}}, duration=183, error=false

op='authorize', merchantAccount='MyCityDealDE', amount='10', amount='10', paymentTransactionExternalKey='43854743-a134-47b3-984c-e8003622c298', PurchaseResult{result='Authorised', authCode='24385', pspReference='7914725091186141', reason='null', resultCode='Authorised', reference='null', paymentTransactionExternalKey='43854743-a134-47b3-984c-e8003622c298', adyenCallErrorStatus=null, additionalData={authCode='24385', refusalReasonRaw='AUTHORISED', avsResult='5 No AVS data provided', avsResultRaw='5', acquirerReference='7CA6B5NE2JH', cvcResult='1 Matches', cvcResultRaw='1', acquirerCode='TestPmmAcquirer'}}, duration=411, error=false
op='capture', merchantAccount='MyCityDealDE', amount='10', amount='10', paymentTransactionExternalKey='5f2dd36b-3c6d-4b59-ae03-05f138b7d0bc', pspReference='7914725091186141', PaymentModificationResponse{adyenCallErrorStatus=null, pspReference='8514725091186382', response='[capture-received]', additionalData={}}, duration=386, error=false
op='refund', merchantAccount='MyCityDealDE', amount='10', amount='10', paymentTransactionExternalKey='46552eef-55a0-4ebb-bd9e-e074fd34045b', pspReference='8514725091186382', PaymentModificationResponse{adyenCallErrorStatus=null, pspReference='8814725091192726', response='[refund-received]', additionalData={}}, duration=202, error=false

And here are some log entries for notification handling:

op='notificationHandling' eventCode='AUTHORISATION', pspReference='4823660019473428', originalReference='null', success='true', reason='111647:7629:5/2014', merchantReference='325147059', merchantAccount='TestMerchant', duration=4, error=false
op='notificationHandling' eventCode='NOTIFICATION_OF_CHARGEBACK', pspReference='4679660098811789', originalReference='1805647532335033', success='true', reason='2013.04.12/08.09.20/821', merchantReference='1-6GNEZHGTGT', merchantAccount='TestMerchant', duration=0, error=false
op='notificationHandling' eventCode='NOTIFICATION_OF_CHARGEBACK', pspReference='4894660098821804', originalReference='1329636226549589', success='true', reason='2013.04.12/08.18.50/821', merchantReference='1-AYA5VKUZDP', merchantAccount='TestMerchant', duration=0, error=false
op='notificationHandling' eventCode='NOTIFICATION_OF_CHARGEBACK', pspReference='5299660098821820', originalReference='4328641331002023', success='true', reason='2013.04.12/08.26.54/672', merchantReference='1-J6X6UXKG4A', merchantAccount='TestMerchant', duration=0, error=false
op='notificationHandling' eventCode='CHARGEBACK_REVERSED', pspReference='4815580881292917', originalReference='null', success='true', reason='Chargeback reversed', merchantReference='1-AWSSVULBWX', merchantAccount='TestMerchant', duration=0, error=false
pierre commented 8 years ago

Few remarks but 👍 overall!

sbrossie commented 8 years ago

👍