Skip to content

Commit

Permalink
Fix for issue #17?
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Nov 30, 2023
1 parent 64e37bc commit a5aac99
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 a5aac99

Please sign in to comment.