mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Check if the headers
exist in the request
This commit is contained in:
parent
2616974c12
commit
8490972513
1 changed files with 4 additions and 0 deletions
|
@ -156,6 +156,10 @@ class ApiModule implements ServiceModule, ExtendingModule, ExecutableModule {
|
|||
$partner_attribution = $c->get( 'api.helper.partner-attribution' );
|
||||
assert( $partner_attribution instanceof PartnerAttribution );
|
||||
|
||||
if ( ! isset( $args['headers'] ) || ! is_array( $args['headers'] ) ) {
|
||||
$args['headers'] = array();
|
||||
}
|
||||
|
||||
$args['headers']['PayPal-Partner-Attribution-Id'] = $partner_attribution->get_bn_code();
|
||||
|
||||
return $args;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue