Skip to content

Commit ffa0fb8

Browse files
committed
Support toArray and __toArray methods in stripe
1 parent 737b422 commit ffa0fb8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Payum/Stripe/Action/Api/CreateChargeAction.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public function execute($request)
6767

6868
$charge = Charge::create($model->toUnsafeArrayWithoutLocal());
6969

70-
$model->replace($charge->toArray(true));
70+
$arrayMethod = method_exists($charge, 'toArray') ? 'toArray' : '__toArray';
71+
72+
$model->replace($charge->$arrayMethod(true));
7173
} catch (Error\Base $e) {
7274
$model->replace($e->getJsonBody());
7375
}

0 commit comments

Comments
 (0)