Search code examples
payment-gatewaypayumoneypayu

How to get payumoney fees from payumoney transaction response


I am trying to integrate payumoney payment gateway in my website. I am able to get transaction done. However, I am looking for a way to get the amount that has been charged as transaction fees for a particular transaction. I could not find this field in the transaction response object sent by payumoney server after successful transaction, please help me out.

Example:

  1. A user buys a product for Rs. 13 from my website

  2. Payumoney charges Rs.0.26 as fees for this transaction (as per the details available on merchant dashboard)

  3. How can I get this value from code (I could not locate this param in the response object from payumoney)

Response object: {"country":"","udf10":"","discount":"0.00","cardToken":"789ce930df72d5693adfc","mode":"DC", "cardhash":"This field is no longer supported in postback params.", "error_Message":"No Error","state":"","bankcode":"MAST","txnid":"34", "surl":"https://www.payumoney.com/sandbox/payments/guestcheckout/#/success/C1322832E8E9405073A84889297EE9A2", "net_amount_debit":"13","lastname":"","zipcode":"","phone":"8106563221","productinfo":"f944ee9f-012b-11e8-a760-0a787eca10a6", "hash":"ff8a864cccace0eedca9b38451b452e532f58ccc1d50a10082ffe6c3edc12f7255e85d5a0abffd7e93d0b18d00c64325e60f8e75a4f275ee91ccf5849a782dc7", "status":"success","firstname":"s","city":"","error":"E000","addedon":"2018-01-25 00:23:47","udf9":"","udf7":"","udf8":"", "encryptedPaymentId":"C1322832E8E9405073A84889297EE9A2","bank_ref_num":"1767731230080250","key":"hSvWi682","email":"[email protected]", "amount":"13.0","unmappedstatus":"captured","address2":"","payuMoneyId":"19991","address1":"","udf5":"","mihpayid":"11208","udf6":"","udf3":"", "udf4":"","udf1":"","udf2":"","field1":"802583846517","cardnum":"401200XXXXXX1112","field7":"","field6":"", "furl":"https://www.payumoney.com/sandbox/payments/guestcheckout/#/failure/C1322832E8E9405073A84889297EE9A2","field9":"SUCCESS","field8":"", "amount_split":"{\"PAYU\":\"13.0\"}","field3":"1767731230080250","field2":"999999","field5":"","PG_TYPE":"HDFCPG","field4":"1767731230080250", "name_on_card":"nameoncard1","txnStatus":"SUCCESS","txnMessage":"Transaction Successful"}


Solution

  • If anyone else is also struggling with this question. Answer is PayU servers don't have any parameter in response object to return the transaction fees. So may be we keep track of the transaction charges on the basis of type of credit card or payment method used.