This is a collection of utilities used by Destiny Rescue/Child Rescue.
A donation form which can be added to any page. Example:
<script src=https://utils.destinyrescue.org/donation-form/form.js async defer></script> <div class=donation-form data-fn=US data-methods=cc,paypal data-cc-provider-id=a0p28000004ghhWAAQ data-confirmation-email="Rescue_Partner_Email_US.html" ></div>
data-fn |
Identifier for the Funding Nation. Available options are US, AUS. |
||||||
data-mode |
The options that are available to the donor. Available options are:
For example:
|
||||||
data-methods |
Comma-separated list of allowed payment methods. Available options are cc, ach, paypal. ach is equivalent to Direct Debit in Australia/New Zealand. |
||||||
data-minimum | The minimum donation allowed. | ||||||
data-default-amount |
The default amount displayed in the amount box. For example:
|
||||||
data-<name>-provider-id |
Each method must have a provider Id. This Id is found in the "Long Id" field in the Payment Provider details in Salesforce. The Id is specified by adding a parameter, in the format . Every payment method must have a provider Id specified. |
||||||
data-<name>-name |
Each method may also have a name, to allow localising the names of methods, for example:
|
||||||
data-entity |
The sponsorship entity ID that recurring donations should be attached to. |
||||||
data-confirmation-email |
The name of the confirmation email document from Salesforce to send. For example:
|
Uses Cloudflare's CF-IPCountry header to return the user's country in ISO 3166-1 Alpha 2 format.
$.getJSON('https://utils.destinyrescue.org/get-country').then(function(country) { alert(country); });
Sends back a list of countries in a name => ISO JSON format
$.getJSON('https://utils.destinyrescue.org/get-countries').then(function(countries) { console.log(countries); });
One line which logs all client-side errors to a database.
<script crossorigin=anonymous src="https://utils.destinyrescue.org/js-error-logger"></script>