Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Stripe App without UI #867

Open
Steven4294 opened this issue Jul 8, 2023 · 5 comments
Open

Create Stripe App without UI #867

Steven4294 opened this issue Jul 8, 2023 · 5 comments
Labels
app-platform docs enhancement "It would work better if..."

Comments

@Steven4294
Copy link

We are trying to create a Stripe app that does not have a UI. All the documentation which I've looked at assumes a UI (even the authentication flows).

It is unclear what we should do for a non-UI app & how we get the acct_xxxx values out to pull data out of Stripe. Additionally, it would be very helpful if there was some documentation or example code on an app that purely grabs the required auth info out of Stripe and nothing more.

Should we create an app that has a blank drawer screen? It's unclear to me if that would even get through the app review process.

Best,

Steven

@bmhatfield
Copy link

Bump - also stuck on trying to figure out how to provision OAuth Apps/Links without UI components.

Stripping down the manifest doesn't seem to work:

[bhatfield app]% stripe apps upload  --log-level debug
[Tue, 25 Jul 2023 18:16:29 EDT] DEBUG config.Config.InitConfig: Using profiles file path=/Users/bhatfield/.config/stripe/config.toml
[Tue, 25 Jul 2023 18:16:29 EDT] DEBUG config.Config.GetProfilesFolder: Using profiles file path=/Users/bhatfield/.config/stripe
[Tue, 25 Jul 2023 18:16:29 EDT] DEBUG cmd.pluginCmd.runPluginCmd: Running plugin...
[Tue, 25 Jul 2023 18:16:29 EDT] DEBUG config.Config.GetProfilesFolder: Using profiles file path=/Users/bhatfield/.config/stripe
[Tue, 25 Jul 2023 18:16:29 EDT] DEBUG config.Config.GetProfilesFolder: Using profiles file path=/Users/bhatfield/.config/stripe
[Tue, 25 Jul 2023 18:16:29 EDT] DEBUG plugins.plugin.Run: negotiated gRPC with plugin process

⬆ You are about to upload your app to [REDACTED]

Name:    [REDACTED]
ID:      [REDACTED]
Version: 0.0.1

Would you like to proceed: Y
Would you like to proceed: Y
2023-07-25T18:16:35.715-0400 [ERROR] plugin.child.apps: plugin process exited: path=/Users/bhatfield/.config/stripe/plugins/apps/1.5.10/stripe-cli-apps pid=46436 error="exit status 2"
[Tue, 25 Jul 2023 18:16:35 EDT] DEBUG Tearing down plugin before exit
[Tue, 25 Jul 2023 18:16:35 EDT] DEBUG pluginTemplateCmd.runPluginCmd: Plugin command 'apps' exited with error: rpc error: code = Unavailable desc = error reading from server: EOF
{
  "id": "[REDACTED]",
  "version": "0.0.1",
  "name": "[REDACTED]",
  "icon": "",
  "permissions": [],
  "ui_extension": {
    "views": null,
    "content_security_policy": null
  }
}

@svenugopal-stripe
Copy link
Contributor

to get the upload succeed without any views could you please try ?

"ui_extension": {
    "views": [],
    "content_security_policy": {}
 }

@bmhatfield
Copy link

bmhatfield commented Jul 26, 2023

Thank you for your response - working with just a bare manifest in the directory, here's what happens when I attempt that upload:

[bhatfield app]% stripe apps upload  --log-level debug
[Wed, 26 Jul 2023 11:11:59 EDT] DEBUG config.Config.InitConfig: Using profiles file path=/Users/bhatfield/.config/stripe/config.toml
[Wed, 26 Jul 2023 11:11:59 EDT] DEBUG config.Config.GetProfilesFolder: Using profiles file path=/Users/bhatfield/.config/stripe
[Wed, 26 Jul 2023 11:11:59 EDT] DEBUG cmd.pluginCmd.runPluginCmd: Running plugin...
[Wed, 26 Jul 2023 11:11:59 EDT] DEBUG config.Config.GetProfilesFolder: Using profiles file path=/Users/bhatfield/.config/stripe
[Wed, 26 Jul 2023 11:11:59 EDT] DEBUG config.Config.GetProfilesFolder: Using profiles file path=/Users/bhatfield/.config/stripe
[Wed, 26 Jul 2023 11:11:59 EDT] DEBUG plugins.plugin.Run: negotiated gRPC with plugin process

⬆ You are about to upload your app to [REDACTED]

Name:    [REDACTED]
ID:      [REDACTED]
Version: 0.0.1

Would you like to proceed: Y
×  Failed to build files
✘ [ERROR] Could not resolve "@stripe/ui-extension-sdk/version"

    .build/manifest.js:4:14:
      4 │ export * from '@stripe/ui-extension-sdk/version';
        ╵               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@stripe/ui-extension-sdk/version" as external to exclude it from the bundle, which will remove this error.


[Wed, 26 Jul 2023 11:12:05 EDT] DEBUG Tearing down plugin before exit
[Wed, 26 Jul 2023 11:12:05 EDT] DEBUG pluginTemplateCmd.runPluginCmd: Plugin command 'apps' exited with error: rpc error: code = Unknown desc = ✘ [ERROR] Could not resolve "@stripe/ui-extension-sdk/version"

    .build/manifest.js:4:14:
      4 │ export * from '@stripe/ui-extension-sdk/version';
        ╵               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@stripe/ui-extension-sdk/version" as external to exclude it from the bundle, which will remove this error.

Please note that the upload attempt modifies the contents of stripe-app.json. See below:

Before:

{
  "id": "[REDACTED]",
  "version": "0.0.1",
  "name": "[REDACTED]",
  "icon": "",
  "permissions": [],
  "ui_extension": {
    "views": [],
    "content_security_policy": {}
  }
}

After:

{
  "id": "[REDACTED]",
  "version": "0.0.1",
  "name": "[REDACTED]",
  "icon": "",
  "permissions": [],
  "ui_extension": {
    "views": [],
    "content_security_policy": {
      "connect-src": null,
      "image-src": null,
      "purpose": ""
    }
  }
}

(edit: note also, prior to uploading I had removed the entire auto-created .build directory to ensure caching was not a concern)

@bmhatfield
Copy link

bmhatfield commented Jul 26, 2023

I was able to get the upload to succeed by removing the src/ directory from the autogenerated structure and uploading in that context instead:

drwxr-xr-x    6 bhatfield   192B Jul 26 11:37 .build/
drwxr-xr-x    6 bhatfield   192B Jul 26 11:10 .git/
-rw-r--r--    1 bhatfield   297B Jul 26 11:10 .gitignore
drwxr-xr-x    3 bhatfield    96B Jul 26 11:10 .vscode/
-rw-r--r--    1 bhatfield   217B Jul 26 11:10 jest.config.js
drwxr-xr-x  392 bhatfield    12K Jul 26 11:11 node_modules/
-rw-r--r--    1 bhatfield   293K Jul 26 11:11 package-lock.json
-rw-r--r--    1 bhatfield   592B Jul 26 11:11 package.json
-rwxr-xr-x    1 bhatfield   262B Jul 26 11:37 stripe-app.json*
-rw-r--r--    1 bhatfield    68B Jul 26 11:10 tsconfig.json
-rw-r--r--    1 bhatfield    53B Jul 26 11:10 ui-extensions.d.ts
[Wed, 26 Jul 2023 11:37:32 EDT] DEBUG config.Config.InitConfig: Using profiles file path=/Users/bhatfield/.config/stripe/config.toml
[Wed, 26 Jul 2023 11:37:32 EDT] DEBUG config.Config.GetProfilesFolder: Using profiles file path=/Users/bhatfield/.config/stripe
[Wed, 26 Jul 2023 11:37:32 EDT] DEBUG cmd.pluginCmd.runPluginCmd: Running plugin...
[Wed, 26 Jul 2023 11:37:32 EDT] DEBUG config.Config.GetProfilesFolder: Using profiles file path=/Users/bhatfield/.config/stripe
[Wed, 26 Jul 2023 11:37:32 EDT] DEBUG config.Config.GetProfilesFolder: Using profiles file path=/Users/bhatfield/.config/stripe
[Wed, 26 Jul 2023 11:37:32 EDT] DEBUG plugins.plugin.Run: negotiated gRPC with plugin process

⬆ You are about to upload your app to [REDACTED]

Name:    [REDACTED]
ID:      [REDACTED]
Version: 0.0.1

Would you like to proceed: Y
✔ Built files for production
✔ Packaged files for upload
✔ Uploaded [REDACTED]

Stripe need to process your files before this version can be installed.
🌐 To view the status on Stripe Dashboard, press enter.

[Wed, 26 Jul 2023 11:37:48 EDT] DEBUG Tearing down plugin before exit

This is with the same Before empty manifest as above.

Please note that my goal is a backend-only app without any Stripe UI modifications.

As a bit of user feedback, this is a lot of hoops to jump through for what is normally a "create OAuth App ID" button/screen in most other platforms.

@auchenberg-stripe auchenberg-stripe added enhancement "It would work better if..." app-platform and removed needs-triage labels Aug 4, 2023
@Ayan-Bandyopadhyay
Copy link

Running into this issue as well. I tried removing "ui_extension" from the manifest but the UI is still there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-platform docs enhancement "It would work better if..."
Projects
None yet
Development

No branches or pull requests

5 participants