Skip to content

Commit

Permalink
Merge branch 'hotfix/2.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
rvdsteege committed Feb 8, 2021
2 parents be09a5b + e37d74d commit 8093076
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## [Unreleased][unreleased]
-

## [2.2.3] - 2021-02-08
- Fixed showing payment method specific input fields.

## [2.2.2] - 2021-01-18
- Added support for recurring payments with Apple Pay.
- Updated payment method icons to use wp-pay/logos library.
Expand Down Expand Up @@ -113,7 +116,8 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## 1.0.0 - 2016-02-01
- First release.

[unreleased]: https://github.com/wp-pay-extensions/memberpress/compare/2.2.2...HEAD
[unreleased]: https://github.com/wp-pay-extensions/memberpress/compare/2.2.3...HEAD
[2.2.3]: https://github.com/wp-pay-extensions/memberpress/compare/2.2.2...2.2.3
[2.2.2]: https://github.com/wp-pay-extensions/memberpress/compare/2.2.1...2.2.2
[2.2.1]: https://github.com/wp-pay-extensions/memberpress/compare/2.2.0...2.2.1
[2.2.0]: https://github.com/wp-pay-extensions/memberpress/compare/2.1.3...2.2.0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "memberpress",
"version": "2.2.2",
"version": "2.2.3",
"description": "MemberPress driver for the WordPress payment processing library.",
"repository": {
"type": "git",
Expand Down
6 changes: 5 additions & 1 deletion src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* WordPress pay MemberPress extension
*
* @author Remco Tolsma
* @version 2.0.4
* @version 2.2.3
* @since 1.0.0
*/
class Extension extends AbstractPluginIntegration {
Expand Down Expand Up @@ -494,6 +494,10 @@ public function memberpress_subscription_transition_status( $status_old, $status

$status = SubscriptionStatuses::transform( $status_new );

if ( null === $status ) {
return;
}

$subscription->set_status( $status );

$subscription->save();
Expand Down
17 changes: 14 additions & 3 deletions src/Gateways/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* WordPress pay MemberPress gateway
*
* @author Remco Tolsma
* @version 2.1.2
* @version 2.2.3
* @since 1.0.0
*/
class Gateway extends MeprBaseRealGateway {
Expand Down Expand Up @@ -734,7 +734,16 @@ public function display_payment_page( $txn ) {

$gateway = Plugin::get_gateway( $config_id );

if ( $gateway && '' === $gateway->get_input_html() ) {
// Check gateway.
if ( null === $gateway ) {
return;
}

$gateway->set_payment_method( $this->payment_method );

$html = $gateway->get_input_html();

if ( empty( $html ) ) {
$this->payment_redirect( $txn );
}
}
Expand Down Expand Up @@ -824,7 +833,9 @@ public function display_payment_form( $amount, $user, $product_id, $txn_id ) {

$gateway = Plugin::get_gateway( $config_id );

if ( $gateway ) {
if ( null !== $gateway ) {
$gateway->set_payment_method( $this->payment_method );

// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $gateway->get_input_html();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Pronamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
* Pronamic
*
* @author Remco Tolsma
* @version 2.0.10
* @version 2.2.3
* @since 2.0.5
*/
class Pronamic {
/**
* Get payment method icon URL.
*
* @param $method
* @param string $method Payment method.
* @return string
*/
public static function get_method_icon_url( $method ) {
Expand Down
5 changes: 4 additions & 1 deletion src/SubscriptionStatuses.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Subscription statuses
*
* @author Remco Tolsma
* @version 2.0.1
* @version 2.2.3
* @since 2.0.1
*/
class SubscriptionStatuses {
Expand All @@ -37,9 +37,12 @@ public static function transform( $status ) {
case MeprSubscription::$active_str:
return SubscriptionStatus::ACTIVE;
case MeprSubscription::$suspended_str:
// @todo set to 'On hold'?
return null;
case MeprSubscription::$cancelled_str:
return SubscriptionStatus::CANCELLED;
}

return null;
}
}

0 comments on commit 8093076

Please sign in to comment.