diff --git a/src/Spryker/Zed/AppPayment/Persistence/Propel/Payment/Mapper/PaymentMapper.php b/src/Spryker/Zed/AppPayment/Persistence/Propel/Payment/Mapper/PaymentMapper.php index 5182dfc..7325c36 100644 --- a/src/Spryker/Zed/AppPayment/Persistence/Propel/Payment/Mapper/PaymentMapper.php +++ b/src/Spryker/Zed/AppPayment/Persistence/Propel/Payment/Mapper/PaymentMapper.php @@ -14,6 +14,7 @@ use Orm\Zed\AppPayment\Persistence\SpyPaymentRefund; use Orm\Zed\AppPayment\Persistence\SpyPaymentTransfer; use Propel\Runtime\Collection\Collection; +use Propel\Runtime\Map\TableMap; class PaymentMapper { @@ -23,11 +24,11 @@ public function mapPaymentTransferToPaymentEntity(PaymentTransfer $paymentTransf $quoteJson = json_encode($quoteTransfer->toArray()); $additionalPaymentData = json_encode($paymentTransfer->getAdditionalPaymentData() ?? []); - $paymentData = $paymentTransfer->modifiedToArray(); + $paymentData = $paymentTransfer->modifiedToArray(true, true); $paymentData[PaymentTransfer::QUOTE] = $quoteJson; $paymentData[PaymentTransfer::ADDITIONAL_PAYMENT_DATA] = $additionalPaymentData; - return $spyPayment->fromArray($paymentData); + return $spyPayment->fromArray($paymentData, TableMap::TYPE_CAMELNAME); } public function mapPaymentEntityToPaymentTransfer(SpyPayment $spyPayment, PaymentTransfer $paymentTransfer): PaymentTransfer @@ -35,7 +36,7 @@ public function mapPaymentEntityToPaymentTransfer(SpyPayment $spyPayment, Paymen $quoteData = json_decode((string)$spyPayment->getQuote(), true); $additionalPaymentData = json_decode((string)$spyPayment->getAdditionalPaymentData(), true); - $paymentData = $spyPayment->toArray(); + $paymentData = $spyPayment->toArray(TableMap::TYPE_CAMELNAME); $paymentData[PaymentTransfer::QUOTE] = $quoteData; $paymentData[PaymentTransfer::ADDITIONAL_PAYMENT_DATA] = $additionalPaymentData; diff --git a/src/Spryker/Zed/AppPayment/Persistence/Propel/Schema/spy_app_payment.schema.xml b/src/Spryker/Zed/AppPayment/Persistence/Propel/Schema/spy_app_payment.schema.xml index db25279..062bbe6 100644 --- a/src/Spryker/Zed/AppPayment/Persistence/Propel/Schema/spy_app_payment.schema.xml +++ b/src/Spryker/Zed/AppPayment/Persistence/Propel/Schema/spy_app_payment.schema.xml @@ -9,7 +9,7 @@ - + diff --git a/tests/SprykerTest/AsyncApi/AppPayment/AppPaymentTests/PaymentCommands/CancelPaymentTest.php b/tests/SprykerTest/AsyncApi/AppPayment/AppPaymentTests/PaymentCommands/CancelPaymentTest.php index 57ea650..5a884c2 100644 --- a/tests/SprykerTest/AsyncApi/AppPayment/AppPaymentTests/PaymentCommands/CancelPaymentTest.php +++ b/tests/SprykerTest/AsyncApi/AppPayment/AppPaymentTests/PaymentCommands/CancelPaymentTest.php @@ -41,6 +41,7 @@ class CancelPaymentTest extends Unit protected AppPaymentAsyncApiTester $tester; /** + * @group test1 * Cancellable states are all states before a payment is captured. When a payment is captured, it cannot be cancelled anymore and only the refund operation is possible. * This test will check if the payment is updated to PaymentStatusEnum::STATUS_CANCELLED when the CancelPayment message is received and the payment is in a cancellable state. */ diff --git a/tests/_data/app_payment.databuilder.xml b/tests/_data/app_payment.databuilder.xml index e736541..16bcc3b 100644 --- a/tests/_data/app_payment.databuilder.xml +++ b/tests/_data/app_payment.databuilder.xml @@ -9,7 +9,7 @@ - +