Skip to content

Commit

Permalink
Update Gateway.php
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Oct 19, 2023
1 parent 127511d commit 3560964
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -702,26 +702,26 @@ private function maybe_update_access_token() {

$data = $this->client->get_access_token_data();

if ( isset( $data->token ) ) {
$this->config->access_token = $data->token;
$object_access = new ObjectAccess( $data );

\update_post_meta( $this->config->post_id, '_pronamic_gateway_omnikassa_2_access_token', $data->token );
if ( $object_access->has_property( 'token' ) ) {
$this->config->access_token = $object_access->get_string( 'token' );

\update_post_meta(
$this->config->post_id,
'_pronamic_gateway_omnikassa_2_access_token',
$this->config->access_token
);
}

/*
* @codingStandardsIgnoreStart
*
* Ignore coding standards because of sniff WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
*/
if ( isset( $data->validUntil ) ) {
$this->config->access_token_valid_until = $data->validUntil;
if ( $object_access->has_property( 'validUntil' ) ) {
$this->config->access_token_valid_until = $object_access->get_string( 'validUntil' );

\update_post_meta(
$this->config->post_id,
'_pronamic_gateway_omnikassa_2_access_token_valid_until',
$data->validUntil
$this->config->access_token_valid_until
);
}
// @codingStandardsIgnoreEnd
}
}

0 comments on commit 3560964

Please sign in to comment.