Skip to content

Commit

Permalink
Fix WC 2.6 compat with SEPA save payments token error closes #689
Browse files Browse the repository at this point in the history
  • Loading branch information
roykho committed Jun 20, 2018
1 parent 4eb0924 commit af9ce28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

= 4.1.8 - 2018-xx-xx =
* Fix - 3DS payment sometimes will create additional transaction in Stripe.
* Fix - WC 2.6 with SEPA saved payment causing error on checkout.

= 4.1.7 - 2018-06-06 =
* Fix - Asynchronous payment methods such as SEPA, did not show order Stripe fees/net after payment succeed.
Expand Down
4 changes: 2 additions & 2 deletions includes/class-wc-stripe-sepa-payment-token.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function validate() {
* @return string Last 4 digits
*/
public function get_last4( $context = 'view' ) {
return $this->get_prop( 'last4', $context );
return WC_Stripe_Helper::is_pre_30() ? $this->get_meta( 'last4' ) : $this->get_prop( 'last4', $context );
}

/**
Expand All @@ -96,6 +96,6 @@ public function get_last4( $context = 'view' ) {
* @param string $last4
*/
public function set_last4( $last4 ) {
$this->set_prop( 'last4', $last4 );
WC_Stripe_Helper::is_pre_30() ? $this->add_meta_data( 'last4', $last4, true ) : $this->set_prop( 'last4', $last4 );
}
}

0 comments on commit af9ce28

Please sign in to comment.