Skip to content
Snippets Groups Projects
Commit 75994a39 authored by mattwire's avatar mattwire
Browse files

Update documentation for release

parent bf5e1b53
Branches
Tags
No related merge requests found
Showing
with 107 additions and 50 deletions
<?php
/**
* https://civicrm.org/licensing
*/
......
<?php
/**
* https://civicrm.org/licensing
*/
class CRM_Stripe_Api {
......
<?php
/**
* https://civicrm.org/licensing
*/
......
<?php
/**
* https://civicrm.org/licensing
*/
/**
* Class CRM_Stripe_Customer
*/
class CRM_Stripe_Customer {
/**
......
<?php
/**
* https://civicrm.org/licensing
*/
use CRM_Stripe_ExtensionUtil as E;
......
<?php
/*--------------------------------------------------------------------+
| CiviCRM version 5.0 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| CiviCRM is free software; you can copy, modify, and distribute it |
| under the terms of the GNU Affero General Public License |
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
| |
| CiviCRM is distributed in the hope that it will be useful, but |
| WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| See the GNU Affero General Public License for more details. |
| |
| You should have received a copy of the GNU Affero General Public |
| License and the CiviCRM Licensing Exception along |
| with this program; if not, contact CiviCRM LLC |
| at info[AT]civicrm[DOT]org. If you have questions about the |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+-------------------------------------------------------------------*/
/**
* https://civicrm.org/licensing
*/
/**
* This class implements hooks for Stripe
......
<?php
/**
* https://civicrm.org/licensing
*/
/**
* Collection of upgrade steps.
* DO NOT USE a naming scheme other than upgrade_N, where N is an integer.
......
<?php
/**
* https://civicrm.org/licensing
*/
use CRM_Stripe_ExtensionUtil as E;
/**
* Class CRM_Stripe_Webhook
*/
class CRM_Stripe_Webhook {
use CRM_Stripe_WebhookTrait;
......
# CiviCRM Stripe Payment Processor
Integrates the Stripe payment processor (for Credit/Debit cards) into CiviCRM so you can use it to accept Credit / Debit card payments on your site.
* https://stripe.com/
Latest releases can be found here: https://civicrm.org/extensions/stripe-payment-processor
## Documentation
Please see: https://docs.civicrm.org/stripe/en/latest
## Configuration
All configuration is in the standard Payment Processors settings area in CiviCRM admin.
You will enter your "Publishable" & "Secret" key given by stripe.com.
## Installation
There are no special installation requirements.
The extension will show up in the extensions browser for automated installation.
Otherwise, download and install as you would for any other CiviCRM extension.
# CiviCRM Stripe Payment Processor
Integrates the Stripe payment processor (for Credit/Debit cards) into CiviCRM so you can use it to accept Credit / Debit card payments on your site.
* https://stripe.com/
Latest releases can be found here: https://civicrm.org/extensions/stripe-payment-processor
## Documentation
Please see: https://docs.civicrm.org/stripe/en/latest
## Configuration
All configuration is in the standard Payment Processors settings area in CiviCRM admin.
You will enter your "Publishable" & "Secret" key given by stripe.com.
## Installation
**The mjwshared extension is required and MUST be installed.**
The extension will show up in the extensions browser for automated installation.
Otherwise, download and install as you would for any other CiviCRM extension.
<?php
/**
* https://civicrm.org/licensing
*/
/**
* This api cleans up old data / tables in Stripe.
......
<?php
/**
* https://civicrm.org/licensing
*/
/**
* This api allows you to replay Stripe events.
......
<?php
/**
* https://civicrm.org/licensing
*/
/**
* This api provides a list of events generated by Stripe
......
<?php
/**
* https://civicrm.org/licensing
*/
/**
* Populate the CiviCRM civicrm_system_log with Stripe events.
......@@ -18,7 +21,7 @@
* @see http://wiki.civicrm.org/confluence/display/CRMDOC/API+Architecture+Standards
*/
function _civicrm_api3_stripe_Populatelog_spec(&$spec) {
$spec['ppid']['title'] = ts("The id of the payment processor.");
$spec['ppid']['title'] = ts("The id of the payment processor.");
}
/**
......@@ -46,12 +49,12 @@ function civicrm_api3_stripe_Populatelog($params) {
throw new API_Exception("Expected one live Stripe payment processor, but found none or more than one. Please specify ppid=.", 2234);
}
}
$params = array('limit' => 100, 'type' => 'invoice.payment_succeeded');
if ($ppid) {
if ($ppid) {
$params['ppid'] = $ppid;
}
$items = array();
$last_item = NULL;
$more = TRUE;
......@@ -60,7 +63,7 @@ function civicrm_api3_stripe_Populatelog($params) {
$params['starting_after'] = $last_item->id;
}
$objects = civicrm_api3('Stripe', 'Listevents', $params);
if (count($objects['values']['data']) == 0) {
// No more!
break;
......
<?php
/**
* https://civicrm.org/licensing
*/
/**
* This api sets up a Stripe Payment Processor with test credentials.
......
<?php
/**
* https://civicrm.org/licensing
*/
/**
* Stripe Customer API
......
<?php
/**
* https://civicrm.org/licensing
*/
/**
* Stripe Subscription API
......
/**
* https://civicrm.org/licensing
*/
#card-element {
padding: 2%;
margin: 2% auto;
......
# Contributions, Payments and Customers
A CiviCRM **Contribution** is the equivalent of a Stripe **Invoice**.
A CiviCRM **Payment** is the equivalent of a Stripe **Charge**.
A CiviCRM **Contact** is the equivalent of a Stripe **Customer**.
## Invoices and Charges?
For a **one-off contribution** an invoice is *NOT* created, so we have to use the Stripe `Charge ID`. In this case we set the contribution `trxn_id` = Stripe `Charge ID`.
For a **recurring contribution** an invoice is created for each contribution:
* We set the contribution `trxn_id` = Stripe `Invoice ID`.
* We set individual payments on that contribution (which could be a payment, a failed payment, a refund) to have `trxn_id` = Stripe `Charge ID`
## Payment Metadata
When we create a contribution in CiviCRM (Stripe Invoice/Charge) we add some metadata to that payment.
* The statement descriptor contains a parsable `contactID-contributionID` and then part of the description.
* The description contains the description, a parsable `contactID-contributionID` and then the CiviCRM (unique) invoice ID.
![Stripe Payment](/images/stripedashboard_paymentdetail.png)
## Customer Metadata
Every time we create a new contribution/recurring contribution we create/update a Stripe customer with the following metadata:
* Contact Name, Email address
* Description (`CiviCRM: ` + site name).
* Contact ID
* Link to CiviCRM contact record
![Stripe Customer](/images/stripedashboard_customerdetail.png)
......@@ -6,7 +6,7 @@ In order to support other extensions that manipulate amounts etc we need to add
Currently only a single hook is implemented, and is only called in one place.
#### hook_civicrm_smartdebit_updateRecurringContribution(&$recurContributionParams)
#### hook_civicrm_stripe_updateRecurringContribution(&$recurContributionParams)
This hook allows modifying recurring contribution parameters during update.
* @param array $recurContributionParams Recurring contribution params (ContributionRecur.create API parameters).
docs/images/backend_cancelrecur.png

73.1 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment