Code Monkey home page Code Monkey logo

clicknpledge-faas's Introduction

#Click & Pledge FAAS sample form with Bootstrap and jQuery

Sample page for accepting online donations using Click & Pledge FAAS and Salesforce

Required: Just create an inc/config.inc file with the following contents tailored for your use:

<?php
if (!defined('ON_SUCCESS_URL')) define('ON_SUCCESS_URL', 'https://XXXX');
if (!defined('ON_DECLINE_URL')) define('ON_DECLINE_URL', 'https://XXXX');
if (!defined('ON_ERROR_URL')) define('ON_ERROR_URL', 'https://XXXX');
if (!defined('DEFAULT_SF_CAMPAIGN')) define('DEFAULT_SF_CAMPAIGN', 'XXXX');
if (!defined('CNP_ACCOUNT_GUID')) define('CNP_ACCOUNT_GUID', 'XXXX-XXXX-XXXX-XXXX-XXXX');
if (!defined('CNP_ACCOUNT_ID')) define('CNP_ACCOUNT_ID', 'XXXXX');
if (!defined('CNP_WID')) define('CNP_WID', 'XXXXX');
if (!defined('CNP_REF_ID')) define('CNP_REF_ID', 'donation');
if (!defined('CNP_TRACKER')) define('CNP_TRACKER', 'FaaS-XXXX-donation');
if (!defined('CNP_SEND_RECEIPT')) define('CNP_SEND_RECEIPT', 'false');  //true or false
if (!defined('CNP_ORDER_MODE')) define('CNP_ORDER_MODE', 'Test'); //Production or Test
if (!defined('CNP_TRANSACTION_TYPE')) define('CNP_TRANSACTION_TYPE', 'Payment');
if (!defined('CNP_DECIMAL_MARK')) define('CNP_DECIMAL_MARK', 'US');
if (!defined('ERROR_EMAIL_TO')) define('ERROR_EMAIL_TO', '[email protected]');
if (!defined('ERROR_EMAIL_SUBJECT')) define('ERROR_EMAIL_SUBJECT', 'Donation Page Error');
?>

##Works (as well as it does) thanks to

##Where to find more information

##Embedding in an iframe These pages can easily be embedded in another site using an iframe. One thing that you may want to do is add this onload to the iframe so when the success/error/decline page is loaded in the forms place the parent page will scroll to the top: window.parent.parent.scrollTo(0,0)

Here's a sample iframe:

<iframe src="https://mydomain.org/clickandpledge/donate.php?test=1" style="padding-left: 0px; padding-right:0px; width:100%; height:1200px;" scrolling="auto" onload="window.parent.parent.scrollTo(0,0)" id="donationform"></iframe>

There is also a bit of JavaScript in the donate.php page that grabs a campaign from the parent URL and loads it into the campaign field if it exists. So if you want to use this, just add a ?campaign=XXX to the page that the donate.php page is iframed in. Tested and works well in Wordpress 4.

##Test mode Append ?test=1 to the donation form URL to get some defaulted field values to speed up testing.

Made in Oakland

clicknpledge-faas's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.