mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Add SellerStatus API caching.
Add GooglePay capability notice.
This commit is contained in:
parent
1581f34a44
commit
561d43baf6
7 changed files with 140 additions and 26 deletions
|
@ -136,15 +136,9 @@ class PartnersEndpoint {
|
|||
'response' => $response,
|
||||
)
|
||||
);
|
||||
|
||||
// Register the failure on api failure registry.
|
||||
$this->failure_registry->add_failure( FailureRegistry::SELLER_STATUS_KEY );
|
||||
|
||||
throw $error;
|
||||
}
|
||||
|
||||
$this->failure_registry->clear_failures( FailureRegistry::SELLER_STATUS_KEY );
|
||||
|
||||
$json = json_decode( wp_remote_retrieve_body( $response ) );
|
||||
$status_code = (int) wp_remote_retrieve_response_code( $response );
|
||||
if ( 200 !== $status_code ) {
|
||||
|
@ -157,9 +151,15 @@ class PartnersEndpoint {
|
|||
'response' => $response,
|
||||
)
|
||||
);
|
||||
|
||||
// Register the failure on api failure registry.
|
||||
$this->failure_registry->add_failure( FailureRegistry::SELLER_STATUS_KEY );
|
||||
|
||||
throw $error;
|
||||
}
|
||||
|
||||
$this->failure_registry->clear_failures( FailureRegistry::SELLER_STATUS_KEY );
|
||||
|
||||
$status = $this->seller_status_factory->from_paypal_reponse( $json );
|
||||
return $status;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue