/** * Constructs and initialize payment data object. */ public function __construct(MeprTransaction $txn) { parent::__construct(); $this->amount = $txn->total; $this->user = $txn->user(); $this->product = $txn->product(); $this->txn_id = $txn->id; }