Code Monkey home page Code Monkey logo

react-connect-js's Introduction

Go Stripe

Go Reference Build Status Coverage Status

The official Stripe Go client library.

Requirements

  • Go 1.15 or later

Installation

Make sure your project is using Go Modules (it will have a go.mod file in its root if it already is):

go mod init

Then, reference stripe-go in a Go program with import:

import (
	"github.com/stripe/stripe-go/v79"
	"github.com/stripe/stripe-go/v79/customer"
)

Run any of the normal go commands (build/install/test). The Go toolchain will resolve and fetch the stripe-go module automatically.

Alternatively, you can also explicitly go get the package into a project:

go get -u github.com/stripe/stripe-go/v79

Documentation

For a comprehensive list of examples, check out the API documentation.

See video demonstrations covering how to use the library.

For details on all the functionality in this library, see the Go documentation.

Below are a few simple examples:

Customers

params := &stripe.CustomerParams{
	Description:      stripe.String("Stripe Developer"),
	Email:            stripe.String("[email protected]"),
	PreferredLocales: stripe.StringSlice([]string{"en", "es"}),
}

c, err := customer.New(params)

PaymentIntents

params := &stripe.PaymentIntentListParams{
	Customer: stripe.String(customer.ID),
}

i := paymentintent.List(params)
for i.Next() {
	pi := i.PaymentIntent()
}

if err := i.Err(); err != nil {
	// handle
}

Events

i := event.List(nil)
for i.Next() {
	e := i.Event()

	// access event data via e.GetObjectValue("resource_name_based_on_type", "resource_property_name")
	// alternatively you can access values via e.Data.Object["resource_name_based_on_type"].(map[string]interface{})["resource_property_name"]

	// access previous attributes via e.GetPreviousValue("resource_name_based_on_type", "resource_property_name")
	// alternatively you can access values via e.Data.PrevPreviousAttributes["resource_name_based_on_type"].(map[string]interface{})["resource_property_name"]
}

Alternatively, you can use the event.Data.Raw property to unmarshal to the appropriate struct.

Authentication with Connect

There are two ways of authenticating requests when performing actions on behalf of a connected account, one that uses the Stripe-Account header containing an account's ID, and one that uses the account's keys. Usually the former is the recommended approach. See the documentation for more information.

To use the Stripe-Account approach, use SetStripeAccount() on a ListParams or Params class. For example:

// For a list request
listParams := &stripe.CustomerListParams{}
listParams.SetStripeAccount("acct_123")
// For any other kind of request
params := &stripe.CustomerParams{}
params.SetStripeAccount("acct_123")

To use a key, pass it to API's Init function:

import (
	"github.com/stripe/stripe-go/v79"
	"github.com/stripe/stripe-go/v79/client"
)

stripe := &client.API{}
stripe.Init("access_token", nil)

Google AppEngine

If you're running the client in a Google AppEngine environment, you'll need to create a per-request Stripe client since the http.DefaultClient is not available. Here's a sample handler:

import (
	"fmt"
	"net/http"

	"google.golang.org/appengine"
	"google.golang.org/appengine/urlfetch"

	"github.com/stripe/stripe-go/v79"
	"github.com/stripe/stripe-go/v79/client"
)

func handler(w http.ResponseWriter, r *http.Request) {
	c := appengine.NewContext(r)
	httpClient := urlfetch.Client(c)

	sc := client.New("sk_test_123", stripe.NewBackends(httpClient))

	params := &stripe.CustomerParams{
		Description: stripe.String("Stripe Developer"),
		Email:       stripe.String("[email protected]"),
	}
	customer, err := sc.Customers.New(params)
	if err != nil {
		fmt.Fprintf(w, "Could not create customer: %v", err)
	}
	fmt.Fprintf(w, "Customer created: %v", customer.ID)
}

Usage

While some resources may contain more/less APIs, the following pattern is applied throughout the library for a given $resource$:

Without a Client

If you're only dealing with a single key, you can simply import the packages required for the resources you're interacting with without the need to create a client.

import (
	"github.com/stripe/stripe-go/v79"
	"github.com/stripe/stripe-go/v79/$resource$"
)

// Setup
stripe.Key = "sk_key"

// Set backend (optional, useful for mocking)
// stripe.SetBackend("api", backend)

// Create
resource, err := $resource$.New(&stripe.$Resource$Params{})

// Get
resource, err = $resource$.Get(id, &stripe.$Resource$Params{})

// Update
resource, err = $resource$.Update(id, &stripe.$Resource$Params{})

// Delete
resourceDeleted, err := $resource$.Del(id, &stripe.$Resource$Params{})

// List
i := $resource$.List(&stripe.$Resource$ListParams{})
for i.Next() {
	resource := i.$Resource$()
}

if err := i.Err(); err != nil {
	// handle
}

With a Client

If you're dealing with multiple keys, it is recommended you use client.API. This allows you to create as many clients as needed, each with their own individual key.

import (
	"github.com/stripe/stripe-go/v79"
	"github.com/stripe/stripe-go/v79/client"
)

// Setup
sc := &client.API{}
sc.Init("sk_key", nil) // the second parameter overrides the backends used if needed for mocking

// Create
$resource$, err := sc.$Resource$s.New(&stripe.$Resource$Params{})

// Get
$resource$, err = sc.$Resource$s.Get(id, &stripe.$Resource$Params{})

// Update
$resource$, err = sc.$Resource$s.Update(id, &stripe.$Resource$Params{})

// Delete
$resource$Deleted, err := sc.$Resource$s.Del(id, &stripe.$Resource$Params{})

// List
i := sc.$Resource$s.List(&stripe.$Resource$ListParams{})
for i.Next() {
	$resource$ := i.$Resource$()
}

if err := i.Err(); err != nil {
	// handle
}

Accessing the Last Response

Use LastResponse on any APIResource to look at the API response that generated the current object:

c, err := coupon.New(...)
requestID := coupon.LastResponse.RequestID

Similarly, for List operations, the last response is available on the list object attached to the iterator:

it := coupon.List(...)
for it.Next() {
    // Last response *NOT* on the individual iterator object
    // it.Coupon().LastResponse // wrong

    // But rather on the list object, also accessible through the iterator
    requestID := it.CouponList().LastResponse.RequestID
}

See the definition of APIResponse for available fields.

Note that where API resources are nested in other API resources, only LastResponse on the top-level resource is set.

Automatic Retries

The library automatically retries requests on intermittent failures like on a connection error, timeout, or on certain API responses like a status 409 Conflict. Idempotency keys are always added to requests to make any such subsequent retries safe.

By default, it will perform up to two retries. That number can be configured with MaxNetworkRetries:

import (
	"github.com/stripe/stripe-go/v79"
	"github.com/stripe/stripe-go/v79/client"
)

config := &stripe.BackendConfig{
    MaxNetworkRetries: stripe.Int64(0), // Zero retries
}

sc := &client.API{}
sc.Init("sk_key", &stripe.Backends{
    API:     stripe.GetBackendWithConfig(stripe.APIBackend, config),
    Uploads: stripe.GetBackendWithConfig(stripe.UploadsBackend, config),
})

coupon, err := sc.Coupons.New(...)

Configuring Logging

By default, the library logs error messages only (which are sent to stderr). Configure default logging using the global DefaultLeveledLogger variable:

stripe.DefaultLeveledLogger = &stripe.LeveledLogger{
    Level: stripe.LevelInfo,
}

Or on a per-backend basis:

config := &stripe.BackendConfig{
    LeveledLogger: &stripe.LeveledLogger{
        Level: stripe.LevelInfo,
    },
}

It's possible to use non-Stripe leveled loggers as well. Stripe expects loggers to comply to the following interface:

type LeveledLoggerInterface interface {
	Debugf(format string, v ...interface{})
	Errorf(format string, v ...interface{})
	Infof(format string, v ...interface{})
	Warnf(format string, v ...interface{})
}

Some loggers like Logrus and Zap's SugaredLogger support this interface out-of-the-box so it's possible to set DefaultLeveledLogger to a *logrus.Logger or *zap.SugaredLogger directly. For others it may be necessary to write a thin shim layer to support them.

Expanding Objects

All expandable objects in stripe-go take the form of a full resource struct, but unless expansion is requested, only the ID field of that struct is populated. Expansion is requested by calling AddExpand on parameter structs. For example:

//
// *Without* expansion
//
c, _ := charge.Get("ch_123", nil)

c.Customer.ID    // Only ID is populated
c.Customer.Name  // All other fields are always empty

//
// With expansion
//
p := &stripe.ChargeParams{}
p.AddExpand("customer")
c, _ = charge.Get("ch_123", p)

c.Customer.ID    // ID is still available
c.Customer.Name  // Name is now also available (if it had a value)

How to use undocumented parameters and properties

stripe-go is a typed library and it supports all public properties or parameters.

Stripe sometimes launches private beta features which introduce new properties or parameters that are not immediately public. These will not have typed accessors in the stripe-go library but can still be used.

Parameters

To pass undocumented parameters to Stripe using stripe-go you need to use the AddExtra() method, as shown below:

	params := &stripe.CustomerParams{
		Email: stripe.String("[email protected]")
	}

	params.AddExtra("secret_feature_enabled", "true")
	params.AddExtra("secret_parameter[primary]","primary value")
	params.AddExtra("secret_parameter[secondary]","secondary value")

	customer, err := customer.Create(params)

Properties

You can access undocumented properties returned by Stripe by querying the raw response JSON object. An example of this is shown below:

customer, _ = customer.Get("cus_1234", nil);

var rawData map[string]interface{}
_ = json.Unmarshal(customer.LastResponse.RawJSON, &rawData)

secret_feature_enabled, _ := string(rawData["secret_feature_enabled"].(bool))

secret_parameter, ok := rawData["secret_parameter"].(map[string]interface{})
if ok {
	primary := secret_parameter["primary"].(string)
	secondary := secret_parameter["secondary"].(string)
} 

Webhook signing

Stripe can optionally sign the webhook events it sends to your endpoint, allowing you to validate that they were not sent by a third-party. You can read more about it here.

Testing Webhook signing

You can use stripe.webhook.GenerateTestSignedPayload to mock webhook events that come from Stripe:

payload := map[string]interface{}{
	"id":          "evt_test_webhook",
	"object":      "event",
	"api_version": stripe.APIVersion,
}
testSecret := "whsec_test_secret"

payloadBytes, err := json.Marshal(payload)

signedPayload := webhook.GenerateTestSignedPayload(&webhook.UnsignedPayload{Payload: payloadBytes, Secret: testSecret})
event, err := webhook.ConstructEvent(signedPayload.Payload, signedPayload.Header, signedPayload.Secret)

if event.ID == payload["id"] {
	// Do something with the mocked signed event
} else {
	// Handle invalid event payload
}

Writing a Plugin

If you're writing a plugin that uses the library, we'd appreciate it if you identified using stripe.SetAppInfo:

stripe.SetAppInfo(&stripe.AppInfo{
	Name:    "MyAwesomePlugin",
	URL:     "https://myawesomeplugin.info",
	Version: "1.2.34",
})

This information is passed along when the library makes calls to the Stripe API. Note that while Name is always required, URL and Version are optional.

Telemetry

By default, the library sends telemetry to Stripe regarding request latency and feature usage. These numbers help Stripe improve the overall latency of its API for all users, and improve popular features.

You can disable this behavior if you prefer:

config := &stripe.BackendConfig{
	EnableTelemetry: stripe.Bool(false),
}

Mocking clients for unit tests

To mock a Stripe client for a unit tests using GoMock:

  1. Generate a Backend type mock.
mockgen -destination=mocks/backend.go -package=mocks github.com/stripe/stripe-go/v79 Backend
  1. Use the Backend mock to initialize and call methods on the client.
import (
	"example/hello/mocks"
	"testing"

	"github.com/golang/mock/gomock"
	"github.com/stretchr/testify/assert"
	"github.com/stripe/stripe-go/v79"
	"github.com/stripe/stripe-go/v79/account"
)

func UseMockedStripeClient(t *testing.T) {
	// Create a mock controller
	mockCtrl := gomock.NewController(t)
	defer mockCtrl.Finish()
	// Create a mock stripe backend
	mockBackend := mocks.NewMockBackend(mockCtrl)
	client := account.Client{B: mockBackend, Key: "key_123"}

	// Set up a mock call
	mockBackend.EXPECT().Call("GET", "/v1/accounts/acc_123", gomock.Any(), gomock.Any(), gomock.Any()).
		// Return nil error
		Return(nil).
		Do(func(method string, path string, key string, params stripe.ParamsContainer, v *stripe.Account) {
			// Set the return value for the method
			*v = stripe.Account{
				ID: "acc_123",
			}
		}).Times(1)

	// Call the client method
	acc, _ := client.GetByID("acc_123", nil)

	// Asset the result
	assert.Equal(t, acc.ID, "acc_123")
}

Beta SDKs

Stripe has features in the beta phase that can be accessed via the beta version of this package. We would love for you to try these and share feedback with us before these features reach the stable phase. To install a beta version of stripe-go use the commit notation of the go get command to point to a beta tag:

go get -u github.com/stripe/stripe-go/[email protected]

Note There can be breaking changes between beta versions.

We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version.

If your beta feature requires a Stripe-Version header to be sent, set the stripe.APIVersion field using the stripe.AddBetaVersion function to set it:

Note The APIVersion can only be set in beta versions of the library.

stripe.AddBetaVersion("feature_beta", "v3")

Support

New features and bug fixes are released on the latest major version of the Stripe Go client library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.

Development

Pull requests from the community are welcome. If you submit one, please keep the following guidelines in mind:

  1. Code must be go fmt compliant.
  2. All types, structs and funcs should be documented.
  3. Ensure that make test succeeds.

Test

The test suite needs testify's require package to run:

github.com/stretchr/testify/require

Before running the tests, make sure to grab all of the package's dependencies:

go get -t -v

It also depends on stripe-mock, so make sure to fetch and run it from a background terminal (stripe-mock's README also contains instructions for installing via Homebrew and other methods):

go get -u github.com/stripe/stripe-mock
stripe-mock

Run all tests:

make test

Run tests for one package:

go test ./invoice

Run a single test:

go test ./invoice -run TestInvoiceGet

For any requests, bug or comments, please open an issue or submit a pull request.

react-connect-js's People

Contributors

bkirk-stripe avatar derekm-stripe avatar dhiggins-stripe avatar hliana-stripe avatar jojo-stripe avatar jorgea-stripe avatar kaiying-stripe avatar mertindervish avatar michaelphines-stripe avatar mxl-stripe avatar slye-stripe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-connect-js's Issues

ConnectPayments not showing billing address when evidence submitted through API

I'm listening to Dispute events from Stripe using a webhook, and updating the dispute with evidence using the API. The evidence payload has a billing_address key.
Screenshot 2024-04-16 at 5 27 13 PM

When I load a dispute I have updated this way using the ConnectPayments component from stripe/react-connect-js to review the evidence and submit it to the bank, the billing address is not populated.
Screenshot 2024-04-16 at 5 30 19 PM

I do see an update succeed in the API logs in the Stripe Dashboard (payments page for this transaction)
Screenshot 2024-04-16 at 5 31 52 PM
Screenshot 2024-04-16 at 5 32 11 PM

Creating a disputed transaction and not submitting evidence for it loads the dispute review modal from ConnectPayments with the address details filled in:
Screenshot 2024-04-16 at 5 34 15 PM

I'm not sure what I'm missing here - is my billing_address string improperly formatted?

Edit Section Turns White and Invisible When Using ConnectAccountOnboarding with Tailwind CSS

Node Version

18.17.0

NPM Version

10.5.0

What OS are you seeing the problem on?

Mac

Stripe Version

1.19.4

Description

When using the ConnectAccountOnboarding component with Tailwind CSS, the Edit section becomes entirely white and the content is no longer visible. Removing all Tailwind settings, including those from the parent component, did not resolve the issue. The problem persists in this error state.

Steps to Reproduce

  1. Implement ConnectAccountOnboarding component in a project with Tailwind CSS.
  2. Navigate to the Edit section of the component.
  3. Observe that the section turns white and content is not visible.

Expected Behavior

The Edit section should be visible and function correctly without any display issues.

Actual Behavior

The Edit section becomes completely white, making the content invisible, even after removing Tailwind CSS configurations.

Additional Information

This is the code.

<ConnectComponentsProvider
  connectInstance={stripeConnectInstance}
>
  <ConnectAccountOnboarding
    onExit={() => setOnboardingExited(true)}
  />
</ConnectComponentsProvider>

There is no Edit that should exist.
Screenshot 2024-04-30 at 21 42 50

Could anyone provide insights or solutions to this issue?

ConnectPaymentDetails does not support visible prop

I see in your examples, and even in the documentation, you pass a visible prop, but the component doesn't accept it. Even if I try to wrap a piece of state around the component, toggle visibility using some onClick handler, then set the state to false using the onClose handler provided by the ConnectPaymentDetails component, the payment details popup doesn't disappear. ie. I don't see any way to close the component once its open.

image

Unable to import components in v2.0.3

Hello

How to use v2? I am trying to update from v1.4.0 to v2.0.3 but I unable to import components.

My code:

import {
  ConnectComponentsProvider,
  ConnectPayments,
  ConnectPayouts
} from '@stripe/react-connect-js';

Errors:

webpack compiled with 2 errors
ERROR in src/<...>/StripeConnect.tsx:6:3
TS2305: Module '"@stripe/react-connect-js"' has no exported member 'ConnectPayments'.
    4 | import {
    5 |   ConnectComponentsProvider,
  > 6 |   ConnectPayments,
      |   ^^^^^^^^^^^^^^^
    7 |   ConnectPayouts
    8 | } from '@stripe/react-connect-js';

ERROR in src/<...>/StripeConnect.tsx:7:3
TS2305: Module '"@stripe/react-connect-js"' has no exported member 'ConnectPayouts'.
     5 |   ConnectComponentsProvider,
     6 |   ConnectPayments,
  >  7 |   ConnectPayouts
       |   ^^^^^^^^^^^^^^
     8 | } from '@stripe/react-connect-js';

Embedded Onboarding Popup Blocked

I've been following the tutorial for setting up Onboarding with Stripe Connect https://docs.stripe.com/connect/onboarding/quickstart#init-stripe

I have everything set up, and the iFrame that contains the button to "Add Information" displays on the page, but once i click it, i get a Console Error saying the following:

AccountOnboarding.tsx:133 Uncaught (in promise) SubmerchantAuthError: Popup is blocked by browser.
    at SubmerchantAuthenticationContext.tsx:436:18
    at new Promise (<anonymous>)
    at SubmerchantAuthenticationContext.tsx:431:14
    at SubmerchantAuthenticationContext.tsx:452:14
    at async SubmerchantAuthenticationContext.tsx:580:17

Even so, a popup does indeed open (definitely wasn't blocked) but shows just a loading indicator.

I dug into the code a bit and the issue seems to occur because the call from window.open in the Stripe connect library returns null. And the error message saying "Popup blocked" happens if the result from that call is null. I know this can be a problem with window.open when not initiated directly by a user, but i don't see anyone else having this problem with Stripe and React.

Here is my code for this.. perhaps I'm doing something subtly wrong, even though I followed the tutorial:

const createAccountSession = async (accountId: string) => {
  const { data } = await api.post("/payments/sessions", { account: accountId })
  return data
}

const useCreateAccountSession = () => useMutation({
  mutationFn: (accountId: string) => createAccountSession(accountId)
})

const useStripeConnect = (accountId: string) => {
  const { mutate, data, isPending, isError, isSuccess } = useCreateAccountSession()
  const [stripeConnectInstance, setStripeConnectInstance] = useState<StripeConnectInstance>()

  useEffect(() => {
    if (data) {
      setStripeConnectInstance(
        loadConnectAndInitialize({
          publishableKey: import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY,
          fetchClientSecret: () => data.clientSecret,
          appearance: {
            overlays: "dialog",
            variables: {
              colorPrimary: "#635BFF",
            },
          },
        })
      );
    } else {
      mutate(accountId)
    }
  }, [data])

  return stripeConnectInstance;
};

const OnboardSeller = ({ accountId }: OnboardSellerProps) => {

  const stripeConnectInstance = useStripeConnect(accountId)
  const [onboardingExited, setOnboardingExited] = useState(false)

  return (
    <>
      {stripeConnectInstance && (
        <ConnectComponentsProvider connectInstance={stripeConnectInstance}>
          <ConnectAccountOnboarding
            onExit={() => setOnboardingExited(true)}
          />
        </ConnectComponentsProvider>
      )}
    </>
  )
}

This happens in all browsers and for all test users I've created.

Error with <ConnectAccountOnboarding> in 1.3.1

I have the following error when trying to display the ConnectAccountOnboarding in 1.3.1,

react-connect.esm.js:89 Uncaught TypeError: Cannot read properties of null (reading 'create')
    at react-connect.esm.js:89:1
    at commitHookEffectListMount (react-dom.development.js:20042:1)
    at invokeLayoutEffectMountInDEV (react-dom.development.js:21702:1)
    at invokeEffectsInDev (react-dom.development.js:23630:1)
    at commitDoubleInvokeEffectsInDEV (react-dom.development.js:23611:1)
    at flushPassiveEffectsImpl (react-dom.development.js:23386:1)
    at flushPassiveEffects (react-dom.development.js:23324:1)
    at performSyncWorkOnRoot (react-dom.development.js:22541:1)
    at flushSyncCallbacks (react-dom.development.js:10573:1)
    at commitRootImpl (react-dom.development.js:23303:1)
The above error occurred in the <ConnectAccountOnboarding> component:
    at ConnectAccountOnboarding (http://localhost:3000/static/js/bundle.js:77277:34)
    at ConnectComponentsProvider (http://localhost:3000/static/js/bundle.js:77183:30)
    at div
    ..... flows onto our code

1.2.0 works fine :)

Onboarding Component suddenly requires opening a new window to gather information

I had the onboarding component working perfectly with our implementation, with the form showing as an iframe right in our website (as expected), but now all of a sudden I'm not getting the form anymore.

Instead I'm getting this button to "Add information", and when clicked, it opens the form in a new window, completely unstyled (and I'm not even sure that it's the right form):

add_information_button

onboarding_form_in_new_window

Nothing has changed in our implementation since it was working a couple weeks ago. I've tried downgrading to different versions of @stripe/connect-js and @stripe/react-connect-js with no luck, same issue regardless of version, which makes me wonder if there's been a change to the iframe that's being loaded in server-side.

This is our code, which is based on the example in the Stripe documentation:

const StripePayoutOnboarding: React.FC<StripePayoutOnboardingProps> = (props) => {

    const { UserSettings } = React.useContext(UserSettingsContext);

    const [stripeConnectInstance] = React.useState(() => {
        const fetchClientSecret = async () => {
          // Fetch the AccountSession client secret
          const response = await fetch(`http://iroomit.gogudanetwork.com:3000/payments/connected/getAccountSession`, {
              method: 'POST',
              headers: {
                'content-type': 'application/json'
              },
              body: JSON.stringify({
                session: UserSettings.sessionId
              })
            });
          if (!response.ok) {
            // Handle errors on the client side here
            const {error} = await response.json();
            console.log('An error occurred: ', error);
            return undefined;
          } else {
            const token = await response.text();
            console.log(token);
            return token;
          }
        }
        return loadConnectAndInitialize({
            // This is your test publishable API key.
            publishableKey: process.env.NEXT_PUBLIC_STRIPE_API_KEY,
            fetchClientSecret: fetchClientSecret,
            
            appearance: {
              overlays: 'dialog',
              variables: {
                spacingUnit: '12px',
                colorPrimary: '#000000',
                borderRadius: '4px',
                formHighlightColorBorder: '#000000',
                colorBorder: '#a0a0a0',
                buttonPrimaryColorBackground: Colors.primary,
                buttonPrimaryColorBorder: Colors.primary,
                actionPrimaryColorText: Colors.primary,
                formAccentColor: Colors.primary
              },
            },
          })
        });
    
      return (
              <ConnectComponentsProvider connectInstance={stripeConnectInstance}>
                <ConnectAccountOnboarding onExit={() => {
                    stripeConnectInstance.logout();
                    props.onExit?.();
                }}/>
              </ConnectComponentsProvider>

      )
}

And I've made sure the client_secret sent back from the server is valid too:

export function getConnectedAccountSession(accId: string) {
  return stripe.accountSessions.create({account: accId, components: {
    payments: {
      enabled: true
    },
    payouts: {
      enabled: true
    },
    account_onboarding: {
      enabled: true
    }
  }
  });
}

Again nothing has changed on our end and it was working fine before, which I find very strange. Tested in both Firefox and Chrome with the same results. Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.