Skip to content
Snippets Groups Projects
Commit 14ee6158 authored by mattwire's avatar mattwire
Browse files

Pass json string to IPN class for decoding instead of decoding before passing

parent 55822530
No related branches found
No related tags found
1 merge request!1246.5
...@@ -1131,9 +1131,8 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment { ...@@ -1131,9 +1131,8 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
* @throws \Stripe\Error\Api * @throws \Stripe\Error\Api
*/ */
public function handlePaymentNotification() { public function handlePaymentNotification() {
$data_raw = file_get_contents("php://input"); $dataRaw = file_get_contents("php://input");
$data = json_decode($data_raw); $ipnClass = new CRM_Core_Payment_StripeIPN($dataRaw);
$ipnClass = new CRM_Core_Payment_StripeIPN($data);
if ($ipnClass->main()) { if ($ipnClass->main()) {
http_response_code(200); http_response_code(200);
} }
......
...@@ -96,12 +96,14 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN { ...@@ -96,12 +96,14 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN {
/** /**
* CRM_Core_Payment_StripeIPN constructor. * CRM_Core_Payment_StripeIPN constructor.
* *
* @param \stdClass $ipnData * @param string $ipnData
* json encoded string
* @param bool $verify * @param bool $verify
*/ */
public function __construct($ipnData, $verify = TRUE) { public function __construct($ipnData, $verify = TRUE) {
$this->verify_event = $verify; $this->verify_event = $verify;
$this->setInputParameters($ipnData); $data = json_decode($ipnData);
$this->setInputParameters($data);
parent::__construct(); parent::__construct();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment