README

FakerPHP Stripe ID Provider

👋 Introduction
This package allows FakerPHP to generate fake IDs which have the same structure you can expect to be returned from
Stripe. The wonderful Pest is used to run tests contained within this package, which requires
a minimum PHP Version of 8.2.
This package is listed on the official FakerPHP website as a third party library.
✨Features
This package can currently generate fake IDs for the following Stripe resources. To avoid any confusion,
the names of resources should match what's in this package.
Core Resources
| API Resource |
Method |
Example |
| Balance Transactions |
stripeCoreBalanceTransactionId() |
txn_na40ulkbDvvegzALfY8w61udH |
| Charges |
stripeCoreChargeId() |
ch_Dxy18EPyj6XXvqQiqApPQ8dA |
| Customers |
stripeCoreCustomerId() |
cus_uW8qUwsTwKKtY3 |
| Disputes |
stripeCoreDisputeId() |
dp_e3ZeEytdlpOxMtRg9M88RMcq |
| Events |
stripeCoreEventId() |
evt_diyd59RDTVw8ZxrnkOt62mFS |
| Event Destinations |
stripeCoreEventDestinationId() |
ed_d1RhD6TdVjw78ZxrnkOt62mFS |
| Files |
stripeCoreFileId() |
file_qrbRTo7XbytwvE6w3SQU8QXK |
| File Links |
stripeCoreFileLinkId() |
link_Z5Tesn6zQYYdov5R3bCblM8A |
| FX Quotes |
stripeFxQuoteId() |
fxq_An1iMLYse0YRmS43Ls2ZNCdd |
| Mandates |
stripeCoreMandateId() |
mandate_S4EbkGH8MFAOWUXivQqcV7wx |
| PaymentIntents |
stripeCorePaymentIntentId() |
pi_KiAjc3WFzvswIhq8IkCLXNBW |
| PaymentIntents |
stripeCorePaymentIntentClientSecret() |
pi_rZh1PKbBkmMFkHve9GKRKyg4_secret_dr3lRVfoKD8ew3BUmYZYuVONV |
| SetupIntents |
stripeCoreSetupIntentId() |
seti_yeYZcpT970pn6sBXlAkj8AbK |
| SetupIntents |
stripeCoreSetupIntentClientSecret() |
seti_xFyqGss1WNuKVCKf1KnXfD3b_secret_Yy5L7jzP4RuoQrCiIBqXn9FWuSvX3z6 |
| SetupAttempts |
stripeCoreSetupAttemptId() |
setatt_JBHfYghz8HiScAnOcOKin75X |
| Payouts |
stripeCorePayoutId() |
po_YqFWOxztWRuLCJezThbHktTP |
| Refunds |
stripeCoreRefundId() |
re_3BebPOs89OAgEtXAOG0c1eF4 |
| Confirmation Tokens |
stripeCoreConfirmationTokenId() |
ctoken_UDlKXzYnsCqEJvomcWWqCnTF |
| Account Tokens |
stripeCoreAccountTokenId() |
ct_XPKqNZwOTjWJatx4A5zW2Myh |
| Bank Account Tokens |
stripeCoreBankAccountTokenId() |
btok_8RnxS6Y358qBuRRYS4el8LEo |
| Card Tokens |
stripeCoreTokenId() |
tok_q1KiYddcC48Tqney3T8Vnkzu |
| CVC Update Tokens |
stripeCoreCvcUpdateTokenId() |
cvctok_wWV1bniJ16gsBjJlIMrN8T87 |
| Person Tokens |
stripeCorePersonTokenId() |
cpt_MtqTlVzM2qmAIv0KhZJ0qV4g |
| PII Tokens |
stripeCorePersonallyIdentifiableInformationTokenId() |
pii_uCbQpWwZu3tJEUm18GiQsKAa |
Payment Methods
Products
| API Resource |
Method |
Example |
| Products |
stripeProductId() |
prod_Kp7fBKUx6qs3FC |
| Prices |
stripeProductPriceId() |
price_YhlhAgy0lHbLcOWwFZ596x1S |
| Promotion Codes |
stripeProductPromotionCodeId() |
promo_7ADzsJ6WuQIsKsIj4T4MTeIX |
| Discounts |
stripeProductDiscountId() |
di_DleWj1FqYhsriqRSaQr6jCgs |
| Tax Codes |
stripeProductTaxCodeId() |
txcd_90766505 |
| Tax Rates |
stripeProductTaxRateId() |
txr_nNePe3bTkOwlrAbsAxpXzWXy |
| Shipping Rates |
stripeProductShippingRateId() |
shr_Sg2ZpoUCsfdAujoCc8U8MDba |
Checkout
| API Resource |
Method |
Example |
| Checkout Sessions |
stripeCheckoutSessionId() |
cs_A1caKuWyEPOrovEkpYJLfId5uOpWzynW8ZunRYnA0J9RsPzdM6YeBfDG03 |
Payment Links
| API Resource |
Method |
Example |
| Payment Link |
stripePaymentLinkId() |
plink_L85n1vZMv4QS0aYwj11TKjTy |
Billing
| API Resource |
Method |
Example |
| Credit Note |
stripeBillingCreditNoteId() |
cn_37b9KW8lODWCDSilck1hs0on |
| Credit Note Line Items |
stripeBillingCreditNoteLineItemId() |
il_75E91IzYCJaaSbESOZl5GQiF |
| Credit Balance Transactions |
stripeBillingCreditBalanceTransactionId() |
cbtxn_37b3DSyi5lc9uck2sp1hs0on |
| Customer Portal Session |
stripeBillingCustomerPortalId() |
bps_HFXl8fnSxXjVUvepP0g7cfEH |
| Customer Portal Configuration |
stripeBillingCustomerPortalConfigurationId() |
bpc_sfteIfmkKXSNTxL7nA5dNKVS |
| Invoices |
stripeBillingInvoiceId() |
in_pBNUeaVUmJ8I44Fx1OajNLQn |
| Invoice Items |
stripeBillingInvoiceItemId() |
ii_gOWpZpoGoMOE5IYVS86mmGXS |
| Invoice Line Item |
stripeBillingInvoiceLineItemId() |
il_tmp_lZHqliBZKLzgXuBajqYaAhxz |
| Invoice Payment |
stripeBillingInvoicePaymentId() |
inpay_uUOgHHV0V88gjsZz4kh1at5D |
| Invoice Rendering Template |
stripeBillingInvoiceLineItemId() |
inrtem_lZHqlidX3uB6aFqtYeafAhxz |
| Alerts |
stripeBillingAlertId() |
alrt_39061 |
| Meters |
stripeBillingMeterId() |
mtr_53464 |
| Meter Event Adjustment |
stripeBillingMeterAdjustmentId() |
mtr_event_adj_68238901 |
| Meter Event Summary |
stripeBillingMeterEventSummaryId() |
mtrusg_Be99DBj9c2jnNh5IxKt2bULP2Mb36xnO29OpHiVsfIeuyyI3OGvdtem4qLZ5e0O3ZB0cT93uhqpQZWJdNtYNmOERzX7AOan9OHu373TqGQoVYVBtzghvVp0oMclD2iZfnGYdeePNUvi5gKtsE36tuhev4h62i79IM8uWTdS0U77j4cz0DDOMZCcvX |
| Credit Grants |
stripeBillingCreditGrantId() |
credgr_37b9KW82CDhSi5lcuk1hs0on |
| Credit Balance Transactions |
stripeBillingCustomerBalanceTransactionId() |
cbtxn_SboO9vmMCUoTg6iGGdsOQ18R |
| Plans |
stripeBillingPlanId() |
price_9wWZ7dtmQSWvQDhFBJB49sv8 |
| Quote |
stripeBillingQuoteId() |
qt_qrx3tn3rnQ1USENFK1gJcXLv |
| Subscriptions |
stripeBillingSubscriptionId() |
sub_wMwsJiaZpdRfrF7WXkP0ibmc |
| Subscription Items |
stripeBillingSubscriptionItemId() |
si_3OdBLaD7p37H2A |
| Subscription Schedules |
stripeBillingSubscriptionScheduleId() |
sub_sched_OnyC6GSR3kjse08ehVNsB5U0 |
| Tax IDs |
stripeBillingCustomerTaxIdId() |
txi_Vs7BSOcldH5QIN35U8lSlJuc |
| Test Clocks |
stripeBillingTestClockId() |
clock_6QR6dCPpUhhBg81wmyFF4VtJ |
Capital
| API Resource |
Method |
Example |
| FinancingOffers |
stripeFinancingOfferId() |
financingoffer_Y15ngYE41jww8upx9J2PcFXxQWBjp |
Connect
| API Resource |
Method |
Example |
| Accounts |
stripeConnectAccountId() |
acct_l8cMrvSDcUT4qP2h |
| Application Fees |
stripeConnectApplicationFeeId() |
fee_ITNGc4r7B4QMjtOjsLr1GA2U |
| Application Fee Refunds |
stripeConnectApplicationFeeRefundId() |
fr_XxY71TOJinzdNkmEQUVtlUGk |
| Capabilities |
stripeConnectCapabilityId() |
acap_gettfmKTrHMdUQgppBj8BJ6F |
| External Bank Accounts |
stripeConnectExternalAccountId() |
ba_j8048CaKvbk1ie7lfxyzXF19 |
| External Account Cards |
stripeExternalAccountCardId() |
card_0TsW9JT5P8vkQ1eyWiCn4z0I |
| Persons |
stripeConnectPersonId() |
person_cNquFb7JU2nVsfIlprJHqIc1 |
| Top-ups |
stripeConnectTopUpId() |
tu_kdxjWmOqbz9J5rMdnibcnr37 |
| Transfers |
stripeConnectTransferId() |
tr_1gClurOotKNBjvk7ktS3JHxo |
| Transfer Reversals |
stripeConnectTransferReversalId() |
trr_LWr56oP4aoPIjVeXGOiFOJ6f |
| Secrets |
stripeConnectSecretManagementId() |
appsecret_QjQnyoan5rtIYdHSokfut7VD |
Fraud
| API Resource |
Method |
Example |
| Early Fraud Warning |
stripeFraudEarlyFraudWarningId() |
issfr_NDwczkwka50cAHRFVfnbQP30 |
| Reviews |
stripeFraudReviewId() |
prv_Zlx9K6ixTcigHUnOdpxqCjOO |
| Value Lists |
stripeFraudValueListId() |
rsl_C8PVL4lNS75t4PWEscJUXEkm |
| Value List Items |
stripeFraudValueListItemId() |
rsli_QQdPv6uWYm7nZUlX3g65TfGV |
Issuing
| API Resource |
Method |
Example |
| Authorizations |
stripeIssuingAuthorizationId() |
iauth_GyuotdxkKEHCNNYHohzBBuBh |
| Cardholders |
stripeIssuingCardholderId() |
ich_EyqQ6EcYkhzgyrGEQSCY68EB |
| Cards |
stripeIssuingCardId() |
ic_IsXAmEVzInXUPtq4uttDZ2g2 |
| Disputes |
stripeIssuingDisputeId() |
idp_lXR4WsU6fhdpErzWVNOr24Ux |
| Personalization Designs |
stripeIssuingPersonalizationDesignsId() |
ipcd_ulVGQxe21jR4vx |
| Physical Bundles |
stripeIssuingPhysicalBundlesId() |
ics_Kd7CQOUvHjJelX |
| Tokens |
stripeIssuingTokenId() |
intok_HMkTW4FnWckzqqNGGFJP4I7E |
| Transactions |
stripeIssuingTransactionId() |
ipi_FqGAHy3JUvUsjWdqyaViRFm2 |
Terminal
Treasury
| API Resource |
Method |
Example |
| FinancialAccounts |
stripeTreasuryFinancialAccountId() |
fa_SHiUjM3c13bPdvV81YlFYwQu |
| Transactions |
stripeTreasuryTransactionId() |
trxn_VCKBAZWMzRUul2KHkWZjHGRt |
| TransactionEntries |
stripeTreasuryTransactionEntryId() |
trxne_xe1YTcpq1tmWUgzNABC8kT1S |
| OutboundTransfers |
stripeTreasuryOutboundTransferId() |
obt_9f5fWmY0s8Rbbfi8AoeifoRC |
| OutboundPayments |
stripeTreasuryOutboundPaymentId() |
obp_QOJPdQ7lbAybgALjh67lgbsA |
| InboundTransfers |
stripeTreasuryInboundTransferId() |
ibt_JE9DIuWCZ9bY9xGPeKYPkSI5 |
| ReceivedCredits |
stripeTreasuryReceivedCreditId() |
rc_46y23bSUUCoMmsdv7Zvx0zYr |
| ReceivedDebits |
stripeTreasuryReceivedDebitId() |
rd_ylnZC0HqdHBWWouwFsQhE4GU |
| CreditReversals |
stripeTreasuryCreditReversalId() |
credrev_awpfYT4hppBEmsz9KPgtOYDm |
| DebitReversals |
stripeTreasuryDebitReversalId() |
debrev_ykpt4Mi6yZAPrm8upq3yKI5r |
Entitlements
| API Resource |
Method |
Example |
| Feature |
stripeEntitlementFeatureId() |
feat_YZF6aSsx1eTNhEYrsMw6xdUeZ6lESQjt |
| Product Feature |
stripeEntitlementProductFeatureId() |
prodft_8qi4lJKVjxGy8u |
| Active Entitlement |
stripeEntitlementActiveEntitlementId() |
ent_avB0r4MuPxc66IVgc2EF4lK50OznONZu |
Sigma
| API Resource |
Method |
Example |
| Scheduled Queries |
stripeSigmaScheduledQueryRunId() |
sqr_89Lp2zqyTtqJXSFuPn9zHIcZ |
| Query Run |
stripeSigmaQueryId() |
qry_dwqXjY61dhXHyp0NGLbrhymx |
Reporting
| API Resource |
Method |
Example |
| Report Runs |
stripeReportingReportRunId() |
frr_jJ9LNixW3dEQco0XTeX2zE1R |
Financial Connections
| API Resource |
Method |
Example |
| Accounts |
stripeFinancialConnectionAccountId() |
fca_z3JzQ1OCkYved5uWOqh3b387 |
| Account Owner |
stripeFinancialConnectionAccountOwnershipId() |
fcaowns_XwyWHMQFo9koh9U1TuOMW43D |
| Sessions |
stripeFinancialConnectionSessionId() |
fcsess_ZnomHexUQ68qiad2GWqQsvsa |
| Transactions |
stripeFinancialConnectionTransactionId() |
fctxn_yIcXfBzg3NSJRYHqIW5spz4v |
| Transaction Refresh |
stripeFinancialConnectionTransactionRefreshId() |
fctxnref_qjmwOP8D8hJlSBgSKqHsY0Bi |
Tax
Identity
| API Resource |
Method |
Example |
| Verification Session |
stripeIdentityVerificationSessionId() |
vs_j8AvYT7Tbmjz26tASmjdcyNt |
| Verification Report |
stripeIdentityVerificationReportId() |
vr_IwuD3wV5qfD4t4fbTOzWwUm6 |
Crypto
| API Resource |
Method |
Example |
| Crypto Onramp Sessions |
stripeCryptoOnrampSessionId() |
cos_wlo5PYZC2j8lFHnMaxbuFBK8 |
| Crypto Onramp Sessions |
stripeCryptoOnrampSessionClientSecret() |
cos_Wjo3OVUVusWY54RHF6oCM0Jm_secret_Bm9iRlLbb82K19mwOxQE9jVdA0U8rMEmKO6 |
Climate
| API Resource |
Method |
Example |
| Climate Order |
stripeClimateOrderId() |
climorder_zPgRtPy8onKSuWtEHoNZidD9 |
| Climate Product |
stripeClimateProductId() |
climsku_zhSJ6n8xrB3iLS4yHNVxzpBq |
| Climate Supplier |
stripeClimateSupplierId() |
climsup_YKxeDsj2hhmR2cqmangtVy02 |
Forwarding
Privacy
Webhooks
| API Resource |
Method |
Example |
| Webhook Endpoints |
stripeWebhookEndpointId() |
we_irKQp8JwXgUxXFefCM6zlx1R |
| Webhook Application |
stripeWebhookApplicationId() |
ca_Y5nYE1wwup9JPcXxQ9JaJWBRAJiFMujp |
📚 Usage / Examples
Pest
it('generates a well structured stripe account id', function () {
fake()->addProvider(new Stripe(fake()));
expect(fake()->stripeConnectAccountId())->toStartWith('acct_')->toHaveLength(21)->toBeString();
});
PHPUnit
public function testGeneratesWellStructuredStripeAccountId()
{
$faker = Factory::create();
$faker->addProvider(new Stripe($faker));
$this->assertStringStartsWith('acct_', $faker->stripeConnectAccountId());
}
Laravel Factories
use WithFaker;
public function definition(): array
{
$this->faker->addProvider(new Stripe($this->faker));
return [
'id' => $this->faker->stripeConnectAccountId(),
'name' => 'John Doe',
'email' => 'john.doe@testing.co.uk'
];
}