Show "Venmo" instead of "PayPal" when using its' button

This commit is contained in:
Alex P 2021-12-09 17:29:48 +02:00
parent cf5d1ec21f
commit f4a32a01e7
8 changed files with 155 additions and 161 deletions

View file

@ -40,6 +40,13 @@ class SessionHandler {
*/
private $insufficient_funding_tries = 0;
/**
* The funding source of the current checkout (venmo, ...) or null.
*
* @var string|null
*/
private $funding_source = null;
/**
* Returns the order.
*
@ -84,6 +91,28 @@ class SessionHandler {
return $this;
}
/**
* Returns the funding source of the current checkout (venmo, ...) or null.
*
* @return string|null
*/
public function funding_source(): ?string {
return $this->funding_source;
}
/**
* Replaces the funding source of the current checkout.
*
* @param string|null $funding_source The funding source.
*
* @return SessionHandler
*/
public function replace_funding_source( ?string $funding_source ): SessionHandler {
$this->funding_source = $funding_source;
$this->store_session();
return $this;
}
/**
* Returns how many times the customer tried to use the PayPal Gateway in this session.
*
@ -113,6 +142,7 @@ class SessionHandler {
$this->order = null;
$this->bn_code = '';
$this->insufficient_funding_tries = 0;
$this->funding_source = null;
$this->store_session();
return $this;
}