diff --git a/database/migrations/create_payments_table.php.stub b/database/migrations/create_payments_table.php.stub index 2fc008f..ed94215 100644 --- a/database/migrations/create_payments_table.php.stub +++ b/database/migrations/create_payments_table.php.stub @@ -30,9 +30,9 @@ class CreatePaymentsTable extends Migration $table->string('description'); $table->string('state')->default(PaymentState::defaultValue()); - $table->json('parameters'); + $table->text('parameters'); - $table->timestamp('completed_at'); + $table->dateTime('completed_at')->nullable(); $table->timestamps(); $table->softDeletes(); }); diff --git a/src/Payments/Payment.php b/src/Payments/Payment.php index 6c283a8..4091e48 100644 --- a/src/Payments/Payment.php +++ b/src/Payments/Payment.php @@ -102,7 +102,9 @@ public function setGateway(string $gateway) */ public function setParameter($key, $value) { - $this->parameters[$key] = $value; + $params = $this->parameters; + $params[$key] = $value; + $this->parameters = $params; $this->save(); } diff --git a/src/Requests/AbstractRequest.php b/src/Requests/AbstractRequest.php index a323e40..c3d6888 100644 --- a/src/Requests/AbstractRequest.php +++ b/src/Requests/AbstractRequest.php @@ -166,7 +166,7 @@ private function validate() * @param string[] $args * @throws InvalidRequestException */ - private function validateParameters(...$args) + private function validateParameters(array $args) { foreach ($args as $key) { $value = $this->parameters[$key]; diff --git a/src/Responses/AbstractValidatePaymentResponse.php b/src/Responses/AbstractValidatePaymentResponse.php index ba0ab32..a82c2c8 100644 --- a/src/Responses/AbstractValidatePaymentResponse.php +++ b/src/Responses/AbstractValidatePaymentResponse.php @@ -15,4 +15,9 @@ public abstract function getGatewayId(); */ public abstract function validated(); + /** + * @return string + */ + public abstract function getMessage(); + } \ No newline at end of file