Skip to content

Commit

Permalink
Merge pull request #14 from JonPurvis/generate-capability-id
Browse files Browse the repository at this point in the history
generate capability id
  • Loading branch information
JonPurvis authored Aug 6, 2023
2 parents b6a981f + 9ab1161 commit 8323c17
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ the names of resources _should_ match what's in this package.
| [Accounts](https://stripe.com/docs/api/accounts) | `stripeConnectAccountId()` | `acct_l8cMrvSDcUT4qP2h` |
| [Application Fees](https://stripe.com/docs/api/application_fees) | `stripeConnectApplicationFeeId()` | `fee_ITNGc4r7B4QMjtOjsLr1GA2U` |
| [Application Fee Refunds](https://stripe.com/docs/api/fee_refunds) | `stripeConnectApplicationFeeRefundId()` | `fr_XxY71TOJinzdNkmEQUVtlUGk` |
| [Capabilities](https://stripe.com/docs/api/capabilities) | `stripeConnectCapabilityId()` | `acap_gettfmKTrHMdUQgppBj8BJ6F` |
| [External Accounts](https://stripe.com/docs/api/external_accounts) | `stripeConnectExternalAccountId()` | `ba_j8048CaKvbk1ie7lfxyzXF19` |
| [Persons](https://stripe.com/docs/api/persons) | `stripeConnectPersonId()` | `person_cNquFb7JU2nVsfIlprJHqIc1` |
| [Top-ups](https://stripe.com/docs/api/topups) | `stripeConnectTopUpId()` | `tu_kdxjWmOqbz9J5rMdnibcnr37` |
Expand Down
5 changes: 5 additions & 0 deletions src/Stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,4 +475,9 @@ public function stripeCryptoOnrampSessionClientSecret(): string
{
return 'cos_' . $this->generateRandomString() . '_secret_' . $this->generateRandomString(35);
}

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

it('generates a crypto onramp session client secret', function () {
expect($this->fake->stripeCryptoOnrampSessionClientSecret())->toStartWith('cos_')->toContain('_secret_')->toHaveLength(71)->toBeString();
})->repeat(2);

it('generates a connect capability id', function () {
expect($this->fake->stripeConnectCapabilityId())->toStartWith('acap_')->toHaveLength(29)->toBeString();
})->repeat(2);

0 comments on commit 8323c17

Please sign in to comment.