Skip to content

Commit

Permalink
Update generated code (#1640)
Browse files Browse the repository at this point in the history
Update generated code for v296

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] authored Apr 13, 2023
1 parent abb82a2 commit 0c948ce
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v294
v296
90 changes: 90 additions & 0 deletions example/generated_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import (
testhelpers_treasury_receivedcredit "github.com/stripe/stripe-go/v74/testhelpers/treasury/receivedcredit"
testhelpers_treasury_receiveddebit "github.com/stripe/stripe-go/v74/testhelpers/treasury/receiveddebit"
_ "github.com/stripe/stripe-go/v74/testing"
token "github.com/stripe/stripe-go/v74/token"
topup "github.com/stripe/stripe-go/v74/topup"
transfer "github.com/stripe/stripe-go/v74/transfer"
transferreversal "github.com/stripe/stripe-go/v74/transferreversal"
Expand Down Expand Up @@ -533,6 +534,19 @@ func TestTestHelpersTreasuryReceivedDebitCreate(t *testing.T) {
assert.NotNil(t, result)
}

func TestTokenCreate(t *testing.T) {
params := &stripe.TokenParams{
Card: &stripe.CardParams{
Number: stripe.String("4242424242424242"),
ExpMonth: stripe.String("5"),
ExpYear: stripe.String("2023"),
CVC: stripe.String("314"),
},
}
result, _ := token.New(params)
assert.NotNil(t, result)
}

func TestAccountLinkCreate(t *testing.T) {
params := &stripe.AccountLinkParams{
Account: stripe.String("acct_xxxxxxxxxxxxx"),
Expand Down Expand Up @@ -2428,6 +2442,69 @@ func TestTestHelpersTestClockAdvance2(t *testing.T) {
assert.NotNil(t, result)
}

func TestTokenCreate2(t *testing.T) {
params := &stripe.TokenParams{
BankAccount: &stripe.BankAccountParams{
Country: stripe.String("US"),
Currency: stripe.String(string(stripe.CurrencyUSD)),
AccountHolderName: stripe.String("Jenny Rosen"),
AccountHolderType: stripe.String("individual"),
RoutingNumber: stripe.String("110000000"),
AccountNumber: stripe.String("000123456789"),
},
}
result, _ := token.New(params)
assert.NotNil(t, result)
}

func TestTokenCreate3(t *testing.T) {
params := &stripe.TokenParams{
PII: &stripe.TokenPIIParams{IDNumber: stripe.String("000000000")},
}
result, _ := token.New(params)
assert.NotNil(t, result)
}

func TestTokenCreate4(t *testing.T) {
params := &stripe.TokenParams{
Account: &stripe.TokenAccountParams{
Individual: &stripe.PersonParams{
FirstName: stripe.String("Jane"),
LastName: stripe.String("Doe"),
},
TOSShownAndAccepted: stripe.Bool(true),
},
}
result, _ := token.New(params)
assert.NotNil(t, result)
}

func TestTokenCreate5(t *testing.T) {
params := &stripe.TokenParams{
Person: &stripe.PersonParams{
FirstName: stripe.String("Jane"),
LastName: stripe.String("Doe"),
Relationship: &stripe.PersonRelationshipParams{Owner: stripe.Bool(true)},
},
}
result, _ := token.New(params)
assert.NotNil(t, result)
}

func TestTokenCreate6(t *testing.T) {
params := &stripe.TokenParams{
CVCUpdate: &stripe.TokenCVCUpdateParams{CVC: stripe.String("123")},
}
result, _ := token.New(params)
assert.NotNil(t, result)
}

func TestTokenRetrieve(t *testing.T) {
params := &stripe.TokenParams{}
result, _ := token.Get("tok_xxxx", params)
assert.NotNil(t, result)
}

func TestTopupList(t *testing.T) {
params := &stripe.TopupListParams{}
params.Limit = stripe.Int64(3)
Expand Down Expand Up @@ -2828,3 +2905,16 @@ func TestTaxCalculationListLineItems(t *testing.T) {
assert.NotNil(t, result)
assert.Nil(t, result.Err())
}

func TestPaymentIntentCreate3(t *testing.T) {
params := &stripe.PaymentIntentParams{
Amount: stripe.Int64(200),
Currency: stripe.String(string(stripe.CurrencyUSD)),
PaymentMethodData: &stripe.PaymentIntentPaymentMethodDataParams{
Type: stripe.String("p24"),
P24: &stripe.PaymentMethodP24Params{Bank: stripe.String("blik")},
},
}
result, _ := paymentintent.New(params)
assert.NotNil(t, result)
}

0 comments on commit 0c948ce

Please sign in to comment.