Hi,
I am trying to publish my plugin but this piece of code is causing Bubble to throw the error “Action plugin: Some actions JS blocks cannot be parsed as JS code. Please check.”.
The piece of code works perfectly fine in my test app, but Bubble just won’t let me publish it. There are no errors in the console or in the code editor for action. It’s running as a server-side action.
If anyone has a minute can you please review the code and suggest any reasons why Bubble may not be able to publish it?
Thank you all!!!
function(properties, context) {
const response = context.request({
method: "post",
uri: "https://paper.xyz/api/v1/checkout",
headers: {"Accept": "application/json",
"Authorization": "Bearer <MYAPIKEY>",
"Content-Type": "application/json"},
body:{ "contractChain": properties.contract_chain,
"contractType": "THIRDWEB_NFT_DROP_V2",
"requireVerifiedEmail": false,
"hideNativeMint": false,
"hidePayWithCard": false,
"hidePayWithCrypto": false,
"hideConnectPaperWallet": false,
"hideConnectExternalWallet": false,
"brandDarkMode": false,
"brandButtoneShape": "lg",
"brandColorScheme": properties.color_scheme,
"hasPublicLink": true,
"limitPerTransaction": properties.limit_per_transaction,
"redirectAfterPayment": false,
"shouldSendTransferCompletedEmail": true,
"successCallbackUrl": properties.success_url,
"contractAddress": properties.contract_address,
"collectionDescription": properties.collection_description,
"collectionTitle": properties.collection_name,
"cancelCallbackUrl": properties.cancel_url,
"imageUrl": properties.image_url,
"sellerTwitterHandle": properties.seller_twitter_handle},
json: true});
return {checkouturl: JSON.stringify(response.body.checkoutUrl).replace('"','').replace('"','')};
}