This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"this": "that" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
//requires crypto | |
const crypto = require("crypto") | |
//site shared key (find this value when clicking 'edit' on your Site) | |
var shared_key = "shared_key_here" | |
//the square bracketed webhook body (eg: id=437192735&event=signup_success&payload[subscription][id]=1...etc...) | |
//do not use a JSON body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//replace all <variables> with the correct values. This includes your product_handle, api key, and subdomain. | |
$data_here = array( | |
"subscription" => array( | |
"product_handle" => "<handle_goes_here>", | |
"customer_attributes" => array( | |
"first_name" => "Bob", | |
"last_name" => "Smith", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// THE SCRIPT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
// DEALINGS IN THE SOFTWARE. | |
// | |
// THIS CODE IS PROVIDED AS A REFERENCE, AND IS PROVIDED AS-IS. | |
// YOU ARE RESPONSIBLE FOR ENSURING IT WORKS PROPERLY ON YOUR PAGE(S), AND YOU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So in the following example, we will: | |
1) change the product | |
2) move the current user license amount from 5 to 0 | |
3) move the current user license amount back to 5 (but on a new component price point) | |
The user would click a button to change products, and the following code could run: | |
1. This API call changes the products on the subscription. Just pass the product_handle of the product you want to change them to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$subdomain = '----'; | |
$api_key = '----'; | |
$subscription_id = '----'; | |
$component_id = '---'; | |
$data = array( | |
"allocation" => array( | |
"quantity" => "500" | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<form method="post" action="https://api.chargify.com/api/v2/signups"> | |
<?php | |
//Chargify Direct Credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//modern pages RECEIPT PAGE ONLY | |
if ($('.public-signup-page__success').length === 1) { | |
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? | |
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; | |
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; | |
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, | |
document,'script','https://connect.facebook.net/en_US/fbevents.js'); | |
//Replace 123456789 with your real number | |
fbq('init', '123456789'); |
NewerOlder