Check if the headers exist in the request

This commit is contained in:
Narek Zakarian 2025-03-21 19:09:37 +04:00
parent 2616974c12
commit 8490972513
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -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;