diff --git a/CRM/Core/Payment/StripeIPN.php b/CRM/Core/Payment/StripeIPN.php index 2dc05f2ba40fec956d8f52735e6816e3d4b2ab9f..da2c393cc9b9846b842c52c2315861bab4b29694 100644 --- a/CRM/Core/Payment/StripeIPN.php +++ b/CRM/Core/Payment/StripeIPN.php @@ -252,7 +252,7 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN { $refunds = \Stripe\Refund::all(['charge' => $this->charge_id, 'limit' => 1]); $params = [ 'id' => $this->contribution['id'], - 'total_amount' => $this->retrieve('amount_refunded', 'Float'), + 'payment_trxn_id' => $this->charge_id, 'cancel_reason' => $refunds->data[0]->reason, 'cancel_date' => date('YmdHis', $refunds->data[0]->created), ]; @@ -367,11 +367,22 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN { } } + $contributionParamsToReturn = [ + 'id', + 'trxn_id', + 'contribution_status_id', + 'total_amount', + 'fee_amount', + 'net_amount', + 'tax_amount', + ]; + if ($this->charge_id) { try { $this->contribution = civicrm_api3('Contribution', 'getsingle', [ 'trxn_id' => $this->charge_id, 'contribution_test' => $this->_paymentProcessor->getIsTestMode(), + 'return' => $contributionParamsToReturn, ]); } catch (Exception $e) { @@ -383,6 +394,7 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN { $this->contribution = civicrm_api3('Contribution', 'getsingle', [ 'trxn_id' => $this->invoice_id, 'contribution_test' => $this->_paymentProcessor->getIsTestMode(), + 'return' => $contributionParamsToReturn, ]); } catch (Exception $e) { @@ -397,6 +409,7 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN { 'return' => ['id', 'contribution_status_id', 'total_amount', 'trxn_id'], 'contribution_recur_id' => $this->contribution_recur_id, 'contribution_test' => $this->_paymentProcessor->getIsTestMode(), + 'return' => $contributionParamsToReturn, 'options' => ['limit' => 1, 'sort' => 'id DESC'], ]); } diff --git a/CRM/Stripe/Check.php b/CRM/Stripe/Check.php index 8a4ea2d95be203dc2c4345e9a71da7209e1b86c5..ca12e7081196a8368e316cc7baf088bb4d7a460b 100644 --- a/CRM/Stripe/Check.php +++ b/CRM/Stripe/Check.php @@ -10,7 +10,7 @@ use CRM_Stripe_ExtensionUtil as E; */ class CRM_Stripe_Check { - const MIN_VERSION_MJWSHARED = '0.4.3'; + const MIN_VERSION_MJWSHARED = '0.4.4'; public static function checkRequirements(&$messages) { $extensions = civicrm_api3('Extension', 'get', [ diff --git a/docs/index.md b/docs/index.md index 1ce09ab0ae15ed4e6449631681e935b791086a47..114c939e6c478331124265ff6d9697ab3936c61b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,6 +5,15 @@ Integrates the Stripe payment processor (for Credit/Debit cards) into CiviCRM so View/Download this extension in the [Extension Directory](https://civicrm.org/extensions/stripe-payment-processor). +## Supports +* PSD2 / SCA payments on one-off payments, partial support for recurring payments (may not be able to authorise card in some cases). +* Cancellation of subscriptions from Stripe / CiviCRM. +* Full refund of payments from Stripe. + +### Does not support +* Partial refunds (they will not be processed by CiviCRM correctly and will be recorded as a full refund of a contribution). +* Updating Stripe subscriptions from CiviCRM. + ## Compatibility / Requirements * CiviCRM 5.13+ * PHP 7.1+ diff --git a/docs/release/release_notes.md b/docs/release/release_notes.md index 7abd1102481accd03ee1a7a717a181b60e9cefce..2aaace25fd512ebc7eda21f521f552524048d357 100644 --- a/docs/release/release_notes.md +++ b/docs/release/release_notes.md @@ -1,7 +1,7 @@ ## Release 6.1.5 * Send email receipts from Stripe by default (as this was what 5.x did). Add a setting under Administer->CiviContribute->Stripe Settings to enable/disable receipts from Stripe. - +* Support recording full refunds from Stripe. ## Release 6.1.4 **This release fixes a MAJOR issue that caused duplicate payments to be taken when a new recurring contribution (subscription) was setup. All users of 6.x should upgrade.**