public function setReceiptData($receipt_data): self
    {
        if (strpos($receipt_data, '{') !== false) {
            $this->receipt_data = base64_encode($receipt_data);
        } else {
            $this->receipt_data = $receipt_data;
        }

        return $this;
    }
public function setReceiptData($receipt_data): self
    {
        if (strpos($receipt_data, '{') !== false) {
            $this->receipt_data = base64_encode($receipt_data);
        } else {
            $this->receipt_data = $receipt_data;
        }

        return $this;
    }
public function setReceiptData ( $ receipt_data ) : self { if ( strpos ( $ receipt_data , '{' ) !== false ) { $ this -> receipt_data = base64_encode ( $ receipt_data ) ; } else { $ this -> receipt_data = $ receipt_data ; } return $ this ; }
Set receipt data, either in base64, or in json

@param string|null $receipt_data

@return $this
Set receipt data either in base64 or in json