christogonus Posted March 10, 2019 Share Posted March 10, 2019 I am working with an API provided here http://ipndoc.paydotcom.com/ to get IPN call back for payment or refund With the code here: $input = file_get_contents('php://input'); $json = @json_decode($input, true); $secret = 'SECRETCODE'; $secret = substr(sha1($secret), 0, 32); $notification = base64_decode($json['notification']); $iv = base64_decode($json['iv']); $decoded = openssl_decrypt( $notification, 'AES-256-CBC', $secret, OPENSSL_RAW_DATA, $iv ); $data = json_decode($decoded, true); $trxntype = $data['transactionInfo']['transactionType']; $paymethod = $data['transactionInfo']['paymentService']; $f_name = $data['customerInfo']['contactInfo']['firstName']; $l_name = $data['customerInfo']['contactInfo']['lastName']; The $f_name and $l_name are correct! But now, the $ trxntype and $paymethod returns NULL instead of the payment details. How can I fix this? Quote Link to comment https://forums.phpfreaks.com/topic/308446-get-instant-payment-notification-ipn-data-into-php-variable/ Share on other sites More sharing options...
requinix Posted March 10, 2019 Share Posted March 10, 2019 First step is to logs the contents of $data somewhere so you can look at what is in it. 1 Quote Link to comment https://forums.phpfreaks.com/topic/308446-get-instant-payment-notification-ipn-data-into-php-variable/#findComment-1565139 Share on other sites More sharing options...
christogonus Posted March 11, 2019 Author Share Posted March 11, 2019 This worked absolutely for me. Quote Link to comment https://forums.phpfreaks.com/topic/308446-get-instant-payment-notification-ipn-data-into-php-variable/#findComment-1565154 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.