Add documentation for API actions.

This commit is contained in:
Jens Schuppe 2018-12-19 14:19:37 +01:00
parent 2075d30320
commit 0f69169561
2 changed files with 64 additions and 12 deletions

View file

@ -56,27 +56,79 @@ and cancel previously submitted donation.
### Submit donation ### Submit donation
This API action processes submitted Twingle donations and donor information.
- Entity: `TwingleDonation` - Entity: `TwingleDonation`
- Action: `Submit` - Action: `Submit`
*This section is to be completed: Add parameters documentation and describe what The action accepts the following parameters:
the action does. In the meantime, refer to
[the code](https://github.com/systopia/de.systopia.twingle/blob/master/api/v3/TwingleDonation/Submit.php)* | Parameter | Type | Description | Values/Format | Required |
|----------------------------------------|---------|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| <nobr>`project_id`</nobr> | String | The Twingle project ID | | Yes |
| <nobr>`trx_id`</nobr> | String | The unique transaction ID of the donation | A unique transaction ID for the donation. | Yes |
| <nobr>`confirmed_at`</nobr> | String | The date when the donation was issued | A string representing a date in the format `YYYYMMDD` | Yes |
| <nobr>`purpose`</nobr> | String | The purpose of the donation | | |
| <nobr>`amount`</nobr> | Integer | The donation amount in minor currency unit | | Yes |
| <nobr>`currency`</nobr> | String | The ISO-4217 currency code of the donation | A valid ISO-4217 currency code | Yes |
| <nobr>`newsletter`</nobr> | Boolean | Whether to subscribe the contact to the newsletter group defined in the profile | | |
| <nobr>`postinfo`</nobr> | Boolean | Whether to subscribe the contact to the postal mailing group defined in the profile | | |
| <nobr>`donation_receipt`</nobr> | Boolean | Whether the contact requested a donation receipt | | |
| <nobr>`payment_method`</nobr> | String | The Twingle payment method used for the donation | One of:<br /><ul><li><nobr>`banktransfer`</nobr></li><li><nobr>`debit_manual`</nobr></li><li><nobr>`debit_automatic`</nobr></li><li><nobr>`creditcard`</nobr></li><li><nobr>`mobilephone_germany`</nobr></li><li><nobr>`paypal`</nobr></li><li><nobr>`sofortueberweisung`</nobr></li><li><nobr>`amazonpay`</nobr></li><li><nobr>`paydirekt`</nobr></li><li><nobr>`applepay`</nobr></li><li><nobr>`googlepay`</nobr></li></ul> | Yes |
| <nobr>`donation_rhythm`</nobr> | String | The interval which the donation is recurring in | One of:<br /><ul><li><nobr>`'one_time',`</nobr></li><li><nobr>`'halfyearly',`</nobr></li><li><nobr>`'quarterly',`</nobr></li><li><nobr>`'yearly',`</nobr></li><li><nobr>`'monthly'`</nobr></li></ul> | Yes |
| <nobr>`debit_iban`</nobr> | String | The IBAN for SEPA Direct Debit payments | A valid ISO 13616-1:2007 IBAN | Yes, if `payment_method` is `debit_manual` and CiviSEPA is used |
| <nobr>`debit_bic`</nobr> | String | The BIC for SEPA Direct Debit payments | A valid ISO 9362 BIC | Yes, if `payment_method` is `debit_manual` and CiviSEPA is used |
| <nobr>`debit_mandate_reference`</nobr> | String | The mandate reference for SEPA Direct Debit payments | | |
| <nobr>`debit_account_holder`</nobr> | String | The account holder for SEPA Direct Debit payments | | |
| <nobr>`is_anonymous`</nobr> | Boolean | Whether the donation is submitted anonymously | | |
| <nobr>`user_gender`</nobr> | String | The gender of the contact | | |
| <nobr>`user_birthdate`</nobr> | String | The date of birth of the contact | A string representing a date in the format `YYYYMMDD` | |
| <nobr>`user_title`</nobr> | String | The formal title of the contact | | |
| <nobr>`user_email`</nobr> | String | The e-mail address of the contact | A valid e-mail address | |
| <nobr>`user_firstname`</nobr> | String | The first name of the contact | | |
| <nobr>`user_lastname`</nobr> | String | The last name of the contact | | |
| <nobr>`user_street`</nobr> | String | The street address of the contact | | |
| <nobr>`user_postal_code`</nobr> | String | The postal code of the contact | | |
| <nobr>`user_city`</nobr> | String | The city of the contact | | |
| <nobr>`user_telephone`</nobr> | String | The telephone number of the contact | | |
| <nobr>`user_company`</nobr> | String | The company of the contact | | |
| <nobr>`user_extrafield`</nobr> | String | Additional information of the contact | | |
You may also refer to
[the code](https://github.com/systopia/de.systopia.twingle/blob/master/api/v3/TwingleDonation/Submit.php)
for more insight into this API action.
### End recurring donation ### End recurring donation
- Entity: `TwingleDonation` - Entity: `TwingleDonation`
- Action: `Endrecurring` - Action: `Endrecurring`
*This section is to be completed: Add parameters documentation and describe what The action accepts the following parameters:
the action does. In the meantime, refer to
[the code](https://github.com/systopia/de.systopia.twingle/blob/master/api/v3/TwingleDonation/Endrecurring.php)* | Parameter | Type | Description | Values/Format | Required |
|---------------------------|---------|------------------------------------------------|-------------------------------------------------------|----------|
| <nobr>`project_id`</nobr> | String | The Twingle project ID | | Yes |
| <nobr>`trx_id`</nobr> | String | The unique transaction ID of the donation | A unique transaction ID for the donation. | Yes |
| <nobr>`ended_at`</nobr> | Integer | The date when the recurring donation was ended | A string representing a date in the format `YYYYMMDD` | Yes |
You may also refer to
[the code](https://github.com/systopia/de.systopia.twingle/blob/master/api/v3/TwingleDonation/Endrecurring.php)
for more insight into this API action.
### Cancel donation ### Cancel donation
- Entity: `TwingleDonation` - Entity: `TwingleDonation`
- Action: `Cancel` - Action: `Cancel`
*This section is to be completed: Add parameters documentation and describe what The action accepts the following parameters:
the action does. In the meantime, refer to
[the code](https://github.com/systopia/de.systopia.twingle/blob/master/api/v3/TwingleDonation/Cancel.php)* | Parameter | Type | Description | Values/Format | Required |
|------------------------------|--------|----------------------------------------------------|-------------------------------------------------------|----------|
| <nobr>`project_id`</nobr> | String | The Twingle project ID | | Yes |
| <nobr>`trx_id`</nobr> | String | The unique transaction ID of the donation | A unique transaction ID for the donation. | Yes |
| <nobr>`cancelled_at`</nobr> | String | The date when the recurring donation was cancelled | A string representing a date in the format `YYYYMMDD` | Yes |
| <nobr>`cancel_reason`</nobr> | String | he reason for the donation being cancelled | | Yes |
You may also refer to
[the code](https://github.com/systopia/de.systopia.twingle/blob/master/api/v3/TwingleDonation/Cancel.php)
for more insight into this API action.

View file

@ -44,7 +44,7 @@ function _civicrm_api3_twingle_donation_Submit_spec(&$params) {
$params['confirmed_at'] = array( $params['confirmed_at'] = array(
'name' => 'confirmed_at', 'name' => 'confirmed_at',
'title' => 'Confirmed at', 'title' => 'Confirmed at',
'type' => CRM_Utils_Type::T_INT, 'type' => CRM_Utils_Type::T_STRING,
'api.required' => 1, 'api.required' => 1,
'description' => 'The date when the donation was issued, format: YYYYMMDD.', 'description' => 'The date when the donation was issued, format: YYYYMMDD.',
); );
@ -123,14 +123,14 @@ function _civicrm_api3_twingle_donation_Submit_spec(&$params) {
'title' => 'SEPA Direct Debit Mandate reference', 'title' => 'SEPA Direct Debit Mandate reference',
'type' => CRM_Utils_Type::T_STRING, 'type' => CRM_Utils_Type::T_STRING,
'api.required' => 0, 'api.required' => 0,
'description' => 'The mandate for SEPA Direct Debit payments.', 'description' => 'The mandate reference for SEPA Direct Debit payments.',
); );
$params['debit_account_holder'] = array( $params['debit_account_holder'] = array(
'name' => 'debit_account_holder', 'name' => 'debit_account_holder',
'title' => 'SEPA Direct Debit Account holder', 'title' => 'SEPA Direct Debit Account holder',
'type' => CRM_Utils_Type::T_STRING, 'type' => CRM_Utils_Type::T_STRING,
'api.required' => 0, 'api.required' => 0,
'description' => 'The mandate for SEPA Direct Debit payments.', 'description' => 'The account holder for SEPA Direct Debit payments.',
); );
$params['is_anonymous'] = array( $params['is_anonymous'] = array(
'name' => 'is_anonymous', 'name' => 'is_anonymous',