Commit c4006cbc authored by mattwire's avatar mattwire

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

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