Skip to content

Commit

Permalink
Merge pull request #18 from pronamic/17-problem-with-taxes-and-coupon…
Browse files Browse the repository at this point in the history
…-codes-follow-up-13

Fix for issue #17?
  • Loading branch information
rvdsteege authored Nov 30, 2023
2 parents 64e37bc + a5aac99 commit 93d012f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
11 changes: 11 additions & 0 deletions src/Gateways/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@ public function process_payment( $transaction ) {
throw new \Exception( \esc_html__( 'This gateway only supports one time payments.', 'pronamic_ideal' ) );
}

/**
* Get invoice to get updated transaction total for trial.
*
* @link https://github.com/pronamic/wp-pronamic-pay-memberpress/issues/13
* @link https://github.com/pronamic/wp-pronamic-pay-memberpress/issues/17
* @link https://github.com/pronamic/memberpress/blob/v1.11.6/app/helpers/MeprTransactionsHelper.php#L252-L254
*/
MeprTransactionsHelper::get_invoice( $transaction );

$transaction->store();

// Create Pronamic payment.
$payment = Pronamic::get_payment( $transaction );

Expand Down
9 changes: 0 additions & 9 deletions src/Pronamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

use MeprSubscription;
use MeprTransaction;
use MeprTransactionsHelper;
use Pronamic\WordPress\Money\Money;
use Pronamic\WordPress\Money\TaxedMoney;
use Pronamic\WordPress\Pay\AddressHelper;
Expand Down Expand Up @@ -48,14 +47,6 @@ public static function get_payment( MeprTransaction $memberpress_transaction ) {
$memberpress_product = $memberpress_transaction->product();
$memberpress_subscription = $memberpress_transaction->subscription();

/**
* Get invoice to get updated transaction total for trial.
*
* @link https://github.com/pronamic/wp-pronamic-pay-memberpress/issues/13
* @link https://github.com/pronamic/memberpress/blob/v1.11.6/app/helpers/MeprTransactionsHelper.php#L252-L254
*/
MeprTransactionsHelper::get_invoice( $memberpress_transaction );

// Title.
$title = sprintf(
/* translators: %s: payment data title */
Expand Down

0 comments on commit 93d012f

Please sign in to comment.