Skip to content

Commit f7d9c4f

Browse files
committed
fix(revenuecat): keep productId subblock for refund op to preserve backwards compat
1 parent 7a6e56c commit f7d9c4f

2 files changed

Lines changed: 24 additions & 21 deletions

File tree

apps/sim/app/(landing)/integrations/data/integrations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14173,7 +14173,7 @@
1417314173
"description": "Hire a pre-hire into an employee position. Converts an applicant into an active employee record with position, start date, and manager assignment."
1417414174
},
1417514175
{
14176-
"name": "Update Worker",
14176+
"name": "Update Personal Information",
1417714177
"description": "Update fields on an existing worker record in Workday."
1417814178
},
1417914179
{

apps/sim/blocks/blocks/revenuecat.ts

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -147,30 +147,27 @@ Return ONLY the numeric timestamp, no text.`,
147147
},
148148
{
149149
id: 'productId',
150-
title: 'Product ID',
150+
title: 'Product ID / Store Transaction ID',
151151
type: 'short-input',
152-
placeholder: 'Product identifier',
152+
placeholder:
153+
'Product ID, or store transaction ID for refunds (e.g., GPA.3309-9122-6177-45730)',
153154
condition: {
154155
field: 'operation',
155-
value: ['create_purchase', 'defer_google_subscription', 'revoke_google_subscription'],
156+
value: [
157+
'create_purchase',
158+
'defer_google_subscription',
159+
'refund_google_subscription',
160+
'revoke_google_subscription',
161+
],
156162
},
157163
required: {
158164
field: 'operation',
159-
value: ['create_purchase', 'defer_google_subscription', 'revoke_google_subscription'],
160-
},
161-
},
162-
{
163-
id: 'storeTransactionId',
164-
title: 'Store Transaction ID',
165-
type: 'short-input',
166-
placeholder: 'e.g., GPA.3309-9122-6177-45730',
167-
condition: {
168-
field: 'operation',
169-
value: 'refund_google_subscription',
170-
},
171-
required: {
172-
field: 'operation',
173-
value: 'refund_google_subscription',
165+
value: [
166+
'create_purchase',
167+
'defer_google_subscription',
168+
'refund_google_subscription',
169+
'revoke_google_subscription',
170+
],
174171
},
175172
},
176173
{
@@ -356,6 +353,10 @@ Return ONLY the numeric timestamp, no text.`,
356353
next.platform = params.purchasePlatform
357354
}
358355
next.purchasePlatform = undefined
356+
if (params.productId && params.operation === 'refund_google_subscription') {
357+
next.storeTransactionId = params.productId
358+
next.productId = undefined
359+
}
359360
if (params.isRestore !== undefined && params.isRestore !== '') {
360361
next.isRestore = params.isRestore === true || params.isRestore === 'true'
361362
}
@@ -386,8 +387,10 @@ Return ONLY the numeric timestamp, no text.`,
386387
duration: { type: 'string', description: 'Promotional entitlement duration' },
387388
startTimeMs: { type: 'number', description: 'Custom start time in ms since epoch' },
388389
fetchToken: { type: 'string', description: 'Store receipt or purchase token' },
389-
productId: { type: 'string', description: 'Product identifier' },
390-
storeTransactionId: { type: 'string', description: 'Store transaction identifier' },
390+
productId: {
391+
type: 'string',
392+
description: 'Product identifier (or store transaction ID for refunds)',
393+
},
391394
price: { type: 'number', description: 'Product price' },
392395
currency: { type: 'string', description: 'ISO 4217 currency code' },
393396
isRestore: { type: 'boolean', description: 'Whether this is a restore purchase' },

0 commit comments

Comments
 (0)