Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
What's the reason to use
$payment_intent = json_decode(json_encode($payment_intent), TRUE);
in _commerce_stripe_pi_get_payment_intent()? Maybe we can improve this part?
Comment | File | Size | Author |
---|---|---|---|
#6 | commerce_stripe_pi-add_comment_json_de_encodeing-3077686-6-7.x-dev.patch | 919 bytes | sepgil |
#4 | commerce_stripe_pi-add_comment_json_de_encodeing-3077686-4-7.x-dev.patch | 921 bytes | sepgil |
Comments
Comment #2
GoZ CreditAttribution: GoZ at Iosan, Barbe-Rousse commentedThis code is an easy way to convert an array to an object.
Suggestions are welcomed
Comment #3
klausiHm, but it looks like you want to convert to an array?
$array = (array) $yourObject;
would do that.Comment #4
sepgil CreditAttribution: sepgil at jobiqo - job board technology commentedThe results are objects containing other objects.
$array = (array) $yourObject;
casts only the top object but not the sub objects.$payment_intent = json_decode(json_encode($payment_intent), TRUE);
is probably the easiast way to convert everything into an array.I attached a patch to add comments to those lines.
Comment #5
klausiAh, thanks for the explanation!
Super minor spacing issues:
double space here
and here
Comment #6
sepgil CreditAttribution: sepgil at jobiqo - job board technology commentedYou have eagle eyes :D
Added new patch.
Comment #7
klausiNice, thank you!
Comment #9
GoZ CreditAttribution: GoZ at Iosan, Barbe-Rousse commentedThanks making this module greater