File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,19 +96,19 @@ protected function extractOwner()
9696 protected function extractActions ()
9797 {
9898 $ payment = Cashier::$ paymentModel ::findByPaymentId ($ this ->molliePayment ->id );
99-
100- if ( isset ( $ payment ) && ! is_null ( $ payment -> first_payment_actions )) {
101- $ actions = $ payment -> first_payment_actions ;
102- } else {
103- $ actions = $ this -> molliePayment -> metadata -> actions ;
104- }
105-
106- return collect ( $ actions ) ->map (function ($ actionMeta ) {
107- return $ actionMeta ->handler ::createFromPayload (
108- object_to_array_recursive ($ actionMeta ),
109- $ this ->owner
110- );
111- });
99+ $ actions = $ payment ?->first_payment_actions;
100+
101+ /*
102+ * For legacy reasons, the first_payment_actions value is (de)serialized on the Payment model as an object
103+ * instead of an array. This is handled by `collect()` just fine.
104+ */
105+ return collect ( $ actions )
106+ ->map (function ($ action ) {
107+ return $ action ->handler ::createFromPayload (
108+ object_to_array_recursive ($ action ),
109+ $ this ->owner
110+ );
111+ });
112112 }
113113
114114 /**
Original file line number Diff line number Diff line change 2424 * @property int amount
2525 * @property int amount_refunded
2626 * @property int amount_charged_back
27- * @property string first_payment_actions
27+ * @property object first_payment_actions // An object for legacy reasons
2828 * @property string mollie_mandate_id
2929 * @property \Laravel\Cashier\Order\Order order
3030 *
You can’t perform that action at this time.
0 commit comments