Skip to content

Commit 788bd16

Browse files
committed
📄 Add seller status filter documentation
1 parent 9ce786b commit 788bd16

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Seller Status Filter
2+
3+
## Overview
4+
Two WordPress filters allow external plugins to override or replace the PayPal merchant-integrations API response. This is useful when the API is unavailable (e.g., Stage environment returning 404) or when testing specific feature eligibility.
5+
6+
## Filters
7+
8+
### `woocommerce_paypal_payments_seller_status`
9+
Filters the `SellerStatus` object on every return from `PartnersEndpoint::seller_status()` — whether from cache or a fresh API call.
10+
11+
```php
12+
add_filter( 'woocommerce_paypal_payments_seller_status', function ( SellerStatus $status ): SellerStatus {
13+
// Modify and return.
14+
return $status;
15+
} );
16+
```
17+
18+
### `woocommerce_paypal_payments_seller_status_fallback`
19+
Provides a fallback `SellerStatus` when the API call fails. Return a `SellerStatus` to use it; return `null` to let the exception propagate.
20+
21+
```php
22+
add_filter( 'woocommerce_paypal_payments_seller_status_fallback', function () {
23+
return new SellerStatus( array(), array(), 'US' );
24+
} );
25+
```
26+
27+
## Example: Enable ACDC + Vaulting on Stage
28+
```php
29+
add_filter( 'woocommerce_paypal_payments_seller_status_fallback', function () {
30+
return new SellerStatus( array(), array(), 'US' );
31+
} );
32+
33+
add_filter( 'woocommerce_paypal_payments_seller_status', function ( SellerStatus $status ): SellerStatus {
34+
// Build modified products/capabilities and return a new SellerStatus.
35+
} );
36+
```

0 commit comments

Comments
 (0)