Hello.

Stripe library in some methods takes an two arguments: $params and $options. Using function stripe_api_call it's possible to pass only $params, because we calling methods from Stripe library classes using this code:

call_user_func(array($class, $method), $params);

It would be nice if we change the function and add new argument $options.
This argument allows you to add additional headers to the request.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

qzmenko created an issue. See original summary.

qzmenko’s picture

Patch attached.
After applying it, if you want, you can simply add $options as fourth parameter in function stripe_api_call.

qzmenko’s picture

Status: Active » Needs review
qzmenko’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
FileSize
1.32 KB

I noticed that this is also actual for the 8.x version of the module.
Patch attached for 8.x version.

knyshuk.vova’s picture

This comment describes that can be another structure of method signature

public static function update($id, $params = null, $options = null)
{}

In the related issue provided better way of passing arguments.

knyshuk.vova’s picture

Status: Needs review » Patch (to be ported)

Patch from related issue can be ported to Drupal 7 version.

grasmash’s picture

Status: Patch (to be ported) » Needs work

This feels very messy. Can't we just always pass all arguments?