Skip to content

Commit

Permalink
SW-453: create Creditcard user attribute when missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Mueller committed Nov 11, 2024
1 parent 78fb0d9 commit de8d6f6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2056,9 +2056,10 @@ public function filterB2bPayments($payments)
*/
public function updateUserCreditcardInitialPaymentSuccess($userId, $success)
{
$user = Shopware()->Models()->getRepository('Shopware\Models\Customer\Customer')->find($userId);
$moptPayoneHelper = Shopware()->Container()->get('MoptPayoneMain')->getInstance()->getHelper();

$attributes = $user->getAttribute();
$user = Shopware()->Models()->getRepository('Shopware\Models\Customer\Customer')->find($userId);
$attributes = $moptPayoneHelper->getOrCreateUserAttribute($user);
$attributes->setMoptPayoneCreditcardInitialPayment($success);
Shopware()->Models()->persist($attributes);
Shopware()->Models()->flush($attributes);
Expand Down

0 comments on commit de8d6f6

Please sign in to comment.