Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.x] Add requestOption when creating customers #1692

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

mbarreiro85
Copy link

This allows users to use idempotency keys when creating new customers

https://docs.stripe.com/api/idempotent_requests

@driesvints driesvints changed the title add requestOption when creating customers [16.x] Add requestOption when creating customers Jul 8, 2024
@taylorotwell taylorotwell merged commit 5512f24 into laravel:16.x Jul 8, 2024
9 checks passed
@u01jmg3
Copy link
Contributor

u01jmg3 commented Jul 9, 2024

Curious, is there a reason the default value for $requestOptions has been set as null rather than [] to follow suit with $options?

@driesvints
Copy link
Member

@u01jmg3 to match the stripe default

@u01jmg3
Copy link
Contributor

u01jmg3 commented Jul 10, 2024

In that case, should $options (referred to as $params in Stripe) also have a default value of null because that's what Stripe uses?

public function createAsStripeCustomer(array $options = [], array $requestOptions = null)


/**
 * 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)
{
    // ...
}

@driesvints
Copy link
Member

@u01jmg3 yeah I guess you're right. Can you make that PR?

@u01jmg3
Copy link
Contributor

u01jmg3 commented Jul 22, 2024

There are actually multiple places and that's just in ManagesCustomer.php. How would you like to proceed?

See: b8ababd

@driesvints
Copy link
Member

ah I actually meant the other way around and making the new param from here with a [] default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants