Closed mbarreiro85 closed 1 month ago
Curious, is there a reason the default value for $requestOptions
has been set as null
rather than []
to follow suit with $options
?
@u01jmg3 to match the stripe default
In that case, should $options
(referred to as $params
in Stripe) also have a default value of null
because that's what Stripe uses?
null
but []
does seem more fitting for a parameter that's type hinted with array
but that's just my opinion.Customer::create()
: https://github.com/stripe/stripe-php/blob/ce69d019941cf528c036ae0d1a3a9580c7389460/lib/Customer.php#L62/**
* Creates a new customer object.
*
* @param null|array $params
* @param null|array|string $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Customer the created resource
*/
public static function create($params = null, $options = null)
{
// ...
}
@u01jmg3 yeah I guess you're right. Can you make that PR?
There are actually multiple places and that's just in ManagesCustomer.php
. How would you like to proceed?
See: b8ababd
ah I actually meant the other way around and making the new param from here with a []
default.
This allows users to use idempotency keys when creating new customers
https://docs.stripe.com/api/idempotent_requests