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

Change default to 1 hour to cancel uncaptured payments based on client feedback

parent 2209eaa3
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ return [
'api_entity' => 'Job',
'api_action' => 'process_stripe',
'parameters' => 'delete_old=-3 month
cancel_incomplete=-1 day',
cancel_incomplete=-1 hour',
],
],
];
......@@ -24,7 +24,7 @@ function civicrm_api3_job_process_stripe($params) {
}
if ($params['cancel_incomplete'] !== 0 && !empty($params['cancel_incomplete'])) {
// Cancel incomplete paymentIntents after 1 day
// Cancel incomplete paymentIntents after 1 hour
$incompletePaymentIntents = civicrm_api3('StripePaymentintent', 'get', [
'status' => ['NOT IN' => ["succeeded", "cancelled"]],
'created_date' => ['<' => $params['cancel_incomplete']],
......@@ -61,7 +61,7 @@ function _civicrm_api3_job_process_stripe_spec(&$params) {
$params['delete_old']['api.default'] = '-3 month';
$params['delete_old']['title'] = 'Delete old records after (default: -3 month)';
$params['delete_old']['description'] = 'Delete old records from database. Specify 0 to disable. Default is "-3 month"';
$params['cancel_incomplete']['api.default'] = '-1 day';
$params['cancel_incomplete']['title'] = 'Cancel incomplete records after (default: -1 day)';
$params['cancel_incomplete']['description'] = 'Cancel incomplete paymentIntents in your stripe account. Specify 0 to disable. Default is "-1 day"';
$params['cancel_incomplete']['api.default'] = '-1 hour';
$params['cancel_incomplete']['title'] = 'Cancel incomplete records after (default: -1hour)';
$params['cancel_incomplete']['description'] = 'Cancel incomplete paymentIntents in your stripe account. Specify 0 to disable. Default is "-1hour"';
}
......@@ -29,9 +29,9 @@ The api commands are:
## StripeSubscription
* `StripeSubscription.updatetransactionids` - Used to migrate civicrm_stripe_subscriptions to use recurring contributions directly.
* `StripeSubscription.copytrxnidtoprocessorid` - Used to copy trxn_id to processor_id in civicrm_contribution_recur table so we can use cancelSubscription. Hopefully this won't be needed in future versions of CiviCRM if we can pass more sensible values to the cancelSubscription function.
* `StripeSubscription.import` - Use to import subscriptions into CiviCRM that are in Stripe but not CiviCRM.
* `StripeSubscription.import` - Use to import subscriptions into CiviCRM that are in Stripe but not CiviCRM.
Accepts various parameters but requires: Payment Processor ID, Stripe subscription ID and CiviCRM contact ID.
![StripeSubscription.import](/images/StripeSubscription.import.png)
![StripeSubscription.import](/images/StripeSubscription.import.png)
## StripePaymentintents
......@@ -42,7 +42,7 @@ It's not advised that you use this API for anything else.
## Scheduled Jobs
* `Job.process_stripe` - this cancels uncaptured paymentIntents and removes successful ones from the local database cache after a period of time:
Parameters:
* delete_old: Delete old records from database. Specify 0 to disable. Default is "-3 month"
* cancel_incomplete: Cancel incomplete paymentIntents in your stripe account. Specify 0 to disable. Default is "-1 day"
* cancel_incomplete: Cancel incomplete paymentIntents in your stripe account. Specify 0 to disable. Default is "-1 hour"
......@@ -30,7 +30,7 @@ and shows as a charge on the customer card. They can be manually cancelled via t
To mitigate this the Stripe extension tracks and records all paymentIntents created through CiviCRM and manages them
using a scheduled job `Job.process_stripe`.
The defaults for this are to cancel uncaptured payments after 24 hours and clear out old records (from the CiviCRM database) after three months.
The defaults for this are to cancel uncaptured payments after 1 hour and clear out old records (from the CiviCRM database) after three months.
## Payment Metadata
......
......@@ -18,13 +18,16 @@ View/Download this extension in the [Extension Directory](https://civicrm.org/ex
* PHP 7.1+
* Jquery 1.10 (Use jquery_update module on Drupal).
* Drupal 7 / Joomla / Wordpress (latest supported release). *Not currently tested with other CMS but it may work.*
* Stripe API version: 2019-11-05
* Stripe API version: 2019-12-03
* Drupal webform_civicrm 7.x-4.28+ (if using webform integration) - does NOT support test mode:
* If using test mode with drupal webform_civicrm (4.x) you need [this patch for webform_civicrm](https://github.com/colemanw/webform_civicrm/pull/266).
* If using drupal webform_civicrm (4.x) you need [this patch for CiviCRM core](https://github.com/civicrm/civicrm-core/pull/15340).
* [MJWShared extension](https://civicrm.org/extensions/mjwshared) version 0.6.
**Please ensure that you are running the ProcessStripe scheduled job every hour or you will have issues with failed/uncaptured payments appearing on customer credit cards and blocking their balance for up to a week!**
## Troubleshooting
Under *Administer->CiviContribute->Stripe Settings* you can find a setting:
* Enable Stripe Javascript debugging?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment