Skip to content

Commit

Permalink
add support for cash balance transaction ids
Browse files Browse the repository at this point in the history
  • Loading branch information
JonPurvis committed Aug 8, 2023
1 parent bea6066 commit 13fdcff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ 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` |
| [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` |
| [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
5 changes: 5 additions & 0 deletions src/Stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,4 +480,9 @@ public function stripeConnectCapabilityId(): string
{
return 'acap_' . $this->generateRandomString();
}

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

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

it('generates a cash balance transaction id', function () {
expect($this->fake->stripeCashBalanceTransactionId())->toStartWith('ccsbtxn_')->toHaveLength(32)->toBeString();
})->repeat(2);

0 comments on commit 13fdcff

Please sign in to comment.