mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
✨ Extend context builder to set contact-preference
This commit is contained in:
parent
f300e10afb
commit
04c4d66889
1 changed files with 14 additions and 0 deletions
|
@ -161,6 +161,20 @@ class ExperienceContextBuilder {
|
|||
return $builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies a custom contact preference to the experience context.
|
||||
*
|
||||
* @param string|null $preference The new preference to apply.
|
||||
*/
|
||||
public function with_contact_preference( ?string $preference = null ) : ExperienceContextBuilder {
|
||||
$builder = clone $this;
|
||||
|
||||
$builder->experience_context = $builder->experience_context
|
||||
->with_contact_preference( $preference );
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ExperienceContext.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue