Incorrectly formatted metadata triggers Stripe error

Created on 7 November 2016, almost 9 years ago
Updated 18 August 2025, about 1 month ago

I was receiving an error from stripe that was preventing cards from being processed. Apparently the Stripe API was expecting the order number in the metadata as a string, and the module was passing an array instead. Simple fix was changing line 524 of commerce_stripe.module from this...

commerce_stripe_add_metadata($c, $order);

to this...

commerce_stripe_add_metadata($c, $order->order_number);

This now allows Stripe to function but commerce_stripe_test.module is triggering notices in Drupal's logs...

Type php
Date Monday, November 7, 2016 - 18:50
User admin
Location http://mysite.com/checkout/85/review
Referrer http://mysite.com/checkout/85/review
Message Notice: Trying to get property of non-object in commerce_stripe_test_commerce_stripe_metadata() (line 12 of /usr/local/www/apache24/data/sites/all/modules/commerce_stripe/tests/commerce_stripe_test.module).
Severity notice

πŸ’¬ Support request
Status

Closed: outdated

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States autodidactic

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024