Skip to content

Commit

Permalink
add stripePaymentMethodConfigurationId and stripePaymentMethodDomainId
Browse files Browse the repository at this point in the history
  • Loading branch information
JonPurvis committed Oct 20, 2023
1 parent 93489b7 commit 6949048
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ the names of resources _should_ match what's in this package.
| [Tokens](https://stripe.com/docs/api/tokens) | `stripeCoreTokenId()` | `tok_q1KiYddcC48Tqney3T8Vnkzu` |

### Payment Methods
| API Resource | Method | Example |
|---------------------------------------------------------------------|--------------------------------------|------------------------------------|
| [Payment Methods](https://stripe.com/docs/api/payment_methods) | `stripePaymentMethodId()` | `pm_jkztRiUi5yqTNqHJTzTAVolI` |
| [Bank Accounts](https://stripe.com/docs/api/customer_bank_accounts) | `stripePaymentMethodBankAccountId()` | `ba_gkcmh6gu31nALx6PJDJckqPn` |
| [Cash Balance](https://stripe.com/docs/api/cash_balance) | `stripeCashBalanceTransactionId()` | `ccsbtxn_6sKoup9yicpuPC7MykObBsjq` |
| [Cards](https://stripe.com/docs/api/cards) | `stripePaymentMethodCardId()` | `card_A56nkfbrHtdQ7bv8I9eeQOtW` |
| API Resource | Method | Example |
|------------------------------------------------------------------------------|--------------------------------------|------------------------------------|
| [Payment Methods](https://stripe.com/docs/api/payment_methods) | `stripePaymentMethodId()` | `pm_jkztRiUi5yqTNqHJTzTAVolI` |
| [Payment Method Configurations](https://stripe.com/docs/api/payment_method_configurations) | `stripePaymentMethodConfigurationId()` | `pmc_BS6va641BwHZCexJscZ9LNH8` |
| [Payment Method Domains](https://stripe.com/docs/api/payment_method_domains) | `stripePaymentMethodDomainId()` | `pmd_FcObWHJ3gtwujiuUhVhWSe2c` |
| [Bank Accounts](https://stripe.com/docs/api/customer_bank_accounts) | `stripePaymentMethodBankAccountId()` | `ba_gkcmh6gu31nALx6PJDJckqPn` |
| [Cash Balance](https://stripe.com/docs/api/cash_balance) | `stripeCashBalanceTransactionId()` | `ccsbtxn_6sKoup9yicpuPC7MykObBsjq` |
| [Cards](https://stripe.com/docs/api/cards) | `stripePaymentMethodCardId()` | `card_A56nkfbrHtdQ7bv8I9eeQOtW` |

### Products
| API Resource | Method | Example |
Expand Down
10 changes: 10 additions & 0 deletions src/Stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,4 +495,14 @@ public function stripeIssuingTokenId(): string
{
return 'intok_' . $this->generateRandomString();
}

public function stripePaymentMethodConfigurationId(): string
{
return 'pmc_' . $this->generateRandomString();
}

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

it('generates a issuing token id', function () {
expect($this->fake->stripeIssuingTokenId())->toStartWith('intok_')->toHaveLength(30)->toBeString();
})->repeat(2);

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

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

0 comments on commit 6949048

Please sign in to comment.