@dodopayments/sveltekit 0.2.3 → 0.2.4
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/dist/index.cjs +22 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -3
package/dist/index.cjs
CHANGED
|
@@ -7259,6 +7259,13 @@ var checkoutSessionCustomizationSchema = objectType({
|
|
|
7259
7259
|
}).optional();
|
|
7260
7260
|
var checkoutSessionFeatureFlagsSchema = objectType({
|
|
7261
7261
|
allow_currency_selection: booleanType().optional(),
|
|
7262
|
+
allow_customer_editing_city: booleanType().optional(),
|
|
7263
|
+
allow_customer_editing_country: booleanType().optional(),
|
|
7264
|
+
allow_customer_editing_email: booleanType().optional(),
|
|
7265
|
+
allow_customer_editing_name: booleanType().optional(),
|
|
7266
|
+
allow_customer_editing_state: booleanType().optional(),
|
|
7267
|
+
allow_customer_editing_street: booleanType().optional(),
|
|
7268
|
+
allow_customer_editing_zipcode: booleanType().optional(),
|
|
7262
7269
|
allow_discount_code: booleanType().optional(),
|
|
7263
7270
|
allow_phone_number_collection: booleanType().optional(),
|
|
7264
7271
|
allow_tax_id: booleanType().optional(),
|
|
@@ -7359,7 +7366,11 @@ var buildCheckoutUrl = async ({
|
|
|
7359
7366
|
if (!sessionPayload) {
|
|
7360
7367
|
throw new Error("sessionPayload is required when type is 'session'");
|
|
7361
7368
|
}
|
|
7362
|
-
const
|
|
7369
|
+
const finalPayload = {
|
|
7370
|
+
...sessionPayload,
|
|
7371
|
+
return_url: sessionPayload.return_url ?? returnUrl
|
|
7372
|
+
};
|
|
7373
|
+
const session = await createCheckoutSession(finalPayload, {
|
|
7363
7374
|
bearerToken,
|
|
7364
7375
|
environment
|
|
7365
7376
|
});
|
|
@@ -7979,6 +7990,12 @@ var SubscriptionExpiredPayloadSchema = objectType({
|
|
|
7979
7990
|
timestamp: stringType().transform((d) => new Date(d)),
|
|
7980
7991
|
data: SubscriptionSchema
|
|
7981
7992
|
});
|
|
7993
|
+
var SubscriptionUpdatedPayloadSchema = objectType({
|
|
7994
|
+
business_id: stringType(),
|
|
7995
|
+
type: literalType("subscription.updated"),
|
|
7996
|
+
timestamp: stringType().transform((d) => new Date(d)),
|
|
7997
|
+
data: SubscriptionSchema
|
|
7998
|
+
});
|
|
7982
7999
|
var LicenseKeyCreatedPayloadSchema = objectType({
|
|
7983
8000
|
business_id: stringType(),
|
|
7984
8001
|
type: literalType("license_key.created"),
|
|
@@ -8007,6 +8024,7 @@ var WebhookPayloadSchema = discriminatedUnionType("type", [
|
|
|
8007
8024
|
SubscriptionCancelledPayloadSchema,
|
|
8008
8025
|
SubscriptionFailedPayloadSchema,
|
|
8009
8026
|
SubscriptionExpiredPayloadSchema,
|
|
8027
|
+
SubscriptionUpdatedPayloadSchema,
|
|
8010
8028
|
LicenseKeyCreatedPayloadSchema
|
|
8011
8029
|
]);
|
|
8012
8030
|
|
|
@@ -8081,6 +8099,9 @@ async function handleWebhookPayload(payload, config, context) {
|
|
|
8081
8099
|
if (payload.type === "subscription.expired") {
|
|
8082
8100
|
await callHandler(config.onSubscriptionExpired, payload);
|
|
8083
8101
|
}
|
|
8102
|
+
if (payload.type === "subscription.updated") {
|
|
8103
|
+
await callHandler(config.onSubscriptionUpdated, payload);
|
|
8104
|
+
}
|
|
8084
8105
|
if (payload.type === "license_key.created") {
|
|
8085
8106
|
await callHandler(config.onLicenseKeyCreated, payload);
|
|
8086
8107
|
}
|