id = $id; $this->entryId = $entryId; $this->formId = $formId; $this->transactionId = $transactionId; $this->paymentMethod = $paymentMethod; $this->customerName = $customerName; $this->amount = $amount; $this->currency = $currency; $this->squareReceiptUrl = $squareReceiptUrl; $this->dateCreated = $dateCreated; $this->status = 'succeeded'; $this->providerMeta = $providerMeta; } public function withCustomerName(?string $customerName): self { $copy = new self( $this->id, $this->entryId, $this->formId, $this->transactionId, $this->paymentMethod, $customerName, $this->amount, $this->currency, $this->squareReceiptUrl, $this->dateCreated, $this->providerMeta ); $copy->status = $this->status; return $copy; } public function withProviderMeta(?string $providerMeta): self { $copy = new self( $this->id, $this->entryId, $this->formId, $this->transactionId, $this->paymentMethod, $this->customerName, $this->amount, $this->currency, $this->squareReceiptUrl, $this->dateCreated, $providerMeta ); $copy->status = $this->status; return $copy; } /** * @return mixed[] */ public function toArray(): array { return [ 'id' => $this->id, 'entryId' => $this->entryId, 'formId' => $this->formId, 'transactionId' => $this->transactionId, 'paymentMethod' => $this->paymentMethod, 'customerName' => $this->customerName, 'amount' => $this->amount, 'currency' => $this->currency, 'squareReceiptUrl' => $this->squareReceiptUrl, 'dateCreated' => $this->dateCreated, 'status' => $this->status, 'providerMeta' => $this->providerMeta, ]; } }