/** * Constructor * * Loads json request source and decodes it in php array and sets id and method members * @param string $referenceId * @return void */ public function __construct($referenceId = null) { $data = SkrillPsp_Json::getRefundJson(); $this->json = $this->decode($data, true); $this->json['id'] = $this->setId(); unset($this->json['params']['identification']['customerid']); if (!empty($this->referenceId)) { $this->json['params']['identification']['referenceid'] = $this->referenceId; } }
/** * Constructor * * Loads json request source and and decodes it in php array and sets id member * and referenceid parameter * * @param string $referenceId * @throws SkrillPsp_Exception * @return void */ public function __construct($referenceId = null) { $data = SkrillPsp_Json::getRefundJson(); $this->json = $this->decode($data, true); $this->json['id'] = $this->setId(); $this->referenceId = $referenceId; if (!empty($this->referenceId)) { $this->json['params']['identification']['referenceid'] = $this->referenceId; } else { throw new SkrillPsp_Exception('Reference Id is mandatory for refund request'); } }