Skip to content

Commit

Permalink
add ability to generate setup intent client secret
Browse files Browse the repository at this point in the history
  • Loading branch information
JonPurvis committed Nov 12, 2023
1 parent 9f85bc2 commit 16e73c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,4 +500,9 @@ public function stripePaymentMethodDomainId(): string
{
return 'pmd_' . $this->generateRandomString();
}

public function stripeCoreSetupIntentClientSecret(): string
{
return 'seti_' . $this->generateRandomString() . '_secret_' . $this->generateRandomString(31);
}
}
4 changes: 4 additions & 0 deletions tests/StripeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,4 +390,8 @@

it('generates a payment method domain id', function () {
expect($this->fake->stripePaymentMethodDomainId())->toStartWith('pmd_')->toHaveLength(28)->toBeString();
})->repeat(2);

it('generates a setup intent client secret', function () {
expect($this->fake->stripeCoreSetupIntentClientSecret())->toStartWith('seti_')->toHaveLength(68)->toBeString();
})->repeat(2);

0 comments on commit 16e73c4

Please sign in to comment.