Skip to content

Commit d560320

Browse files
committed
use default values in test mode
1 parent b22d960 commit d560320

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

src/Payone/Gateway/GooglePay.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,31 @@ public function order_status_changed( \WC_Order $order, $from_status, $to_status
6767
}
6868

6969
public function get_googlepay_merchant_id() {
70-
return isset( $this->settings[ 'googlepay_merchant_id' ] ) ? $this->settings[ 'googlepay_merchant_id' ] : '';
70+
$default = '';
71+
if ( $this->get_mode() === 'test' ) {
72+
$default = $this->get_merchant_id();
73+
}
74+
75+
$value = isset( $this->settings[ 'googlepay_merchant_id' ] ) ? $this->settings[ 'googlepay_merchant_id' ] : '';
76+
if ( ! $value ) {
77+
$value = $default;
78+
}
79+
80+
return $value;
7181
}
7282

7383
public function get_googlepay_merchant_name() {
74-
return isset( $this->settings[ 'googlepay_merchant_name' ] ) ? $this->settings[ 'googlepay_merchant_name' ] : '';
84+
$default = '';
85+
if ( $this->get_mode() === 'test' ) {
86+
$default = 'payonegmbh';
87+
}
88+
89+
$value = isset( $this->settings[ 'googlepay_merchant_name' ] ) ? $this->settings[ 'googlepay_merchant_name' ] : '';
90+
if ( ! $value ) {
91+
$value = $default;
92+
}
93+
94+
return $value;
7595
}
7696

7797
protected function add_googlepay_merchant_info_fields() {

0 commit comments

Comments
 (0)