@stacksjs/payments 0.75.538 → 0.75.541

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.
@@ -1,4 +1,4 @@
1
- import type { ChargeOptions, CheckoutRequest, CheckoutSession, CreatePaymentOptions, Customer, Money, Payer, PaymentDriver, PaymentEvent, PaymentResult, PaymentStatus, RefundOptions, RefundResult, StoredPaymentMethod, WebhookRequest } from './types';
1
+ import type { ChargeOptions, CheckoutRequest, CheckoutSession, CreatePaymentOptions, Customer, Money, Payer, PaymentDriver, PaymentEvent, PaymentOperation, PaymentResult, PaymentStatus, RefundOptions, RefundResult, StoredPaymentMethod, WebhookRequest } from './types';
2
2
  /**
3
3
  * Adyen's `resultCode` in our terms. Only `Authorised`, `Refused`, `Error`
4
4
  * and `Cancelled` are final; everything else waits on the payer or a webhook.
@@ -12,6 +12,7 @@ export declare function adyenSigningPayload(item: NotificationItem): string;
12
12
  /** HMAC-SHA256 of the signing payload under the hex key, base64. */
13
13
  export declare function adyenSignature(item: NotificationItem, hmacKey: string): string;
14
14
  export declare const ADYEN_API_VERSION: 'v72';
15
+ declare const CAPABILITIES: ReadonlySet<PaymentOperation>;
15
16
  /**
16
17
  * The Adyen driver (stacksjs/stacks#450), on Checkout API v72.
17
18
  *
@@ -48,7 +49,7 @@ declare interface NotificationItem {
48
49
  export declare class AdyenDriver implements PaymentDriver {
49
50
  /** @defaultValue 'adyen' */
50
51
  readonly name: string;
51
- readonly capabilities: unknown;
52
+ readonly capabilities: typeof CAPABILITIES;
52
53
  private config;
53
54
  private fetch;
54
55
  constructor(config: AdyenConfig, options?: { fetch?: typeof fetch });
@@ -1,9 +1,10 @@
1
- import type { CheckoutRequest, CheckoutSession, Customer, Payer, PaymentDriver, PaymentEvent, PaymentResult, RefundOptions, RefundResult, StoredPaymentMethod, SubscriptionSummary, WebhookRequest } from './types';
1
+ import type { CheckoutRequest, CheckoutSession, Customer, Payer, PaymentDriver, PaymentEvent, PaymentOperation, PaymentResult, RefundOptions, RefundResult, StoredPaymentMethod, SubscriptionSummary, WebhookRequest } from './types';
2
2
  /** A Lemon Squeezy subscription in our terms. */
3
3
  export declare function summarizeLemonSqueezySubscription(subscription: Resource<SubscriptionAttributes>): SubscriptionSummary;
4
4
  /** HMAC-SHA256 of the raw body under the webhook's signing secret, hex: Lemon Squeezy's `X-Signature`. */
5
5
  export declare function lemonSqueezySignature(payload: string, secret: string): string;
6
6
  export declare const LEMONSQUEEZY_API_URL: 'https://api.lemonsqueezy.com/v1';
7
+ declare const CAPABILITIES: ReadonlySet<PaymentOperation>;
7
8
  /**
8
9
  * The Lemon Squeezy driver (stacksjs/stacks#536), on API v1.
9
10
  *
@@ -53,7 +54,7 @@ declare interface SubscriptionAttributes {
53
54
  export declare class LemonSqueezyDriver implements PaymentDriver {
54
55
  /** @defaultValue 'lemonsqueezy' */
55
56
  readonly name: string;
56
- readonly capabilities: unknown;
57
+ readonly capabilities: typeof CAPABILITIES;
57
58
  private config;
58
59
  private fetch;
59
60
  private storeCurrency;
@@ -1,4 +1,4 @@
1
- import type { CheckoutRequest, CheckoutSession, CreatePaymentOptions, Customer, Money, Payer, PaymentDriver, PaymentEvent, PaymentResult, RefundOptions, RefundResult, RefundStatus, StoredPaymentMethod, SubscriptionSummary, WebhookRequest } from './types';
1
+ import type { CheckoutRequest, CheckoutSession, CreatePaymentOptions, Customer, Money, Payer, PaymentDriver, PaymentEvent, PaymentOperation, PaymentResult, RefundOptions, RefundResult, RefundStatus, StoredPaymentMethod, SubscriptionSummary, WebhookRequest } from './types';
2
2
  /** A Paddle adjustment's status in our terms. */
3
3
  export declare function paddleRefundStatus(status: string | undefined): RefundStatus;
4
4
  /** A Paddle subscription in our terms. */
@@ -11,6 +11,7 @@ export declare function parsePaddleSignature(header: string): { timestamp: numbe
11
11
  /** HMAC-SHA256 of `<ts>:<raw body>` under the secret key, hex, as Paddle signs a webhook. */
12
12
  export declare function paddleSignature(timestamp: number, payload: string, secret: string): string;
13
13
  export declare const PADDLE_API_VERSION: '1';
14
+ declare const CAPABILITIES: ReadonlySet<PaymentOperation>;
14
15
  /** The transaction custom_data key the checkout page reads its success page from. */
15
16
  export declare const PADDLE_SUCCESS_URL_KEY: 'stacks_success_url';
16
17
  /**
@@ -62,7 +63,7 @@ declare interface PaddleSubscription {
62
63
  export declare class PaddleDriver implements PaymentDriver {
63
64
  /** @defaultValue 'paddle' */
64
65
  readonly name: string;
65
- readonly capabilities: unknown;
66
+ readonly capabilities: typeof CAPABILITIES;
66
67
  private config;
67
68
  private fetch;
68
69
  private now;
@@ -1,4 +1,4 @@
1
- import type { ChargeOptions, CheckoutRequest, CheckoutSession, CreatePaymentOptions, Customer, Money, Payer, PaymentDriver, PaymentEvent, PaymentResult, PaymentStatus, RefundOptions, RefundResult, StoredPaymentMethod, SubscriptionSummary, WebhookRequest } from './types';
1
+ import type { ChargeOptions, CheckoutRequest, CheckoutSession, CreatePaymentOptions, Customer, Money, Payer, PaymentDriver, PaymentEvent, PaymentOperation, PaymentResult, PaymentStatus, RefundOptions, RefundResult, StoredPaymentMethod, SubscriptionSummary, WebhookRequest } from './types';
2
2
  import type Stripe from 'stripe';
3
3
  /**
4
4
  * A PaymentIntent's status in our terms. `requires_capture` is authorised but
@@ -24,6 +24,7 @@ export declare function subscriptionPeriodEnd(subscription: Stripe.Subscription)
24
24
  export declare function summarizeSubscription(subscription: Stripe.Subscription): SubscriptionSummary;
25
25
  /** A Stripe PaymentMethod in our terms. */
26
26
  export declare function toStoredPaymentMethod(method: Stripe.PaymentMethod, defaultId?: string | null): StoredPaymentMethod;
27
+ declare const CAPABILITIES: ReadonlySet<PaymentOperation>;
27
28
  /**
28
29
  * The Stripe calls the driver needs, separated from the mapping so the mapping
29
30
  * is testable without Stripe. The defaults delegate to the billable modules
@@ -50,7 +51,7 @@ export declare interface StripeDriverOptions {
50
51
  export declare class StripeDriver implements PaymentDriver {
51
52
  /** @defaultValue 'stripe' */
52
53
  readonly name: string;
53
- readonly capabilities: unknown;
54
+ readonly capabilities: typeof CAPABILITIES;
54
55
  private ops;
55
56
  private webhookSecret;
56
57
  private webhookTolerance;
@@ -68,3 +69,4 @@ export declare class StripeDriver implements PaymentDriver {
68
69
  verifyWebhook(request: WebhookRequest): Promise<PaymentEvent[]>;
69
70
  acknowledgeWebhook(): Response;
70
71
  }
72
+ export {};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/payments",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.538",
5
+ "version": "0.75.541",
6
6
  "description": "The Stacks payments package. Currently supporting Stripe.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -60,12 +60,12 @@
60
60
  "prepublishOnly": "bun run build"
61
61
  },
62
62
  "dependencies": {
63
- "@stacksjs/config": "0.75.538",
64
- "@stacksjs/database": "0.75.538",
65
- "@stacksjs/error-handling": "0.75.538",
66
- "@stacksjs/logging": "0.75.538",
67
- "@stacksjs/orm": "0.75.538",
68
- "@stacksjs/types": "0.75.538"
63
+ "@stacksjs/config": "0.75.541",
64
+ "@stacksjs/database": "0.75.541",
65
+ "@stacksjs/error-handling": "0.75.541",
66
+ "@stacksjs/logging": "0.75.541",
67
+ "@stacksjs/orm": "0.75.541",
68
+ "@stacksjs/types": "0.75.541"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "@stripe/stripe-js": "^10.0.0",
@@ -80,7 +80,7 @@
80
80
  }
81
81
  },
82
82
  "devDependencies": {
83
- "@stacksjs/utils": "0.75.538",
83
+ "@stacksjs/utils": "0.75.541",
84
84
  "@stripe/stripe-js": "^10.0.0",
85
85
  "better-dx": "^0.2.24",
86
86
  "stripe": "23.0.0"