mirror of
https://github.com/standardebooks/web.git
synced 2025-07-19 04:44:48 -04:00
Correctly process matching donations from funds
This commit is contained in:
parent
daee86b919
commit
06096fa7dd
4 changed files with 19 additions and 14 deletions
|
@ -68,7 +68,6 @@ class Payment{
|
|||
if($this->User !== null && $this->User->Email !== null){
|
||||
try{
|
||||
$user = User::GetByEmail($this->User->Email);
|
||||
|
||||
// `User` exists, use their data.
|
||||
$user->Name = $this->User->Name;
|
||||
$this->User = $user;
|
||||
|
@ -82,8 +81,9 @@ class Payment{
|
|||
}
|
||||
catch(Exceptions\UserNotFoundException){
|
||||
// User doesn't exist, create it now.
|
||||
// Don't require an email address because we might be an anonymous `User`, or a matching donation from a fund.
|
||||
try{
|
||||
$this->User->Create();
|
||||
$this->User->Create(requireEmail: false);
|
||||
}
|
||||
catch(Exceptions\UserExistsException | Exceptions\InvalidUserException){
|
||||
// `User` already exists, pass.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue