Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
ampsalesfunnels-functions
Advanced tools
https://ampsalesfunnels.com - lib to support functions - Build blazingly fast sales funnels, learn coding, and get rich
Readme
Set with helper functions for the implementation of Netlify functions.
void
Print values of important Netlify provided built-in environment variables, and environment variables used by AMPSalesFunnels.
boolean
Is site in production mode? Based on the host name.
Get the value of the given environment variable, depending on production parameter. If production is true get PRODUCTION_ with fallback to . If production is false get SANDBOX_ with fallback to . If variable does not exist throw exception.
void
Prepare a Netlify function for execution.
*
Get a Netlify function result object that will do an AMP redirect to an url.
Object
Get a Netlify 200 function result with empty JSON body.
Object
Get a Netlify 200 function result with message.
*
Get a Netlify 200 function result with body.
Object
Get a Netlify function error result object.
Promise.<void>
Send email using nodemailer with body generated using mailgen.
string
Convert a dictionary object into a query string with URI encoded values
Log an event to IFTTT.
Log an event to available providers.
Log an error event to available providers.
Log an information event to available providers.
Log an interested in sku event to available providers.
Log a sale of sku event to available providers.
string
Get the PayPal base URL.
string
Get the PayPal merchant email address.
string
Get the PayPal IPN notification URL.
string
Get the PayPal url to do the checkout for a product.
Promise.<void>
Validate the contents of a PayPal IPN message with PayPal. Throws an exception if the IPN message is INVALID.
*
Convert PayPal IPN message to an order object. The field custom in the order contains the order form fields.
void
Print values of important Netlify provided built-in environment variables, and environment variables used by AMPSalesFunnels.
Kind: global function
Param | Type | Description |
---|---|---|
additionalAMPSFVars | Array.<string> | additional AMPSalesFunnels specific environment variables to print |
additionalNetlifyVars | Array.<string> | additional Netlify specific environment variables to print |
boolean
Is site in production mode? Based on the host name.
Get the value of the given environment variable, depending on production parameter. If production is true get PRODUCTION_ with fallback to . If production is false get SANDBOX_ with fallback to . If variable does not exist throw exception.
Kind: global function
Param | Type |
---|---|
envName | * |
void
Prepare a Netlify function for execution.
Kind: global function
Param | Type | Description |
---|---|---|
event | APIGatewayProxyEvent | |
context | any | |
dirname | string | path to the directory containing the function |
additionalAMPSFVars | Array.<string> | additional AMPSalesFunnels specific environment variables to print |
additionalNetlifyVars | Array.<string> | additional Netlify specific environment variables to print |
*
Get a Netlify function result object that will do an AMP redirect to an url.
Kind: global function
Param | Type | Description |
---|---|---|
url | string | url to redirect to |
Object
Get a Netlify 200 function result with empty JSON body.
Object
Get a Netlify 200 function result with message.
Kind: global function
Param | Type | Description |
---|---|---|
message | string | the message to return in body: { "message": message } |
*
Get a Netlify 200 function result with body.
Kind: global function
Param | Type | Description |
---|---|---|
obj | * | the obj to return in body: { ... } |
Object
Get a Netlify function error result object.
Kind: global function
Param | Type | Description |
---|---|---|
statusCode | number | status code |
error | Error | string | the error object (or a string), error message wil be returned in body: { "error": "message" } |
Promise.<void>
Send email using nodemailer with body generated using mailgen.
Kind: global function
Param | Type | Description |
---|---|---|
nodemailerTransporter | Transporter | the nodemailer transporter to use |
from | string | email address of the sender |
to | string | email address to send the mail to |
name | string | name of the customer |
sku | string | unique identifier for the product (stock-keeping unit) |
dirname | string | path to the directory containing the mailgen files |
string
Convert a dictionary object into a query string with URI encoded values
Kind: global function
Returns: string
-
the query string
Param | Type | Description |
---|---|---|
params | Object.<string, string> | dictionary object with name-value pairs |
Log an event to IFTTT.
Kind: global function
Category: IFTTT
Param | Type | Description |
---|---|---|
key | string | IFTTT key, available at https://ifttt.com/maker_webhooks/settings (after /use/) |
eventname | string | the name of the event to report |
value1 | string | first value |
value2 | string | second value |
value3 | string | third value |
Log an event to available providers.
Kind: global function
Category: IFTTT
Param | Type | Description |
---|---|---|
production | boolean | true if production; false if sandbox |
eventname | string | the name of the event to report, can be ERROR, LOG, INTERESTED, SALE, ... |
valueA | string | first value |
valueB | string | second value |
Log an error event to available providers.
Kind: global function
Category: IFTTT
Param | Type | Description |
---|---|---|
production | boolean | true if production; false if sandbox |
functionFilename | string | filename of the function |
name | string | name of user |
string | email of user | |
message | string | error message |
Log an information event to available providers.
Kind: global function
Category: IFTTT
Param | Type | Description |
---|---|---|
production | boolean | true if production; false if sandbox |
functionFilename | string | filename of the function |
name | string | name of user |
string | email of user | |
message | string | message to log |
Log an interested in sku event to available providers.
Kind: global function
Category: IFTTT
Param | Type | Default | Description |
---|---|---|---|
production | boolean | true if production; false if sandbox | |
name | string | name of user | |
string | email of user | ||
sku | string | "unknown" | sku of the product user is interested in |
price | string | "unknown" | price of sku |
Log a sale of sku event to available providers.
Kind: global function
Category: IFTTT
Param | Type | Default | Description |
---|---|---|---|
production | boolean | true if production; false if sandbox | |
name | string | name of user | |
string | email of user | ||
sku | string | "unknown" | sku of the product user is interested in |
price | string | "unknown" | price of sku |
string
Get the PayPal base URL.
Kind: global function
Returns: string
-
The PayPal base URL https://www.sandbox.paypal.com or https://www.paypal.com'
Param | Type | Description |
---|---|---|
production | boolean | in production mode if true; in sandbox mode if false |
string
Get the PayPal merchant email address.
Kind: global function
Returns: string
-
email address of merchant
Param | Type | Description |
---|---|---|
production | boolean | in production mode if true; in sandbox mode if false |
string
Get the PayPal IPN notification URL.
Kind: global function
Returns: string
-
The IPN notification URL
Param | Type | Description |
---|---|---|
production | boolean | in production mode if true; in sandbox mode if false |
string
Get the PayPal url to do the checkout for a product.
Kind: global function
Returns: string
-
Param | Type | Description |
---|---|---|
sku | string | unique identifier for the product (stock-keeping unit) |
formData | object | form data as posted on the salesfunnel page |
customData | object | custom data to add to the PayPal URL |
siteUrl | string | url of the site hosting the salesfunnel page |
returnPage | string | relative url of page to go to when PayPal checkout completed, e.g. salesfunnel-thanks.html page) |
cancelPage | string | relative url of page to go to when PayPal flow is canceled (salesfunnel page) |
logoUrl | string | relative url to a 150x50 product log image used in PayPal checkout |
dirname | string | path to the directory containing the products.json file |
production | boolean | in production mode if true; in sandbox mode if false |
Promise.<void>
Validate the contents of a PayPal IPN message with PayPal. Throws an exception if the IPN message is INVALID.
Kind: global function
Returns: Promise.<void>
-
Param | Type | Description |
---|---|---|
ipnMessage | string | the body of the PayPal IPN message |
production | boolean | in production mode if true; in sandbox mode if false |
*
Convert PayPal IPN message to an order object. The field custom in the order contains the order form fields.
Kind: global function
Returns: *
-
an order object with all IPN fields
Param | Type | Description |
---|---|---|
body | string | POST body as PayPal sends to IPN endpoint |
=== © 2021 Dellariva Solutions
FAQs
https://ampsalesfunnels.com - lib to support functions - Build blazingly fast sales funnels, learn coding, and get rich
The npm package ampsalesfunnels-functions receives a total of 3 weekly downloads. As such, ampsalesfunnels-functions popularity was classified as not popular.
We found that ampsalesfunnels-functions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.