The most relevant functions of the iDonate Client, their parameters, and the data schemas involved.
(Knowledge of JavaScript is required to understand this article. TypeScript knowledge is also recommended.)
The iDonate SDK Client contains the functions you will need to use in order to create a transaction within iDonate. These are written in TypeScript, a version of JavaScript that uses Java-style data types instead of JavaScript's laissez-faire approach to data types.
This means that to ensure proper function, the parameters you pass to the iDonate Client's functions must fit a very specific schema. This article is about those functions and schemas.
As always, to see the SDK in action, and to take a look at what the code involved in a successful transaction looks like, please refer to the CHF SDK Example.
The Most Relevant Functions
The end objective of an iDonate SDK implementation is to create a transaction. So, let's look at the functions used when creating one.
- Tokenize Spreedly Credit Card
- Create Payment Method
- Create Transaction
Table One: Functions and Parameters
Function Name | Parameter(s) |
tokenizeSpreedlyCreditCard() |
An object comprised of the following Data Types:
|
createPaymentMethod() |
A single parameter of the following Data Type:
|
createTransaction() |
A single parameter of the following Data Type:
|
Table Two: Data Types
Data Type | Components (optional components listed in italics) |
Contact |
|
Address |
|
CreditCard |
|
CreatePaymentMethodRequest |
An object comprised of a RecaptchaSecuredRequest data type and the following components:
|
RecaptchaSecuredRequest |
|
RecaptchaType |
One of the following String values:
|
PaymentMethodType |
One of the following String values:
|
CreateDonationRequest |
An object comprised of a RecaptchaSecuredRequest data type and the following components:
|
RecurringFrequency |
One of the following String values:
|