I'm creating a custom Payment Gateway. The process is very smooth! Good job there :)
I want to add a response log to the gateway data. This happens while we're in the checkout method.
But when calling $order->gatewayData(static::class)->data() I run into DuncanMcClean\SimpleCommerce\Orders\GatewayData::data(): Return value must be of type Illuminate\Support\Collection, null returned
because data is not defined at that time. The return type annotation should be ?Collection.
Description
I'm creating a custom Payment Gateway. The process is very smooth! Good job there :)
I want to add a response log to the gateway data. This happens while we're in the checkout method.
But when calling
$order->gatewayData(static::class)->data()
I run intoDuncanMcClean\SimpleCommerce\Orders\GatewayData::data(): Return value must be of type Illuminate\Support\Collection, null returned
because data is not defined at that time. The return type annotation should be?Collection
.https://github.com/duncanmcclean/simple-commerce/blob/5f0cda71864fff7792a71c824e7dc63680d949e8/src/Orders/GatewayData.php#L41
Alternatively an empty Collection should be returned if
data
is not yet defined.Steps to reproduce
$order->gatewayData(static::class)->data()
in the beginning of the checkout methodEnvironment