@revstackhq/provider-stripe 0.0.0-20260207005540
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +38 -0
- package/assets/logo.svg +1 -0
- package/dist/logo.svg +1 -0
- package/dist/provider.d.ts +23 -0
- package/dist/provider.js +111 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
BUSINESS SOURCE LICENSE 1.1
|
|
2
|
+
|
|
3
|
+
The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make use of the Licensed Work for any purpose, except as limited by the Additional Use Grant below.
|
|
4
|
+
|
|
5
|
+
Redistribution is allowed only if this License is included with the Licensed Work and any derivative works.
|
|
6
|
+
|
|
7
|
+
ADDITIONAL USE GRANT:
|
|
8
|
+
|
|
9
|
+
You may make use of the Licensed Work, provided that you do not use the Licensed Work to provide a "Managed Payment Orchestration Service".
|
|
10
|
+
|
|
11
|
+
A "Managed Payment Orchestration Service" is defined as a commercial service, product, or offering where the Licensed Work is used to provide payment routing, checkout orchestration, or connection management to third parties as a service (SaaS, PaaS, or IaaS), whether for a fee or free of charge.
|
|
12
|
+
|
|
13
|
+
For clarity:
|
|
14
|
+
1. You MAY use the Licensed Work internally to process payments for your own business or merchandise.
|
|
15
|
+
2. You MAY NOT use the Licensed Work to build a competitor service to Revstack that allows your customers to orchestrate their own payments.
|
|
16
|
+
|
|
17
|
+
CHANGE DATE:
|
|
18
|
+
|
|
19
|
+
January 1, 2031
|
|
20
|
+
|
|
21
|
+
CHANGE LICENSE:
|
|
22
|
+
|
|
23
|
+
Apache License, Version 2.0
|
|
24
|
+
|
|
25
|
+
ERROR CORRECTIONS AND SECURITY UPDATES:
|
|
26
|
+
|
|
27
|
+
The Licensor may, at its option, provide error corrections and security updates to the Licensed Work. If the Licensor provides such error corrections and security updates, they are considered part of the Licensed Work and are subject to this License.
|
|
28
|
+
|
|
29
|
+
MANAGED SERVICE EXCEPTION:
|
|
30
|
+
|
|
31
|
+
If you have a separate written agreement with the Licensor (e.g., an Enterprise License) that specifically grants you the right to provide a Managed Payment Orchestration Service, that agreement supersedes the limitations of the Additional Use Grant.
|
|
32
|
+
|
|
33
|
+
*****************************************************************************
|
|
34
|
+
|
|
35
|
+
LICENSOR: Revstack Inc.
|
|
36
|
+
LICENSED WORK: The Revstack OS software and associated documentation.
|
|
37
|
+
|
|
38
|
+
*****************************************************************************
|
package/assets/logo.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="64" height="64" fill="#6772e5"><path d="M111.328 15.602c0-4.97-2.415-8.9-7.013-8.9s-7.423 3.924-7.423 8.863c0 5.85 3.32 8.8 8.036 8.8 2.318 0 4.06-.528 5.377-1.26V19.22a10.246 10.246 0 0 1-4.764 1.075c-1.9 0-3.556-.67-3.774-2.943h9.497a39.64 39.64 0 0 0 .063-1.748zm-9.606-1.835c0-2.186 1.35-3.1 2.56-3.1s2.454.906 2.454 3.1zM89.4 6.712a5.434 5.434 0 0 0-3.801 1.509l-.254-1.208h-4.27v22.64l4.85-1.032v-5.488a5.434 5.434 0 0 0 3.444 1.265c3.472 0 6.64-2.792 6.64-8.957.003-5.66-3.206-8.73-6.614-8.73zM88.23 20.1a2.898 2.898 0 0 1-2.288-.906l-.03-7.2a2.928 2.928 0 0 1 2.315-.96c1.775 0 2.998 2 2.998 4.528.003 2.593-1.198 4.546-2.995 4.546zM79.25.57l-4.87 1.035v3.95l4.87-1.032z" fill-rule="evenodd"/><path d="M74.38 7.035h4.87V24.04h-4.87z"/><path d="M69.164 8.47l-.302-1.434h-4.196V24.04h4.848V12.5c1.147-1.5 3.082-1.208 3.698-1.017V7.038c-.646-.232-2.913-.658-4.048 1.43zm-9.73-5.646L54.698 3.83l-.02 15.562c0 2.87 2.158 4.993 5.038 4.993 1.585 0 2.756-.302 3.405-.643v-3.95c-.622.248-3.683 1.138-3.683-1.72v-6.9h3.683V7.035h-3.683zM46.3 11.97c0-.758.63-1.05 1.648-1.05a10.868 10.868 0 0 1 4.83 1.25V7.6a12.815 12.815 0 0 0-4.83-.888c-3.924 0-6.557 2.056-6.557 5.488 0 5.37 7.375 4.498 7.375 6.813 0 .906-.78 1.186-1.863 1.186-1.606 0-3.68-.664-5.307-1.55v4.63a13.461 13.461 0 0 0 5.307 1.117c4.033 0 6.813-1.992 6.813-5.485 0-5.796-7.417-4.76-7.417-6.943zM13.88 9.515c0-1.37 1.14-1.9 2.982-1.9A19.661 19.661 0 0 1 25.6 9.876v-8.27A23.184 23.184 0 0 0 16.862.001C9.762.001 5 3.72 5 9.93c0 9.716 13.342 8.138 13.342 12.326 0 1.638-1.4 2.146-3.37 2.146-2.905 0-6.657-1.202-9.6-2.802v8.378A24.353 24.353 0 0 0 14.973 32C22.27 32 27.3 28.395 27.3 22.077c0-10.486-13.42-8.613-13.42-12.56z" fill-rule="evenodd"/></svg>
|
package/dist/logo.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="64" height="64" fill="#6772e5"><path d="M111.328 15.602c0-4.97-2.415-8.9-7.013-8.9s-7.423 3.924-7.423 8.863c0 5.85 3.32 8.8 8.036 8.8 2.318 0 4.06-.528 5.377-1.26V19.22a10.246 10.246 0 0 1-4.764 1.075c-1.9 0-3.556-.67-3.774-2.943h9.497a39.64 39.64 0 0 0 .063-1.748zm-9.606-1.835c0-2.186 1.35-3.1 2.56-3.1s2.454.906 2.454 3.1zM89.4 6.712a5.434 5.434 0 0 0-3.801 1.509l-.254-1.208h-4.27v22.64l4.85-1.032v-5.488a5.434 5.434 0 0 0 3.444 1.265c3.472 0 6.64-2.792 6.64-8.957.003-5.66-3.206-8.73-6.614-8.73zM88.23 20.1a2.898 2.898 0 0 1-2.288-.906l-.03-7.2a2.928 2.928 0 0 1 2.315-.96c1.775 0 2.998 2 2.998 4.528.003 2.593-1.198 4.546-2.995 4.546zM79.25.57l-4.87 1.035v3.95l4.87-1.032z" fill-rule="evenodd"/><path d="M74.38 7.035h4.87V24.04h-4.87z"/><path d="M69.164 8.47l-.302-1.434h-4.196V24.04h4.848V12.5c1.147-1.5 3.082-1.208 3.698-1.017V7.038c-.646-.232-2.913-.658-4.048 1.43zm-9.73-5.646L54.698 3.83l-.02 15.562c0 2.87 2.158 4.993 5.038 4.993 1.585 0 2.756-.302 3.405-.643v-3.95c-.622.248-3.683 1.138-3.683-1.72v-6.9h3.683V7.035h-3.683zM46.3 11.97c0-.758.63-1.05 1.648-1.05a10.868 10.868 0 0 1 4.83 1.25V7.6a12.815 12.815 0 0 0-4.83-.888c-3.924 0-6.557 2.056-6.557 5.488 0 5.37 7.375 4.498 7.375 6.813 0 .906-.78 1.186-1.863 1.186-1.606 0-3.68-.664-5.307-1.55v4.63a13.461 13.461 0 0 0 5.307 1.117c4.033 0 6.813-1.992 6.813-5.485 0-5.796-7.417-4.76-7.417-6.943zM13.88 9.515c0-1.37 1.14-1.9 2.982-1.9A19.661 19.661 0 0 1 25.6 9.876v-8.27A23.184 23.184 0 0 0 16.862.001C9.762.001 5 3.72 5 9.93c0 9.716 13.342 8.138 13.342 12.326 0 1.638-1.4 2.146-3.37 2.146-2.905 0-6.657-1.202-9.6-2.802v8.378A24.353 24.353 0 0 0 14.973 32C22.27 32 27.3 28.395 27.3 22.077c0-10.486-13.42-8.613-13.42-12.56z" fill-rule="evenodd"/></svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ProviderManifest, BaseProvider, ProviderContext, InstallInput, InstallResult, RevstackEvent, WebhookResponse, CreatePaymentInput, PaymentResult, CreateSubscriptionInput, SubscriptionResult, CheckoutSessionInput, CheckoutSessionResult } from '@revstackhq/providers-core';
|
|
2
|
+
|
|
3
|
+
declare const manifest: ProviderManifest;
|
|
4
|
+
|
|
5
|
+
declare class StripeProvider extends BaseProvider {
|
|
6
|
+
static manifest: ProviderManifest;
|
|
7
|
+
manifest: ProviderManifest;
|
|
8
|
+
onInstall(ctx: ProviderContext, input: InstallInput): Promise<InstallResult>;
|
|
9
|
+
verifyWebhookSignature(payload: string | Buffer, headers: Record<string, string | string[] | undefined>, secret: string): Promise<boolean>;
|
|
10
|
+
parseWebhookEvent(payload: any): Promise<RevstackEvent | null>;
|
|
11
|
+
getWebhookResponse(): Promise<WebhookResponse>;
|
|
12
|
+
createPayment(ctx: ProviderContext, input: CreatePaymentInput): Promise<PaymentResult>;
|
|
13
|
+
getPayment(ctx: ProviderContext, id: string): Promise<PaymentResult>;
|
|
14
|
+
createSubscription(ctx: ProviderContext, input: CreateSubscriptionInput): Promise<SubscriptionResult>;
|
|
15
|
+
cancelSubscription(ctx: ProviderContext, id: string, reason?: string): Promise<SubscriptionResult>;
|
|
16
|
+
pauseSubscription(ctx: ProviderContext, id: string, reason?: string): Promise<SubscriptionResult>;
|
|
17
|
+
resumeSubscription(ctx: ProviderContext, id: string, reason?: string): Promise<SubscriptionResult>;
|
|
18
|
+
createCheckoutSession(ctx: ProviderContext, input: CheckoutSessionInput): Promise<CheckoutSessionResult>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare const DefaultProvider: typeof StripeProvider;
|
|
22
|
+
|
|
23
|
+
export { DefaultProvider, StripeProvider, manifest };
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// src/manifest.ts
|
|
2
|
+
import { ProviderCategory } from "@revstackhq/providers-core";
|
|
3
|
+
var manifest = {
|
|
4
|
+
name: "Stripe",
|
|
5
|
+
slug: "stripe",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
logoUrl: "https://cdn.jsdelivr.net/npm/@revstackhq/provider-stripe/assets/logo.svg",
|
|
8
|
+
category: ProviderCategory.Card,
|
|
9
|
+
capabilities: {
|
|
10
|
+
checkout: {
|
|
11
|
+
supported: true,
|
|
12
|
+
strategy: "redirect"
|
|
13
|
+
},
|
|
14
|
+
payments: {
|
|
15
|
+
supported: true,
|
|
16
|
+
features: {
|
|
17
|
+
capture: false,
|
|
18
|
+
disputes: true,
|
|
19
|
+
partialRefunds: true,
|
|
20
|
+
refunds: true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
subscriptions: {
|
|
24
|
+
supported: true,
|
|
25
|
+
mode: "native",
|
|
26
|
+
features: {
|
|
27
|
+
cancellation: true,
|
|
28
|
+
pause: true,
|
|
29
|
+
resume: true,
|
|
30
|
+
proration: true
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
webhooks: {
|
|
34
|
+
supported: true,
|
|
35
|
+
verification: "signature"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
author: "Revstack",
|
|
39
|
+
currencies: ["USD"],
|
|
40
|
+
description: "Stripe is a payment processing platform that enables businesses to accept payments online. It provides a secure and convenient way for customers to pay for goods or services using various payment methods, including credit cards, bank transfers, and digital wallets.",
|
|
41
|
+
documentationUrl: "https://docs.revstack.dev/providers/stripe",
|
|
42
|
+
regions: ["*"],
|
|
43
|
+
sandboxAvailable: true,
|
|
44
|
+
supportUrl: "https://docs.revstack.dev/providers/stripe#support",
|
|
45
|
+
configSchema: {
|
|
46
|
+
apiKey: {
|
|
47
|
+
label: "Secret Key",
|
|
48
|
+
type: "password",
|
|
49
|
+
secure: true,
|
|
50
|
+
required: true
|
|
51
|
+
},
|
|
52
|
+
webhookSecret: {
|
|
53
|
+
label: "Webhook Signing Secret",
|
|
54
|
+
type: "password",
|
|
55
|
+
secure: true,
|
|
56
|
+
required: false,
|
|
57
|
+
description: "Fill this if you have configured a custom webhook secret. Otherwise, it will be autogenerated."
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// src/provider.ts
|
|
63
|
+
import {
|
|
64
|
+
BaseProvider
|
|
65
|
+
} from "@revstackhq/providers-core";
|
|
66
|
+
var StripeProvider = class extends BaseProvider {
|
|
67
|
+
static manifest = manifest;
|
|
68
|
+
manifest = manifest;
|
|
69
|
+
onInstall(ctx, input) {
|
|
70
|
+
console.log(input.webhookUrl);
|
|
71
|
+
throw new Error("Method not implemented.");
|
|
72
|
+
}
|
|
73
|
+
verifyWebhookSignature(payload, headers, secret) {
|
|
74
|
+
throw new Error("Method not implemented.");
|
|
75
|
+
}
|
|
76
|
+
parseWebhookEvent(payload) {
|
|
77
|
+
throw new Error("Method not implemented.");
|
|
78
|
+
}
|
|
79
|
+
getWebhookResponse() {
|
|
80
|
+
throw new Error("Method not implemented.");
|
|
81
|
+
}
|
|
82
|
+
createPayment(ctx, input) {
|
|
83
|
+
throw new Error("Method not implemented.");
|
|
84
|
+
}
|
|
85
|
+
getPayment(ctx, id) {
|
|
86
|
+
throw new Error("Method not implemented.");
|
|
87
|
+
}
|
|
88
|
+
createSubscription(ctx, input) {
|
|
89
|
+
throw new Error("Method not implemented.");
|
|
90
|
+
}
|
|
91
|
+
cancelSubscription(ctx, id, reason) {
|
|
92
|
+
throw new Error("Method not implemented.");
|
|
93
|
+
}
|
|
94
|
+
pauseSubscription(ctx, id, reason) {
|
|
95
|
+
throw new Error("Method not implemented.");
|
|
96
|
+
}
|
|
97
|
+
resumeSubscription(ctx, id, reason) {
|
|
98
|
+
throw new Error("Method not implemented.");
|
|
99
|
+
}
|
|
100
|
+
createCheckoutSession(ctx, input) {
|
|
101
|
+
throw new Error("Method not implemented.");
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// src/index.ts
|
|
106
|
+
var DefaultProvider = StripeProvider;
|
|
107
|
+
export {
|
|
108
|
+
DefaultProvider,
|
|
109
|
+
StripeProvider,
|
|
110
|
+
manifest
|
|
111
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@revstackhq/provider-stripe",
|
|
3
|
+
"version": "0.0.0-20260207005540",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/provider.js",
|
|
7
|
+
"types": "./dist/provider.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/provider.d.ts",
|
|
11
|
+
"import": "./dist/provider.js",
|
|
12
|
+
"default": "./dist/provider.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"assets"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@revstackhq/providers-core": "0.2.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "5.9.2",
|
|
24
|
+
"tsup": "^8.1.0",
|
|
25
|
+
"eslint": "^9.39.1",
|
|
26
|
+
"@eslint/js": "^9.39.1",
|
|
27
|
+
"typescript-eslint": "^8.50.0",
|
|
28
|
+
"eslint-config-prettier": "^10.1.1",
|
|
29
|
+
"eslint-plugin-turbo": "^2.7.1",
|
|
30
|
+
"@types/node": "^20.11.30",
|
|
31
|
+
"@revstackhq/eslint-config": "0.0.0"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsup src/index.ts --format esm --dts --clean --publicDir assets --entry.provider src/index.ts",
|
|
38
|
+
"check-types": "tsc -p tsconfig.json --noEmit",
|
|
39
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\""
|
|
40
|
+
}
|
|
41
|
+
}
|