Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /* __________________________________________________ | Obfuscated by YAK P..

Decoded Output download

<?php 
/*   __________________________________________________ 
    |  Obfuscated by YAK Pro - Php Obfuscator  2.0.3   | 
    |              on 2023-07-05 10:12:25              | 
    |    GitHub: https://github.com/pk-fr/yakpro-po    | 
    |__________________________________________________| 
*/ 
 
namespace Plugin\AmazonPayV2_42\Controller; 
 
use Eccube\Entity\Delivery; 
use Eccube\Entity\OrderItem; 
use Eccube\Repository\DeliveryRepository; 
use Eccube\Repository\Master\OrderStatusRepository; 
use Eccube\Repository\OrderRepository; 
use Eccube\Repository\TradeLawRepository; 
use Plugin\AmazonPayV2_42\Repository\ConfigRepository; 
use Plugin\AmazonPayV2_42\Service\AmazonOrderHelper; 
use Plugin\AmazonPayV2_42\Service\AmazonRequestService; 
use Plugin\AmazonPayV2_42\Service\Method\AmazonPay; 
use Eccube\Common\EccubeConfig; 
use Eccube\Controller\AbstractShoppingController; 
use Eccube\Entity\Order; 
use Eccube\Entity\Shipping; 
use Eccube\Entity\Master\OrderStatus; 
use Eccube\Form\Type\Shopping\OrderType; 
use Eccube\Repository\CustomerRepository; 
use Eccube\Repository\Master\PrefRepository; 
use Eccube\Repository\ProductClassRepository; 
use Eccube\Repository\PluginRepository; 
use Eccube\Service\CartService; 
use Eccube\Service\MailService; 
use Eccube\Service\OrderHelper; 
use Eccube\Service\PurchaseFlow\PurchaseContext; 
use Eccube\Service\PurchaseFlow\PurchaseFlow; 
use Eccube\Service\PurchaseFlow\Processor\AddPointProcessor; 
use Eccube\Service\PurchaseFlow\Processor\CustomerPurchaseInfoProcessor; 
use Plugin\AmazonPayV2_42\Exception\AmazonPaymentException; 
use Plugin\AmazonPayV2_42\Amazon\Pay\API\Client; 
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; 
use Symfony\Component\DependencyInjection\ContainerInterface; 
use Symfony\Component\Routing\Annotation\Route; 
use Symfony\Component\Form\FormInterface; 
use Symfony\Component\Form\FormError; 
use Symfony\Component\HttpFoundation\Request; 
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; 
use Symfony\Component\HttpFoundation\RedirectResponse; 
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; 
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; 
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface; 
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; 
use Symfony\Component\Routing\RouterInterface; 
use Symfony\Component\Validator\Validator\ValidatorInterface; 
use Symfony\Component\Validator\Constraints as Assert; 
use Doctrine\DBAL\LockMode; 
 
class AmazonShoppingController extends AbstractShoppingController 
{ 
    private $sessionAmazonProfileKey = 'amazon_pay_v2.profile'; 
    private $sessionAmazonCheckoutSessionIdKey = 'amazon_pay_v2.checkout_session_id'; 
    private $sessionAmazonCustomerParamKey = 'amazon_pay_v2.customer_regist_v2'; 
    private $sessionAmazonCustomerErrorKey = 'amazon_pay_v2.customer_regist_v2_error'; 
    private $sessionIsShippingRefresh = 'amazon_pay_v2.is_shipping_refresh'; 
    protected $validator; 
    protected $cartService; 
    protected $amazonOrderHelper; 
    protected $addPointProcessor; 
    protected $customerPurchaseInfoProcessor; 
    protected $serviceContainer; 
    protected TradeLawRepository $tradeLawRepository; 
 
    public function __construct(EccubeConfig $eccubeConfig, PurchaseFlow $cartPurchaseFlow, CartService $cartService, MailService $mailService, OrderHelper $orderHelper, CustomerRepository $customerRepository, OrderRepository $orderRepository, OrderStatusRepository $orderStatusRepository, PrefRepository $prefRepository, ProductClassRepository $productClassRepository, PluginRepository $pluginRepository, ConfigRepository $configRepository, AmazonOrderHelper $amazonOrderHelper, AmazonRequestService $amazonRequestService, ValidatorInterface $validator, EncoderFactoryInterface $encoderFactory, TokenStorageInterface $tokenStorage, DeliveryRepository $deliveryRepository, AddPointProcessor $addPointProcessor, CustomerPurchaseInfoProcessor $customerPurchaseInfoProcessor, TradeLawRepository $tradeLawRepository, ContainerInterface $serviceContainer) 
    { 
        goto Kd7yb; 
        MExLU: 
        $this->prefRepository = $prefRepository; 
        goto OoByP; 
        jQou0: 
        $this->validator = $validator; 
        goto wQxPa; 
        w17UN: 
        $this->deliveryRepository = $deliveryRepository; 
        goto DZVew; 
        d6ucV: 
        $this->Config = $configRepository->get(); 
        goto SGrSA; 
        i6IgP: 
        $this->cartService = $cartService; 
        goto psmsN; 
        A3Gpd: 
        $this->pluginRepository = $pluginRepository; 
        goto d6ucV; 
        SGrSA: 
        $this->amazonOrderHelper = $amazonOrderHelper; 
        goto Pz549; 
        psmsN: 
        $this->mailService = $mailService; 
        goto gBV8X; 
        m6oAa: 
        $this->purchaseFlow = $cartPurchaseFlow; 
        goto i6IgP; 
        Pz549: 
        $this->amazonRequestService = $amazonRequestService; 
        goto jQou0; 
        wQxPa: 
        $this->encoderFactory = $encoderFactory; 
        goto txclS; 
        DZVew: 
        $this->addPointProcessor = $addPointProcessor; 
        goto EYrdr; 
        P5EGq: 
        $this->orderRepository = $orderRepository; 
        goto TFwf0; 
        Kd7yb: 
        $this->eccubeConfig = $eccubeConfig; 
        goto m6oAa; 
        u1KUb: 
        $this->tradeLawRepository = $tradeLawRepository; 
        goto eCW8f; 
        EYrdr: 
        $this->customerPurchaseInfoProcessor = $customerPurchaseInfoProcessor; 
        goto u1KUb; 
        txclS: 
        $this->tokenStorage = $tokenStorage; 
        goto w17UN; 
        gBV8X: 
        $this->orderHelper = $orderHelper; 
        goto y3RLg; 
        y3RLg: 
        $this->customerRepository = $customerRepository; 
        goto P5EGq; 
        OoByP: 
        $this->productClassRepository = $productClassRepository; 
        goto A3Gpd; 
        eCW8f: 
        $this->serviceContainer = $serviceContainer; 
        goto h4BE_; 
        TFwf0: 
        $this->orderStatusRepository = $orderStatusRepository; 
        goto MExLU; 
        h4BE_: 
    } 
 
    /** 
     * @Route("/shopping/amazon_pay", name="amazon_pay_shopping") 
     * @Template("Shopping/index.twig") 
     * 
     * @param Request $request 
     */ 
    public function index(Request $request, PurchaseFlow $cartPurchaseFlow) 
    { 
        logs('amazon_pay_v2')->info('AmazonShopping::index start.'); 
        $Cart = $this->cartService->getCart(); 
        if ($Cart && $this->orderHelper->verifyCart($Cart)) { 
            goto KXo5W; 
        } 
        goto rtUCl; 
        ch5EM: 
        $form->handleRequest($request); 
        goto MILwl; 
        tarMb: 
        logs('amazon_pay_v2')->info('[] Warning.', [$flowResult->getWarning()]); 
        goto xKGCz; 
        vIDEM: 
        $Customer = $this->getUser() ? $this->getUser() : $this->amazonOrderHelper->getOrderer($checkoutSession->shippingAddress); 
        goto L3LVN; 
        SpQwO: 
        foreach ($arrAmazonCustomerError as $key => $val) { 
            $form[$key]->addError(new FormError($val)); 
            GqYl0: 
        } 
        goto Njt0Q; 
        WZLQG: 
        return ['form' => $form->createView(), 'Order' => $Order, 'AmazonCustomer' => $arrAmazonCustomerParam, 'AmazonPaymentDescriptor' => $checkoutSession->paymentPreferences[0]->paymentDescriptor, 'AmazonShippingAddress' => $checkoutSession->shippingAddress, 'activeTradeLaws' => $activeTradeLaws]; 
        goto emwlJ; 
        Nx7WX: 
        if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { 
            goto vtziA; 
        } 
        goto tA7Ev; 
        zep2W: 
        if (!($checkoutSession && $checkoutSession->statusDetails->state !== 'Open')) { 
            goto jIJgx; 
        } 
        goto wkuhn; 
        Yp4TK:R6HuP: 
        goto bYHkY; 
        G4xsu: 
        $arrAmazonCustomerParam = ['customer_regist_v2' => true, 'mail_magazine' => true, 'login_check_v2' => 'regist', 'amazon_login_email_v2' => null, 'amazon_login_password_v2' => null]; 
        goto NCJVy; 
        fcxAn: 
        $arrAmazonCustomerParam['mail_magazine'] = false; 
        goto ZhaV3; 
        iumdF: 
        goto R6HuP; 
        goto lUfnk; 
        wZRYy: 
        $this->session->set(OrderHelper::SESSION_NON_MEMBER, $Customer); 
        goto kMpn0; 
        itei1: 
        if (!$flowResult->hasError()) { 
            goto T97ue; 
        } 
        goto slt5F; 
        cZvmt: 
        $activeTradeLaws = $this->tradeLawRepository->findBy(['displayOrderScreen' => true], ['sortNo' => 'ASC']); 
        goto ch5EM; 
        NioNr: 
        $this->entityManager->flush(); 
        goto DmXXy; 
        XtSqj:N9ExI: 
        goto cZvmt; 
        GuGUi:UsOMX: 
        goto dxE5X; 
        oJKKD: 
        $Shippings = $Order->getShippings(); 
        goto BMjOt; 
        i1pb2: 
        if (!($AmazonDefaultDelivery === false)) { 
            goto ksEDp; 
        } 
        goto s7h1C; 
        hlGbx: 
        return $this->redirectToRoute('shopping_error'); 
        goto DmD_R; 
        EOKZJ: 
        $initOrderFlg = true; 
        goto iumdF; 
        tA7Ev: 
        $this->setAmazonCustomerData($form, $arrAmazonCustomerParam); 
        goto b3kDJ; 
        L3LVN: 
        if ($this->isGranted('ROLE_USER')) { 
            goto YpC99; 
        } 
        goto wZRYy; 
        sefbj: 
        if (!$this->session->get($this->sessionIsShippingRefresh)) { 
            goto nf3eB; 
        } 
        goto oJKKD; 
        sYRrK: 
        $this->session->remove($this->sessionIsShippingRefresh); 
        goto EvnWA; 
        n5HGQ: 
        if (!$flowResult->hasWarning()) { 
            goto Cjwl3; 
        } 
        goto tarMb; 
        PcHDr: 
        $Cart = $this->cartService->getCart(); 
        goto Xxs09; 
        WBwdh: 
        if (!$Order->isMultiple()) { 
            goto g84gp; 
        } 
        goto wKNIl; 
        b3kDJ:vtziA: 
        goto Z5lq1; 
        LMV3w: 
        $this->cartService->save(); 
        goto nsDJV; 
        DmXXy:WnKg2: 
        goto OBF85; 
        oreFN: 
        $Shipping->setShippingDeliveryName($AmazonDefaultDelivery->getName()); 
        goto NioNr; 
        MILwl: 
        logs('amazon_pay_v2')->info('AmazonShopping::index end.'); 
        goto WZLQG; 
        bYHkY: 
        $Order = $this->orderHelper->initializeOrder($Cart, $Customer); 
        goto pCX4a; 
        SL21B: 
        $checkoutSession = $this->amazonRequestService->getCheckoutSession($amazonCheckoutSessionId); 
        goto zep2W; 
        gIbPH: 
        $arrAmazonCustomerParam['customer_regist_v2'] = false; 
        goto GuGUi; 
        OBF85: 
        $Order = $this->amazonOrderHelper->initializeAmazonOrder($Order, $Customer); 
        goto sefbj; 
        mBoDW: 
        $this->entityManager->flush(); 
        goto itei1; 
        kMpn0:YpC99: 
        goto MTeUD; 
        DgjS5: 
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]); 
        goto GHduI; 
        NCJVy: 
        goto MKtg6; 
        goto F885H; 
        BMjOt: 
        $this->amazonOrderHelper->convert($Shippings->first(), $checkoutSession->shippingAddress); 
        goto BB3UI; 
        s7h1C: 
        $this->addError('Amazon Pay'); 
        goto ELoB2; 
        ZTPp3: 
        if ($Order = $this->orderHelper->getPurchaseProcessingOrder($Cart->getPreOrderId())) { 
            goto OrfdQ; 
        } 
        goto EOKZJ; 
        ELoB2:ksEDp: 
        goto HAvLu; 
        Vwlfh: 
        $amazonCheckoutSessionId = $this->session->get($this->sessionAmazonCheckoutSessionIdKey); 
        goto SL21B; 
        slt5F: 
        logs('amazon_pay_v2')->info('[] Error.', [$flowResult->getErrors()]); 
        goto hlGbx; 
        lUfnk:OrfdQ: 
        goto WBwdh; 
        seCby: 
        $AmazonDefaultDelivery = $this->getAmazonPayDefaultDelivery($Shipping); 
        goto i1pb2; 
        ZhaV3:yDROr: 
        goto Lu3Kj; 
        F885H:eT8Hz: 
        goto POlF3; 
        xKGCz: 
        $cartPurchaseFlow->validate($Cart, new PurchaseContext()); 
        goto LMV3w; 
        rtUCl: 
        logs('amazon_pay_v2')->info('[] , .'); 
        goto GwtFy; 
        Lu3Kj:MKtg6: 
        goto mUWKN; 
        BB3UI: 
        $Shippings->first()->setCompanyName(''); 
        goto Bd9zN; 
        wKNIl: 
        $Cart->setPreOrderId(null); 
        goto U2HwJ; 
        sPti2: 
        logs('amazon_pay_v2')->info('[] .'); 
        goto vIDEM; 
        DmD_R:T97ue: 
        goto n5HGQ; 
        vXhcT:jIJgx: 
        goto sPti2; 
        dxE5X: 
        if (!empty($arrAmazonCustomerParam['mail_magazine'])) { 
            goto yDROr; 
        } 
        goto fcxAn; 
        Kd2Ef: 
        $this->session->set($this->sessionAmazonCustomerErrorKey, null); 
        goto XtSqj; 
        FTw8u: 
        if ($amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey)) { 
            goto eT8Hz; 
        } 
        goto G4xsu; 
        mUWKN: 
        $form = $this->createForm(OrderType::class, $Order); 
        goto Nx7WX; 
        dT4TB: 
        return $this->redirectToRoute('shopping_error'); 
        goto vXhcT; 
        U2HwJ:g84gp: 
        goto Yp4TK; 
        POlF3: 
        $arrAmazonCustomerParam = unserialize($amazonCustomerParam); 
        goto vnRr0; 
        Vr3uW: 
        $Shipping->setDelivery($AmazonDefaultDelivery); 
        goto oreFN; 
        EvnWA:nf3eB: 
        goto DgjS5; 
        fwA4E:KXo5W: 
        goto Vwlfh; 
        Njt0Q:O44Zl: 
        goto Kd2Ef; 
        wkuhn: 
        logs('amazon_pay_v2')->info('[] CheckoutSessionOpen.', ['CheckoutSessionId => $amazonCheckoutSessionId']); 
        goto bmkmp; 
        nsDJV:Cjwl3: 
        goto FTw8u; 
        zc8QX: 
        $arrAmazonCustomerError = unserialize($amazonCustomerError); 
        goto SpQwO; 
        pCX4a: 
        $Shipping = $Order->getShippings()->first(); 
        goto seCby; 
        MTeUD: 
        $initOrderFlg = false; 
        goto ZTPp3; 
        HAvLu: 
        if (!($initOrderFlg && $AmazonDefaultDelivery)) { 
            goto WnKg2; 
        } 
        goto Vr3uW; 
        GHduI: 
        $flowResult = $this->executePurchaseFlow($Order, false); 
        goto mBoDW; 
        Z5lq1: 
        if (!($amazonCustomerError = $this->session->get($this->sessionAmazonCustomerErrorKey))) { 
            goto N9ExI; 
        } 
        goto zc8QX; 
        Bd9zN: 
        $this->entityManager->flush(); 
        goto sYRrK; 
        bmkmp: 
        $this->session->remove($this->sessionAmazonCheckoutSessionIdKey); 
        goto dT4TB; 
        vnRr0: 
        if (!empty($arrAmazonCustomerParam['customer_regist_v2'])) { 
            goto UsOMX; 
        } 
        goto gIbPH; 
        GwtFy: 
        return $this->redirectToRoute('cart'); 
        goto fwA4E; 
        emwlJ: 
    } 
 
    /** 
     *  
     * 
     * @Route("/shopping/amazon_pay/confirm", name="amazon_pay_shopping_confirm", methods={"POST"}) 
     * @Template("Shopping/confirm.twig") 
     */ 
    public function confirm(Request $request) 
    { 
        goto X0h_3; 
        nchAy: 
        $paymentMethod = $this->createPaymentMethod($Order, $form); 
        goto ipRI2; 
        ipRI2: 
        $PaymentResult = $paymentMethod->verify(); 
        goto oeuLQ; 
        gGFiJ: 
        logs('amazon_pay_v2')->info('[] , .'); 
        goto v3JMK; 
        d2a10:ZlO1c: 
        goto MR0xl; 
        UA04F: 
        $preOrderId = $this->cartService->getPreOrderId(); 
        goto BP8f2; 
        MUqeb:GdFTe: 
        goto d2a10; 
        d6D0R: 
        logs('amazon_pay_v2')->info('[] PaymentMethod::verify.', [$Order->getPayment()->getMethodClass()]); 
        goto nchAy; 
        BP8f2: 
        $Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId); 
        goto faeyl; 
        YHpWn: 
        $this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam)); 
        goto Jreks; 
        MR0xl: 
        $this->entityManager->flush(); 
        goto FnHDF; 
        Ypyjn: 
        return $this->redirectToRoute('shopping_error'); 
        goto EDfou; 
        H5htw: 
        $this->entityManager->flush(); 
        goto pAVjQ; 
        IO_1C: 
        logs('amazon_pay_v2')->info('[] .'); 
        goto P2Fzq; 
        rY3vG: 
        $Cart = $this->cartService->getCart(); 
        goto wO0Id; 
        FrMIx: 
        if (!($response && ($response->isRedirection() || $response->getContent()))) { 
            goto GdFTe; 
        } 
        goto H5htw; 
        wO0Id: 
        if ($Cart && $this->orderHelper->verifyCart($Cart)) { 
            goto toETf; 
        } 
        goto gGFiJ; 
        FnHDF: 
        $activeTradeLaws = $this->tradeLawRepository->findBy(['displayOrderScreen' => true], ['sortNo' => 'ASC']); 
        goto IO_1C; 
        MjvNR:Jo2yS: 
        goto DPjPD; 
        v3JMK: 
        return $this->redirectToRoute('cart'); 
        goto fA12K; 
        X0h_3: 
        logs('amazon_pay_v2')->info('AmazonShopping::confirm start.'); 
        goto rY3vG; 
        uoyH2: 
        $arrAmazonCustomerParam = $this->getAmazonCustomerParam($request); 
        goto YHpWn; 
        fA12K:toETf: 
        goto UA04F; 
        mtmKD:OXgBG: 
        goto CldvK; 
        J0iWP:sDfZX: 
        goto ehpNt; 
        htom1: 
        if ($PaymentResult->isSuccess()) { 
            goto Jo2yS; 
        } 
        goto H1cAr; 
        CldvK: 
        logs('amazon_pay_v2')->info('[] , ', [$Order->getId()]); 
        goto lTyaL; 
        d80mw:dvtR1: 
        goto d6D0R; 
        R8WJG:JOdgI: 
        goto adgLD; 
        REeGW: 
        if (!($form->isSubmitted() && $form->isValid())) { 
            goto OXgBG; 
        } 
        goto ZXbXH; 
        oeuLQ: 
        if (!$PaymentResult) { 
            goto ZlO1c; 
        } 
        goto htom1; 
        YnVWX: 
        if (!($arrAmazonCustomerError = $this->checkAmazonCustomerError($request, $form, $Order))) { 
            goto eE0Y8; 
        } 
        goto s95_B; 
        adgLD: 
        logs('amazon_pay_v2')->info('[] PaymentMethod::verify, .', [$PaymentResult->getErrors()]); 
        goto pdYOU; 
        bzPm9: 
        return $this->redirectToRoute('amazon_pay_shopping'); 
        goto d80mw; 
        B293x: 
        return $response; 
        goto MUqeb; 
        ehpNt: 
        $form->handleRequest($request); 
        goto YnVWX; 
        VSZML: 
        logs('amazon_pay_v2')->info('[] .'); 
        goto Ypyjn; 
        owKnV: 
        $this->entityManager->flush(); 
        goto XfXex; 
        lUoiu: 
        if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { 
            goto sDfZX; 
        } 
        goto jPsfJ; 
        rANA1: 
        $response = $this->executePurchaseFlow($Order); 
        goto owKnV; 
        e1Xks: 
        foreach ($PaymentResult->getErrors() as $error) { 
            $this->addError($error); 
            OyDzV: 
        } 
        goto R8WJG; 
        XfXex: 
        if (!$response) { 
            goto dvtR1; 
        } 
        goto bzPm9; 
        BSwyD:eE0Y8: 
        goto REeGW; 
        s95_B: 
        $this->session->set($this->sessionAmazonCustomerErrorKey, serialize($arrAmazonCustomerError)); 
        goto hIPdv; 
        pdYOU: 
        return $this->redirectToRoute('amazon_pay_shopping'); 
        goto MjvNR; 
        Jreks: 
        $form = $this->createForm(OrderType::class, $Order); 
        goto lUoiu; 
        faeyl: 
        if ($Order) { 
            goto NN5BD; 
        } 
        goto VSZML; 
        pAVjQ: 
        logs('amazon_pay_v2')->info('[] PaymentMethod::verify.'); 
        goto B293x; 
        lTyaL: 
        return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307); 
        goto w45YS; 
        ZXbXH: 
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]); 
        goto rANA1; 
        jPsfJ: 
        $this->setAmazonCustomerData($form, $arrAmazonCustomerParam); 
        goto J0iWP; 
        EDfou:NN5BD: 
        goto uoyH2; 
        P2Fzq: 
        return ['form' => $form->createView(), 'Order' => $Order, 'activeTradeLaws' => $activeTradeLaws]; 
        goto mtmKD; 
        DPjPD: 
        $response = $PaymentResult->getResponse(); 
        goto FrMIx; 
        H1cAr: 
        $this->entityManager->rollback(); 
        goto e1Xks; 
        hIPdv: 
        return $this->redirectToRoute('amazon_pay_shopping'); 
        goto BSwyD; 
        w45YS: 
    } 
 
    /** 
     *  
     * 
     * @Route("/shopping/amazon_pay/checkout", name="amazon_pay_shopping_checkout", methods={"POST"}) 
     * @Template("Shopping/index.twig") 
     */ 
    public function checkout(Request $request) 
    { 
        goto MqNjp; 
        qcYUH:MnfR_: 
        goto dUGGn; 
        Td5l2:SCPs7: 
        goto Pql17; 
        RBYTD: 
        $this->addError($errMessage); 
        goto tIYbU; 
        DSCo5: 
        if ($this->amazonOrderHelper->checkShippingPref($checkoutSession->shippingAddress)) { 
            goto FhXLL; 
        } 
        goto IO6Rg; 
        Jk2M0: 
        $checkoutSession = $this->amazonRequestService->getCheckoutSession($amazonCheckoutSessionId); 
        goto QqMt2; 
        gwg1O: 
        logs('amazon_pay_v2')->info('[] , .'); 
        goto PfjOy; 
        BAJwL: 
        if ($Cart && $this->orderHelper->verifyCart($Cart)) { 
            goto RSSmP; 
        } 
        goto gwg1O; 
        yE3fC: 
        $form->handleRequest($request); 
        goto eJWPc; 
        dA2YP: 
        $amazonCheckoutSessionId = $this->session->get($this->sessionAmazonCheckoutSessionIdKey); 
        goto Jk2M0; 
        NvXdd: 
        $Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId); 
        goto OG8VR; 
        eGqyR: 
        return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307); 
        goto R8Vpz; 
        W0JMH: 
        goto iDmc_; 
        goto GhnJS; 
        GhnJS:ZrzSC: 
        goto ZADoR; 
        ZADoR:iDmc_: 
        goto DmxA8; 
        FbeRT: 
        if (!($checkoutSession && $checkoutSession->statusDetails->state !== 'Open')) { 
            goto NMTIX; 
        } 
        goto djB4G; 
        SKC0_: 
        return new RedirectResponse($checkoutSession->webCheckoutDetails->amazonPayRedirectUrl); 
        goto y5PyT; 
        dUGGn: 
        if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { 
            goto YmRob; 
        } 
        goto Z_blo; 
        Yiim9: 
        $Order->setAmazonPayV2SessionTemp(serialize($session_temp)); 
        goto hP2bF; 
        eKqT2: 
        $response = $this->executePurchaseFlow($Order); 
        goto ggNJn; 
        Pql17: 
        $checkoutSession = $this->amazonRequestService->updateCheckoutSession($Order, $amazonCheckoutSessionId); 
        goto sd76q; 
        d_Sob: 
        $this->addError(''); 
        goto oT_81; 
        tcOtD: 
        return $this->redirectToRoute('shopping_error'); 
        goto IaBpK; 
        CyEkM: 
        if (!($response = $paymentMethod->apply())) { 
            goto Hz57A; 
        } 
        goto Bx967; 
        tIYbU: 
        return $this->redirectToRoute('amazon_pay_shopping'); 
        goto Td5l2; 
        dV_n4:Hz57A: 
        goto eQ_5i; 
        jlgij: 
        logs('amazon_pay_v2')->error('reasonCode: ' . $checkoutSession->reasonCode . ' message: ' . $checkoutSession->message); 
        goto d_Sob; 
        sd76q: 
        if (!isset($checkoutSession->reasonCode)) { 
            goto OhlZl; 
        } 
        goto jlgij; 
        f3EwX: 
        return $this->redirectToRoute('amazon_pay_shopping'); 
        goto pPxNn; 
        BVmyn: 
        $paymentMethod = $this->createPaymentMethod($Order, $form); 
        goto OqUu7; 
        pPxNn:MGA_f: 
        goto BVmyn; 
        CQgzb:YmRob: 
        goto yE3fC; 
        QqMt2: 
        $shippingDifference = $this->checkShippingDifference($Order, $checkoutSession->shippingAddress); 
        goto vV6TG; 
        DmxA8: 
        if (!($form->isSubmitted() && $form->isValid())) { 
            goto lCq3g; 
        } 
        goto cXT1D; 
        R2piH:SfOPl: 
        goto W0JMH; 
        OG8VR: 
        if ($Order) { 
            goto TlhPu; 
        } 
        goto l_Id9; 
        SgAno: 
        $this->session->set($this->sessionAmazonCustomerErrorKey, serialize($arrAmazonCustomerError)); 
        goto i9PVG; 
        lgFMq: 
        $Cart = $this->cartService->getCart(); 
        goto BAJwL; 
        i9PVG: 
        return $this->redirectToRoute('amazon_pay_shopping'); 
        goto R2piH; 
        aORS0: 
        return $this->redirectToRoute('shopping_error'); 
        goto LZedr; 
        PfjOy: 
        return $this->redirectToRoute('cart'); 
        goto gAuW6; 
        hP2bF: 
        $this->entityManager->flush(); 
        goto SKC0_; 
        eJWPc: 
        if ($this->Config->getUseConfirmPage() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on']) { 
            goto ZrzSC; 
        } 
        goto aDeES; 
        Z_blo: 
        $this->setAmazonCustomerData($form, $arrAmazonCustomerParam); 
        goto CQgzb; 
        vpbeQ: 
        $arrAmazonCustomerParam = unserialize($amazonCustomerParam); 
        goto tcAA9; 
        OqUu7: 
        logs('amazon_pay_v2')->info('[] PaymentMethod::apply.'); 
        goto CyEkM; 
        FX3dF: 
        logs('amazon_pay_v2')->error('orderId: ' . $Order->getId() . ' message: ' . $errMessage); 
        goto RBYTD; 
        tEcNQ: 
        goto MnfR_; 
        goto Us9ck; 
        gAuW6:RSSmP: 
        goto Adqd7; 
        N7kWx: 
        $arrAmazonCustomerParam = $this->getAmazonCustomerParam($request); 
        goto b_jdw; 
        Bx967: 
        return $response; 
        goto dV_n4; 
        EQfAw:OhlZl: 
        goto xN3Zx; 
        bDv9Y: 
        $form = $this->createForm(OrderType::class, $Order); 
        goto qcYUH; 
        IO6Rg: 
        $this->addError('amazon_pay_v2.front.shopping.undefined_pref_error'); 
        goto xpKyU; 
        l_Id9: 
        logs('amazon_pay_v2')->info('[] .'); 
        goto xbusr; 
        xN3Zx: 
        logs('amazon_pay_v2')->info('', [$Order->getId()]); 
        goto eKqT2; 
        eQ_5i: 
        $session_temp = ['IS_AUTHENTICATED_FULLY' => $this->isGranted('IS_AUTHENTICATED_FULLY'), $this->sessionAmazonCheckoutSessionIdKey => $amazonCheckoutSessionId, $this->sessionAmazonProfileKey => unserialize($this->session->get($this->sessionAmazonProfileKey)), $this->sessionAmazonCustomerParamKey => unserialize($this->session->get($this->sessionAmazonCustomerParamKey))]; 
        goto Yiim9; 
        b_jdw: 
        $this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam)); 
        goto bDv9Y; 
        Adqd7: 
        $preOrderId = $this->cartService->getPreOrderId(); 
        goto NvXdd; 
        yca1r: 
        logs('amazon_pay_v2')->info('', [$Order->getId()]); 
        goto eGqyR; 
        LZedr:FhXLL: 
        goto FbeRT; 
        b2CSv: 
        if ($this->Config->getUseConfirmPage() == $this->eccubeConfig['amazon_pay_v2']['toggle']['off']) { 
            goto pchoj; 
        } 
        goto T8Ds3; 
        xpKyU: 
        logs('amazon_pay_v2')->error('[] ', [$Order->getId()]); 
        goto aORS0; 
        FdNEO: 
        $this->session->set($this->sessionIsShippingRefresh, true); 
        goto LTw5v; 
        cXT1D: 
        if (!($Order->getPaymentTotal() == 0)) { 
            goto SCPs7; 
        } 
        goto lklO6; 
        ggNJn: 
        $this->entityManager->flush(); 
        goto d6iXp; 
        T8Ds3: 
        $amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey); 
        goto vpbeQ; 
        LTw5v: 
        return $this->redirectToRoute('amazon_pay_shopping'); 
        goto Z3AaJ; 
        IaBpK:NMTIX: 
        goto b2CSv; 
        Us9ck:pchoj: 
        goto N7kWx; 
        y5PyT:lCq3g: 
        goto yca1r; 
        lklO6: 
        $errMessage = AmazonPaymentException::$errorMessages[AmazonPaymentException::ZERO_PAYMENT]; 
        goto FX3dF; 
        aDeES: 
        if (!($arrAmazonCustomerError = $this->checkAmazonCustomerError($request, $form, $Order))) { 
            goto SfOPl; 
        } 
        goto SgAno; 
        d6iXp: 
        if (!$response) { 
            goto MGA_f; 
        } 
        goto f3EwX; 
        MqNjp: 
        logs('amazon_pay_v2')->info('AmazonShopping::order start.'); 
        goto lgFMq; 
        oT_81: 
        return $this->redirectToRoute('amazon_pay_shopping'); 
        goto EQfAw; 
        vV6TG: 
        if (!$shippingDifference) { 
            goto EPemR; 
        } 
        goto FdNEO; 
        Z3AaJ:EPemR: 
        goto DSCo5; 
        tcAA9: 
        $form = $this->createForm(OrderType::class, $Order, ['skip_add_form' => true]); 
        goto tEcNQ; 
        xbusr: 
        return $this->redirectToRoute('shopping_error'); 
        goto lyefR; 
        r073g: 
        $this->session->remove($this->sessionAmazonCheckoutSessionIdKey); 
        goto tcOtD; 
        djB4G: 
        logs('amazon_pay_v2')->info('[] CheckoutSessionOpen.', ['CheckoutSessionId => $amazonCheckoutSessionId']); 
        goto r073g; 
        lyefR:TlhPu: 
        goto dA2YP; 
        R8Vpz: 
    } 
 
    /** 
     *  
     * 
     * @Route("/shopping/amazon_pay/checkout_result", name="amazon_pay_shopping_checkout_result") 
     */ 
    public function checkoutResult(Request $request) 
    { 
        goto JJlBg; 
        MnUx3: 
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]); 
        goto FKuvw; 
        JJlBg: 
        $preOrderId = $this->cartService->getPreOrderId(); 
        goto kw6DL; 
        jBkGa: 
        goto NQhYS; 
        goto CDdWl; 
        CDdWl:Isflu: 
        goto IdwGK; 
        kvcMx: 
        logs('amazon_pay_v2')->info('AmazonShopping::complete_order end.'); 
        goto OlQg_; 
        TkMl3: 
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]); 
        goto nmj0p; 
        KFNU5: 
        logs('amazon_pay_v2')->info('[] . .', [$Order->getId()]); 
        goto TT4vG; 
        Pb93B: 
        $this->session->set($this->sessionAmazonCustomerErrorKey, null); 
        goto KFNU5; 
        N313x: 
        $amazonCheckoutSessionId = $request->get('amazonCheckoutSessionId'); 
        goto vOseC; 
        G7ptX: 
        $this->entityManager->flush(); 
        goto MnUx3; 
        BLu9N: 
        try { 
            goto yTgOQ; 
            jayrb:Mipxs: 
            goto f6_BX; 
            FbWuA: 
            $mail_message = <<<__EOS__ 
************************************************ 
 
************************************************ 
URL{$url} 
{$mail} 
{$password} 
 
__EOS__; 
            goto nyllz; 
            jKMU0: 
            $Customers = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]); 
            goto tWbRT; 
            j3hd1: 
            if (!($Order['update_date'] != $LockedOrder['update_date'])) { 
                goto Mipxs; 
            } 
            goto tcg0u; 
            wvF5W: 
            if ($amazonDtbCustomer) { 
                goto avgHa; 
            } 
            goto hgO7Q; 
            C3kn4: 
            $LockedOrder = $this->orderRepository->find($Order['id'], LockMode::PESSIMISTIC_WRITE); 
            goto ABh9X; 
            M0mtg: 
            goto nILAg; 
            goto PfJ6x; 
            RHnQQ:nILAg: 
            goto BrD6R; 
            ILdMJ:SGf52: 
            goto KpvDV; 
            hU3de: 
            $Order->setCustomer($Customer); 
            goto ee8_C; 
            cSojc: 
            $result = $this->abortCheckoutResult($Order); 
            goto kkuJC; 
            kkuJC: 
            $this->entityManager->flush(); 
            goto m5KwG; 
            w0pwf:ux3Rz: 
            goto vs1Xg; 
            HcooX: 
            $Customer = $Order->getCustomer(); 
            goto ciArF; 
            ciArF: 
            $Customers = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]); 
            goto YD3W4; 
            YD3W4: 
            if (!(!$Customer->getV2AmazonUserId() && empty($Customers[0]))) { 
                goto ux3Rz; 
            } 
            goto APBR_; 
            yNpTr: 
            if (!($response = $this->executeCheckout($paymentMethod, $Order))) { 
                goto oeVv6; 
            } 
            goto sK2F8; 
            YUpr2: 
            $form = $this->createForm(OrderType::class, $Order); 
            goto hzLv7; 
            FbWuX: 
            $mail = $Customer->getEmail(); 
            goto FbWuA; 
            FlJcv:PslpN: 
            goto M0mtg; 
            PfJ6x:Ht8dM: 
            goto oQIUG; 
            m5KwG: 
            $this->entityManager->commit(); 
            goto zPTgV; 
            xmj3B: 
            if ($dtbCustomer || $amazonDtbCustomer) { 
                goto kEo0y; 
            } 
            goto t560A; 
            l4Icb: 
            if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { 
                goto sLZp9; 
            } 
            goto dUCv9; 
            zPTgV: 
            return $result; 
            goto jayrb; 
            nf92j: 
            $this->entityManager->flush(); 
            goto OYpYh; 
            oQiLv:avgHa: 
            goto iLH4h; 
            FIYkI: 
            $Customer->setV2AmazonUserId($profile->buyerId); 
            goto ARkjX; 
            iLH4h: 
            $mail = $amazonDtbCustomer[0]->getEmail(); 
            goto ILdMJ; 
            f6_BX: 
            logs('amazon_pay_v2')->info('[] PaymentMethod::checkout.'); 
            goto yNpTr; 
            rjtYy:kEo0y: 
            goto wvF5W; 
            ABh9X: 
            logs('amazon_pay_v2')->info('$Order[update_date] is ' . $Order['update_date']->format('Y-m-d H:i:s.u') . ', $LockedOrder[update_date] is ' . $LockedOrder['update_date']->format('Y-m-d H:i:s.u')); 
            goto j3hd1; 
            oyXlZ: 
            logs('amazon_pay_v2')->info('', [$Order->getId()]); 
            goto v2idf; 
            tNpWY: 
            $Customer = $this->getUser(); 
            goto hU3de; 
            krHdX: 
            $amazonDtbCustomer = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]); 
            goto xmj3B; 
            hzLv7: 
            $paymentMethod = $this->createPaymentMethod($Order, $form, $amazonCheckoutSessionId); 
            goto Kba1L; 
            ARkjX:sXU0_: 
            goto PvR5v; 
            hgO7Q: 
            $mail = $dtbCustomer[0]->getEmail(); 
            goto hU03a; 
            hU03a: 
            goto SGf52; 
            goto oQiLv; 
            RDTCU: 
            if (!($arrAmazonCustomerParam['login_check_v2'] == 'login')) { 
                goto PslpN; 
            } 
            goto WTWJ0; 
            Kba1L: 
            $this->entityManager->beginTransaction(); 
            goto C3kn4; 
            HYaZb: 
            $this->addPointProcessor->validate($Order, new PurchaseContext()); 
            goto nf92j; 
            APBR_: 
            $Customer->setV2AmazonUserId($profile->buyerId); 
            goto w0pwf; 
            yTgOQ: 
            logs('amazon_pay_v2')->info('', [$Order->getId()]); 
            goto YUpr2; 
            oQIUG: 
            if (!$arrAmazonCustomerParam['customer_regist_v2']) { 
                goto YqeRx; 
            } 
            goto rocsf; 
            tWbRT: 
            if (!(!$Customer->getV2AmazonUserId() && empty($Customers[0]))) { 
                goto sXU0_; 
            } 
            goto FIYkI; 
            lamBL: 
            logs('amazon_pay_v2')->info('[] .', [$Order->getId()]); 
            goto oyXlZ; 
            vs1Xg:LXbz3: 
            goto FlJcv; 
            BrD6R: 
            goto deU7l; 
            goto HhK9M; 
            tcg0u: 
            logs('amazon_pay_v2')->info('[] '); 
            goto cSojc; 
            t560A: 
            $password = $this->amazonOrderHelper->registCustomer($Order, $arrAmazonCustomerParam['mail_magazine']); 
            goto tNpWY; 
            eQl1B:oeVv6: 
            goto l0obX; 
            ro74w:YqeRx: 
            goto RHnQQ; 
            HhK9M:sLZp9: 
            goto vVByz; 
            KpvDV: 
            $mail_message = <<<__EOS__ 
************************************************ 
 
************************************************ 
URL{$url} 
{$mail} 
 
__EOS__; 
            goto dNXf3; 
            nyllz: 
            goto PRRwA; 
            goto rjtYy; 
            dNXf3:PRRwA: 
            goto o2VND; 
            WTWJ0: 
            if (!$this->setLogin($request, $Order, $arrAmazonCustomerParam['amazon_login_email_v2'])) { 
                goto LXbz3; 
            } 
            goto HcooX; 
            FDb8w: 
            logs('amazon_pay_v2')->info('AddPointProcessor.', [$Order->getId()]); 
            goto HYaZb; 
            o2VND: 
            $Order->setCompleteMailMessage($mail_message); 
            goto ro74w; 
            rocsf: 
            $url = $this->generateUrl('mypage_login', [], UrlGeneratorInterface::ABSOLUTE_URL); 
            goto RBHEg; 
            vVByz: 
            $Customer = $this->getUser(); 
            goto jKMU0; 
            RBHEg: 
            $dtbCustomer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $Order->getEmail()]); 
            goto krHdX; 
            sK2F8: 
            return $response; 
            goto eQl1B; 
            PvR5v:deU7l: 
            goto FDb8w; 
            dUCv9: 
            if (empty($arrAmazonCustomerParam['login_check_v2']) || $arrAmazonCustomerParam['login_check_v2'] == 'regist') { 
                goto Ht8dM; 
            } 
            goto RDTCU; 
            l0obX: 
            $profile = unserialize($this->session->get($this->sessionAmazonProfileKey)); 
            goto l4Icb; 
            ee8_C: 
            $this->customerPurchaseInfoProcessor->commit($Order, new PurchaseContext()); 
            goto FbWuX; 
            OYpYh: 
            $this->entityManager->commit(); 
            goto lamBL; 
            v2idf: 
        } catch (ShoppingException $e) { 
            goto D2hr6; 
            K87Ht: 
            logs('amazon_pay_v2')->error('', [$e->getMessage()]); 
            goto eud9J; 
            lCrKr: 
            return $this->redirectToRoute('shopping_error'); 
            goto S1zSU; 
            hfHz5: 
            $this->entityManager->commit(); 
            goto lCrKr; 
            M2Pcm: 
            $this->entityManager->flush(); 
            goto hfHz5; 
            D2hr6: 
            $this->addError($e->getMessage()); 
            goto K87Ht; 
            eud9J: 
            $this->purchaseFlow->rollback($Order, new PurchaseContext()); 
            goto M2Pcm; 
            S1zSU: 
        } catch (AmazonPaymentException $e) { 
            goto zXQTD; 
            qP_38: 
            $this->entityManager->flush(); 
            goto mXsGR; 
            SXgtJ: 
            return $this->redirectToRoute('shopping_error'); 
            goto HcIE3; 
            mXsGR: 
            $this->entityManager->commit(); 
            goto SXgtJ; 
            zXQTD: 
            $this->addError($e->getMessage()); 
            goto P1pe0; 
            C0k53: 
            $this->purchaseFlow->rollback($Order, new PurchaseContext()); 
            goto qP_38; 
            P1pe0: 
            logs('amazon_pay_v2')->error($e->getMessage(), [$Order->getId()]); 
            goto C0k53; 
            HcIE3: 
        } catch (\Exception $e) { 
            goto uS97Y; 
            NUpB2: 
            $this->entityManager->flush(); 
            goto C3HOx; 
            uS97Y: 
            $this->addError('front.shopping.system_error'); 
            goto LyJey; 
            Znsb5: 
            return $this->redirectToRoute('shopping_error'); 
            goto tsQ47; 
            LyJey: 
            logs('amazon_pay_v2')->error('', [get_class($e), $e->getMessage()]); 
            goto QnWj7; 
            QnWj7: 
            $this->purchaseFlow->rollback($Order, new PurchaseContext()); 
            goto NUpB2; 
            C3HOx: 
            $this->entityManager->commit(); 
            goto Znsb5; 
            tsQ47: 
        } 
        goto kvcMx; 
        xECH3: 
        $this->entityManager->flush(); 
        goto KGZ1h; 
        KGZ1h: 
        $this->session->set($this->sessionAmazonCheckoutSessionIdKey, null); 
        goto Vf14m; 
        fFRNd: 
        return $result; 
        goto SOXz0; 
        TT4vG: 
        return $this->redirectToRoute('shopping_complete'); 
        goto nMySU; 
        vOseC: 
        $amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey); 
        goto qh23v; 
        kw6DL: 
        $Order = $this->orderRepository->findOneBy(['pre_order_id' => $preOrderId]); 
        goto X2dGk; 
        wJGz5: 
        $this->entityManager->flush(); 
        goto fFRNd; 
        HYCZL:GPwQO: 
        goto UVHkx; 
        IHOcM: 
        logs('amazon_pay_v2')->info('[] .'); 
        goto d876m; 
        IdwGK: 
        logs('amazon_pay_v2')->info('[] IPN.', [$Order->getId()]); 
        goto VCYNW; 
        WwNlU: 
        $Order->setAmazonPayV2SessionTemp(null); 
        goto xECH3; 
        Tuviy:Wq5px: 
        goto C1weU; 
        uJx_5: 
        $this->mailService->sendOrderMail($Order); 
        goto G7ptX; 
        J36WT:HRnro: 
        goto uJx_5; 
        nmj0p: 
        if (is_null($this->Config->getMailNotices())) { 
            goto HRnro; 
        } 
        goto DcpNK; 
        ZWQhM:NQhYS: 
        goto N313x; 
        DcpNK: 
        $Order->appendCompleteMailMessage("" . $this->Config->getMailNotices()); 
        goto J36WT; 
        qh23v: 
        $arrAmazonCustomerParam = unserialize($amazonCustomerParam); 
        goto BLu9N; 
        UVHkx: 
        logs('amazon_pay_v2')->info('[] .'); 
        goto vCgCe; 
        SOXz0: 
        goto NQhYS; 
        goto HYCZL; 
        C1weU: 
        if ($Order->getOrderStatus() == $this->orderStatusRepository->find(OrderStatus::NEW)) { 
            goto Isflu; 
        } 
        goto nQNYe; 
        VCYNW: 
        $result = $this->abortCheckoutResult($Order); 
        goto wJGz5; 
        Vf14m: 
        $this->session->set($this->sessionAmazonCustomerParamKey, null); 
        goto Pb93B; 
        FKuvw: 
        $this->cartService->clear(); 
        goto WwNlU; 
        nQNYe: 
        if ($Order->getOrderStatus() != $this->orderStatusRepository->find(OrderStatus::PENDING)) { 
            goto GPwQO; 
        } 
        goto jBkGa; 
        d876m: 
        return $this->redirectToRoute('shopping_error'); 
        goto Tuviy; 
        OlQg_: 
        $this->session->set(OrderHelper::SESSION_ORDER_ID, $Order->getId()); 
        goto TkMl3; 
        X2dGk: 
        if ($Order) { 
            goto Wq5px; 
        } 
        goto IHOcM; 
        vCgCe: 
        return $this->redirectToRoute('shopping_error'); 
        goto ZWQhM; 
        nMySU: 
    } 
 
    function abortCheckoutResult($Order) 
    { 
        goto hfrPs; 
        hfrPs: 
        $this->session->set(OrderHelper::SESSION_ORDER_ID, $Order->getId()); 
        goto ujTD2; 
        p_Xpd: 
        $Order->setAmazonPayV2SessionTemp(null); 
        goto WC7k5; 
        LNu2r: 
        $this->session->set($this->sessionAmazonCustomerErrorKey, null); 
        goto w0fON; 
        WC7k5: 
        $this->session->set($this->sessionAmazonCheckoutSessionIdKey, null); 
        goto rCAJy; 
        ujTD2: 
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]); 
        goto VM3nE; 
        w0fON: 
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]); 
        goto Sp2oF; 
        VM3nE: 
        $this->cartService->clear(); 
        goto p_Xpd; 
        Sp2oF: 
        return $this->redirectToRoute('shopping_complete'); 
        goto b1MT9; 
        rCAJy: 
        $this->session->set($this->sessionAmazonCustomerParamKey, null); 
        goto LNu2r; 
        b1MT9: 
    } 
 
    /** 
     * , . 
     * DB. 
     * 
     * @Route("/shopping/amazon_pay/redirect_to", name="amazon_pay_shopping_redirect_to", methods={"POST"}) 
     * @Template("Shopping/index.twig") 
     */ 
    public function redirectTo(Request $request, RouterInterface $router) 
    { 
        goto gR0fV; 
        MVnCI: 
        logs('amazon_pay_v2')->info('Warning.', [$flowResult->getWarning()]); 
        goto uYLn5; 
        TliqA: 
        if (!($form->isSubmitted() && $form->isValid())) { 
            goto njmQf; 
        } 
        goto zlcKZ; 
        oRfeD:R74mL: 
        goto pPOsh; 
        lChYp: 
        $redirectTo = $form['redirect_to']->getData(); 
        goto iGUUA; 
        G7bmu: 
        logs('amazon_pay_v2')->info('Error.', [$flowResult->getErrors()]); 
        goto xC_jd; 
        sqBMW: 
        $form->handleRequest($request); 
        goto TliqA; 
        zw60q: 
        if (!$flowResult->hasError()) { 
            goto JiSCY; 
        } 
        goto G7bmu; 
        TL4D4: 
        return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307); 
        goto Vrye8; 
        etrks:Tquyx: 
        goto WO8oM; 
        HTBRQ: 
        if ($Order) { 
            goto Tquyx; 
        } 
        goto KKmPe; 
        uYLn5: 
        return $this->redirectToRoute('amazon_pay_shopping'); 
        goto mbaDP; 
        zMYqC: 
        if (!$flowResult->hasWarning()) { 
            goto dP7uH; 
        } 
        goto MVnCI; 
        svCGn: 
        return $this->redirectToRoute('amazon_pay_shopping'); 
        goto oRfeD; 
        mbaDP:dP7uH: 
        goto lChYp; 
        pPOsh: 
        try { 
            goto eISYC; 
            FOZqE: 
            $result = $router->match($redirectTo); 
            goto eugT2; 
            eugT2: 
            return $this->forwardToRoute($result['_route']); 
            goto huw1S; 
            eISYC: 
            $pattern = '/^' . preg_quote($request->getBasePath(), '/') . '/'; 
            goto xJsDw; 
            xJsDw: 
            $redirectTo = preg_replace($pattern, '', $redirectTo); 
            goto FOZqE; 
            huw1S: 
        } catch (\Exception $e) { 
            logs('amazon_pay_v2')->info('[] URL', [$redirectTo, $e->getMessage()]); 
            return $this->redirectToRoute('shopping_error'); 
        } 
        goto IFDDe; 
        xC_jd: 
        return $this->redirectToRoute('shopping_error'); 
        goto bsX2z; 
        Xvs7s: 
        return $this->redirectToRoute('shopping_error'); 
        goto etrks; 
        WO8oM: 
        $form = $this->createForm(OrderType::class, $Order); 
        goto sqBMW; 
        zlcKZ: 
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]); 
        goto fxCQr; 
        XX29o: 
        logs('amazon_pay_v2')->info('[] , .', [$Order->getId()]); 
        goto TL4D4; 
        KKmPe: 
        logs('amazon_pay_v2')->info('[] .'); 
        goto Xvs7s; 
        gR0fV: 
        $preOrderId = $this->cartService->getPreOrderId(); 
        goto tn4s8; 
        lu1uv: 
        $this->entityManager->flush(); 
        goto zw60q; 
        pRKzs: 
        logs('amazon_pay_v2')->info('[] .'); 
        goto svCGn; 
        IFDDe:njmQf: 
        goto XX29o; 
        fxCQr: 
        $flowResult = $this->executePurchaseFlow($Order, false); 
        goto lu1uv; 
        tn4s8: 
        $Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId); 
        goto HTBRQ; 
        iGUUA: 
        if (!empty($redirectTo)) { 
            goto R74mL; 
        } 
        goto pRKzs; 
        bsX2z:JiSCY: 
        goto zMYqC; 
        Vrye8: 
    } 
 
    /** 
     * APIDB. 
     * 
     * @Route("/shopping/amazon_pay/order_save", name="amazon_pay_shopping_order_save", methods={"POST", "GET"}) 
     */ 
    public function orderSave(Request $request) 
    { 
        goto bOD8_; 
        HUe1c: 
        $this->entityManager->flush(); 
        goto WdEx2; 
        s0Tn1: 
        $form->handleRequest($request); 
        goto uAs5n; 
        AaqI7:KXYXc: 
        goto JIKYw; 
        WqxCb: 
        if (!$flowResult->hasWarning()) { 
            goto KXYXc; 
        } 
        goto NIxnU; 
        z1wzV: 
        $preOrderId = $this->cartService->getPreOrderId(); 
        goto l7Wby; 
        ztEAo: 
        logs('amazon_pay_v2')->info('executePurchaseFlowError.', [$flowResult->getErrors()]); 
        goto gU2_c; 
        JIKYw: 
        return $this->json([]); 
        goto QsZsk; 
        l7Wby: 
        $Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId); 
        goto EkfeD; 
        kTiTG: 
        return $this->json(['error' => 'validateError'], 500); 
        goto KNim3; 
        AQs1R:a_OKn: 
        goto GvKvx; 
        Xt5wm: 
        return $this->json(['error' => 'executePurchaseFlow::Warning'], 500); 
        goto AaqI7; 
        SIz68: 
        $this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam)); 
        goto hEUw_; 
        QsZsk:uFBMG: 
        goto aYoJZ; 
        EkfeD: 
        if ($Order) { 
            goto a_OKn; 
        } 
        goto m9WW7; 
        GvKvx: 
        $form = $this->createForm(OrderType::class, $Order); 
        goto s0Tn1; 
        uAs5n: 
        $arrAmazonCustomerParam = $this->getAmazonCustomerParam($request); 
        goto SIz68; 
        hro4e: 
        logs('amazon_pay_v2')->info('.', [$Order->getId()]); 
        goto WmI0K; 
        bOD8_: 
        if ($request->isXmlHttpRequest()) { 
            goto pFe26; 
        } 
        goto MOeYJ; 
        aYoJZ: 
        logs('amazon_pay_v2')->info('.'); 
        goto kTiTG; 
        Y4GYF:pFe26: 
        goto z1wzV; 
        AHzuh:zQaPb: 
        goto WqxCb; 
        m9WW7: 
        logs('amazon_pay_v2')->info('.'); 
        goto lbbQo; 
        lbbQo: 
        return $this->json(['error' => 'OrderNotFound'], 500); 
        goto AQs1R; 
        WdEx2: 
        if (!$flowResult->hasError()) { 
            goto zQaPb; 
        } 
        goto ztEAo; 
        gU2_c: 
        return $this->json(['error' => 'executePurchaseFlow::Error'], 500); 
        goto AHzuh; 
        WmI0K: 
        $flowResult = $this->executePurchaseFlow($Order, false); 
        goto HUe1c; 
        NIxnU: 
        logs('amazon_pay_v2')->info('executePurchaseFlowWarning.', [$flowResult->getWarning()]); 
        goto Xt5wm; 
        MOeYJ: 
        throw new BadRequestHttpException(); 
        goto Y4GYF; 
        hEUw_: 
        if (!($form->isSubmitted() && $form->isValid())) { 
            goto uFBMG; 
        } 
        goto hro4e; 
        KNim3: 
    } 
 
    private function createPaymentMethod(Order $Order, FormInterface $form, $amazonCheckoutSessionId = null) 
    { 
        goto jtu82; 
        jtu82: 
        $PaymentMethod = $this->serviceContainer->get($Order->getPayment()->getMethodClass()); 
        goto TBiii; 
        u2Ay6: 
        return $PaymentMethod; 
        goto NmH22; 
        XNMsv:k4gzT: 
        goto u2Ay6; 
        UU61s: 
        if (is_null($amazonCheckoutSessionId)) { 
            goto k4gzT; 
        } 
        goto qtKAs; 
        TBiii: 
        $PaymentMethod->setOrder($Order); 
        goto WeAFq; 
        qtKAs: 
        $PaymentMethod->setAmazonCheckoutSessionId($amazonCheckoutSessionId); 
        goto XNMsv; 
        WeAFq: 
        $PaymentMethod->setFormType($form); 
        goto UU61s; 
        NmH22: 
    } 
 
    protected function executeCheckout(AmazonPay $paymentMethod, Order $Order) 
    { 
        goto SMShg; 
        H3NJ4: 
        logs('amazon_pay_v2')->info('[] PaymentMethod::checkout, .', [$PaymentResult->getErrors()]); 
        goto X5HaZ; 
        rFVW8: 
        foreach ($PaymentResult->getErrors() as $error) { 
            $this->addError($error); 
            aTnSI: 
        } 
        goto WEnbd; 
        mv3LP: 
        $response = $PaymentResult->getResponse(); 
        goto An78P; 
        SMShg: 
        $PaymentResult = $paymentMethod->checkout(); 
        goto mv3LP; 
        X5HaZ: 
        return $this->redirectToRoute('shopping_error'); 
        goto RbdMl; 
        An78P: 
        if (!($response && ($response->isRedirection() || $response->getContent()))) { 
            goto I5gny; 
        } 
        goto nco0j; 
        RbdMl:n6TIe: 
        goto sVL0S; 
        IphrN: 
        if ($PaymentResult->isSuccess()) { 
            goto n6TIe; 
        } 
        goto n69Tx; 
        EqegQ:I5gny: 
        goto IphrN; 
        d6Q67: 
        return $response; 
        goto EqegQ; 
        nco0j: 
        $this->entityManager->flush(); 
        goto OfsLy; 
        OfsLy: 
        logs('amazon_pay_v2')->info('[] PaymentMethod::checkout.'); 
        goto d6Q67; 
        WEnbd:vzPge: 
        goto H3NJ4; 
        n69Tx: 
        $this->purchaseFlow->rollback($Order, new PurchaseContext()); 
        goto rFVW8; 
        sVL0S: 
    } 
 
    private function getAmazonCustomerParam($request) 
    { 
        goto bpbQ2; 
        s95Jr: 
        $mail_magazine = empty($request->get('_shopping_order')['mail_magazine']) ? false : true; 
        goto tbpt1; 
        oGxuE: 
        $amazon_login_email_v2 = empty($request->get('_shopping_order')['amazon_login_email_v2']) ? null : $request->get('_shopping_order')['amazon_login_email_v2']; 
        goto YDGqo; 
        RUJjg: 
        return ['customer_regist_v2' => $customer_regist_v2, 'mail_magazine' => $mail_magazine, 'login_check_v2' => $login_check_v2, 'amazon_login_email_v2' => $amazon_login_email_v2, 'amazon_login_password_v2' => $amazon_login_password_v2]; 
        goto IBRyS; 
        tbpt1: 
        $login_check_v2 = empty($request->get('_shopping_order')['login_check_v2']) ? null : $request->get('_shopping_order')['login_check_v2']; 
        goto oGxuE; 
        bpbQ2: 
        $customer_regist_v2 = empty($request->get('_shopping_order')['customer_regist_v2']) ? false : true; 
        goto s95Jr; 
        YDGqo: 
        $amazon_login_password_v2 = empty($request->get('_shopping_order')['amazon_login_password_v2']) ? null : $request->get('_shopping_order')['amazon_login_password_v2']; 
        goto RUJjg; 
        IBRyS: 
    } 
 
    private function checkAmazonCustomerError($request, $form, $Order) 
    { 
        goto O0x75; 
        Z8Nkc:Q6J2s: 
        goto BFDtj; 
        IGmk1: 
        $arrError['customer_regist_v2'] = ' ' . $Order->getEmail() . ''; 
        goto L_UuX; 
        ykaaK:qvmLu: 
        goto IGmk1; 
        O0x75: 
        $arrError = []; 
        goto ODqqR; 
        F1HZH: 
        foreach ($violations as $violation) { 
            $amazon_login_email_v2_error .= $violation->getMessage() . PHP_EOL; 
            PTVpX: 
        } 
        goto oKOJF; 
        Ha9kH: 
        if (!('POST' === $request->getMethod() && strpos($request_uri, 'shopping/amazon_pay/address') === false && strpos($request_uri, 'shopping/amazon_pay/delivery') === false)) { 
            goto guyRX; 
        } 
        goto EuaBm; 
        eXX1q:ocst0: 
        goto Q466b; 
        ODqqR: 
        if (!(!$this->isGranted('IS_AUTHENTICATED_FULLY') && $this->Config->getLoginRequired() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on'])) { 
            goto iJ1uw; 
        } 
        goto u7Vww; 
        qFwBx: 
        $profile = unserialize($this->session->get($this->sessionAmazonProfileKey)); 
        goto gCqIg; 
        K5ia8: 
        $Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $Order->getEmail()]); 
        goto qFwBx; 
        W2Gcl: 
        $arrError['amazon_login_password_v2'] = ' ' . $amazon_login_password_v2_error; 
        goto wVGXf; 
        bn4qb: 
        $arrError['amazon_login_email_v2'] = ' '; 
        goto eGUwb; 
        iDN79: 
        if (empty($AmazonCustomer[0])) { 
            goto pn4FT; 
        } 
        goto xZ_bq; 
        nVewU: 
        $arrError['amazon_login_email_v2'] = ' ' . $amazon_login_email_v2_error; 
        goto lAYQY; 
        gCqIg: 
        $AmazonCustomer = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]); 
        goto jRltB; 
        L_UuX:bpCus: 
        goto yQZuS; 
        VzDvK: 
        if ($login_check_v2 == 'regist') { 
            goto SV7VO; 
        } 
        goto L70PH; 
        xn0QP:rimeB: 
        goto wfT9r; 
        hIQk2: 
        $amazon_login_email_v2_error = ''; 
        goto F1HZH; 
        HFX4z: 
        $amazon_login_password_v2_error = ''; 
        goto Hxzp6; 
        wq98Y:guyRX: 
        goto WJ4En; 
        BlYes:RFW2b: 
        goto wq98Y; 
        BFDtj: 
        goto S0Wzw; 
        goto nAGJG; 
        KsJPP: 
        if (!(empty($login_check_v2_error) && empty($amazon_login_email_v2_error) && empty($amazon_login_password_v2_error))) { 
            goto Td7gj; 
        } 
        goto ndvEE; 
        Uc8KM: 
        goto bpCus; 
        goto ykaaK; 
        hBYVq: 
        if (empty($amazon_login_email_v2_error)) { 
            goto pt_Sq; 
        } 
        goto nVewU; 
        xZ_bq: 
        $arrError['customer_regist_v2'] = ' Amazon' . $AmazonCustomer[0]->getEmail() . ''; 
        goto C18pn; 
        u7Vww: 
        $request_uri = $request->getUri(); 
        goto Ha9kH; 
        nAGJG:tApo2: 
        goto bn4qb; 
        Q466b: 
        if (empty($amazon_login_password_v2_error)) { 
            goto o3OFc; 
        } 
        goto W2Gcl; 
        yKQa8: 
        $arrError['amazon_login_email_v2'] = ' '; 
        goto Z8Nkc; 
        FWfmv:SV7VO: 
        goto zfYSR; 
        EuaBm: 
        $login_check_v2 = $form['login_check_v2']->getData(); 
        goto VzDvK; 
        oz_9F:yAkIl: 
        goto BlYes; 
        jRltB: 
        if (!empty($Customer[0])) { 
            goto qvmLu; 
        } 
        goto iDN79; 
        yQZuS: 
        goto yAkIl; 
        goto kJD_E; 
        MScNC: 
        $violations = $this->validator->validate($form['amazon_login_email_v2']->getData(), [new Assert\NotBlank(), new Assert\Email()]); 
        goto hIQk2; 
        kJD_E:fJ_mc: 
        goto ZQWtC; 
        zfYSR: 
        if (empty($form['customer_regist_v2']->getData())) { 
            goto fJ_mc; 
        } 
        goto K5ia8; 
        m98cE: 
        if (empty($Customer[0])) { 
            goto tApo2; 
        } 
        goto Q2QZ2; 
        O3WVX: 
        $violations = $this->validator->validate($form['amazon_login_password_v2']->getData(), [new Assert\NotBlank()]); 
        goto HFX4z; 
        oKOJF:iQ17u: 
        goto hBYVq; 
        Hxzp6: 
        foreach ($violations as $violation) { 
            $amazon_login_password_v2_error .= $violation->getMessage() . PHP_EOL; 
            VWh9e: 
        } 
        goto eXX1q; 
        jCG5P: 
        $salt = $Customer[0]->getSalt(); 
        goto c6EJJ; 
        L70PH: 
        if (!($login_check_v2 == 'login')) { 
            goto rimeB; 
        } 
        goto MScNC; 
        D7mXt: 
        if ($encoder->isPasswordValid($customerPassword, $form['amazon_login_password_v2']->getData(), $salt)) { 
            goto Q6J2s; 
        } 
        goto yKQa8; 
        Q2QZ2: 
        $encoder = $this->encoderFactory->getEncoder($Customer[0]); 
        goto jCG5P; 
        wVGXf:o3OFc: 
        goto KsJPP; 
        wfT9r: 
        goto RFW2b; 
        goto FWfmv; 
        WJ4En:iJ1uw: 
        goto MPmki; 
        eGUwb:S0Wzw: 
        goto YHVOG; 
        ndvEE: 
        $Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $form['amazon_login_email_v2']->getData()]); 
        goto m98cE; 
        YHVOG:Td7gj: 
        goto xn0QP; 
        c6EJJ: 
        $customerPassword = $Customer[0]->getPassword(); 
        goto D7mXt; 
        C18pn:pn4FT: 
        goto Uc8KM; 
        ZQWtC: 
        $arrError['customer_regist_v2'] = ' '; 
        goto oz_9F; 
        lAYQY:pt_Sq: 
        goto O3WVX; 
        MPmki: 
        return $arrError; 
        goto b1XB0; 
        b1XB0: 
    } 
 
    private function setLogin($request, $Order, $email) 
    { 
        goto GegUd; 
        st39L: 
        return $ret; 
        goto s4jcJ; 
        kY8lj: 
        try { 
            goto r74YX; 
            Ptj31: 
            $this->tokenStorage->setToken($token); 
            goto j4WEX; 
            r74YX: 
            $Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $email]); 
            goto pLxDs; 
            gIoRu: 
            $token = new UsernamePasswordToken($Customer[0], null, 'customer', ['ROLE_USER']); 
            goto Ptj31; 
            j4WEX: 
            $this->amazonOrderHelper->copyToOrderFromCustomer($Order, $Customer[0]); 
            goto eGDjI; 
            pLxDs: 
            $Order->setCustomer($Customer[0]); 
            goto gIoRu; 
            eGDjI: 
            $ret = true; 
            goto ujBia; 
            ujBia: 
        } catch (\Exception $e) { 
            logs('amazon_pay_v2')->error($e); 
        } 
        goto st39L; 
        GegUd: 
        $ret = false; 
        goto kY8lj; 
        s4jcJ: 
    } 
 
    private function setAmazonCustomerData($form, $arrAmazonCustomerParam) 
    { 
        goto G3kae; 
        uzDDb: 
        $form->get('amazon_login_email_v2')->setData($arrAmazonCustomerParam['amazon_login_email_v2']); 
        goto IG8U0; 
        NAWyD: 
        if (!($this->Config->getLoginRequired() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on'] && !$this->isGranted('IS_AUTHENTICATED_FULLY'))) { 
            goto ux3Rs; 
        } 
        goto SaKOx; 
        QD1rc:EhBh6: 
        goto NAWyD; 
        IG8U0: 
        $form->get('amazon_login_password_v2')->setData($arrAmazonCustomerParam['amazon_login_password_v2']); 
        goto Mg3_2; 
        uZl10: 
        if (!($this->pluginRepository->findOneBy(['code' => 'MailMagazine42', 'enabled' => true]) || $this->pluginRepository->findOneBy(['code' => 'PostCarrier42', 'enabled' => true]))) { 
            goto EhBh6; 
        } 
        goto CHw1r; 
        CHw1r: 
        $form->get('mail_magazine')->setData($arrAmazonCustomerParam['mail_magazine']); 
        goto QD1rc; 
        SaKOx: 
        $form->get('login_check_v2')->setData($arrAmazonCustomerParam['login_check_v2']); 
        goto uzDDb; 
        Mg3_2:ux3Rs: 
        goto bLA33; 
        G3kae: 
        $form->get('customer_regist_v2')->setData($arrAmazonCustomerParam['customer_regist_v2']); 
        goto uZl10; 
        bLA33: 
    } 
 
    public function getPendingProcessingOrder($preOrderId = null) 
    { 
        goto x8tDQ; 
        qaykP: 
        return null; 
        goto gVFvi; 
        Cji0Z: 
        $OrderStatus = $this->orderStatusRepository->find(OrderStatus::PENDING); 
        goto QEfKW; 
        QEfKW: 
        return $this->orderRepository->findOneBy(['pre_order_id' => $preOrderId, 'OrderStatus' => $OrderStatus]); 
        goto VMuMN; 
        x8tDQ: 
        if (!(null === $preOrderId)) { 
            goto kW9pX; 
        } 
        goto qaykP; 
        gVFvi:kW9pX: 
        goto Cji0Z; 
        VMuMN: 
    } 
 
    private function checkShippingDifference($Order, $shippingAddress) 
    { 
        goto DXSlO; 
        XyUNC: 
        $shippingDifference = false; 
        goto AfnzL; 
        Qnukx: 
        $this->amazonOrderHelper->convert($amazonShipping, $shippingAddress); 
        goto MhWoE; 
        Q21Xd: 
        $amazonShipping->setOrder($Order); 
        goto Qnukx; 
        AfnzL: 
        if (!($Shippings->first()->getPostalCode() !== $amazonShipping->getPostalCode() || $Shippings->first()->getName01() !== $amazonShipping->getName01() || $Shippings->first()->getName02() !== $amazonShipping->getName02() || $Shippings->first()->getKana01() !== $amazonShipping->getKana01() || $Shippings->first()->getKana02() !== $amazonShipping->getKana02() || $Shippings->first()->getPref() !== $amazonShipping->getPref() || $Shippings->first()->getAddr01() !== $amazonShipping->getAddr01() || $Shippings->first()->getAddr02() !== $amazonShipping->getAddr02())) { 
            goto ak7GS; 
        } 
        goto G0Iwo; 
        Hmkgr:ak7GS: 
        goto cbFvz; 
        G0Iwo: 
        $shippingDifference = true; 
        goto Hmkgr; 
        MhWoE: 
        $Shippings = $Order->getShippings(); 
        goto XyUNC; 
        cbFvz: 
        return $shippingDifference; 
        goto wnXb4; 
        DXSlO: 
        $amazonShipping = new Shipping(); 
        goto Q21Xd; 
        wnXb4: 
    } 
 
    protected function getAmazonPayDefaultDelivery(Shipping $Shipping) 
    { 
        goto n4tEg; 
        nsls1: 
        foreach ($OrderItems as $OrderItem) { 
            goto Z_9M3; 
            B7guc: 
            $SaleType = $ProductClass->getSaleType(); 
            goto CdIw7; 
            CdIw7: 
            $SaleTypes[$SaleType->getId()] = $SaleType; 
            goto tv3D5; 
            Z_9M3: 
            $ProductClass = $OrderItem->getProductClass(); 
            goto B7guc; 
            tv3D5:k43zi: 
            goto ZxM6I; 
            ZxM6I: 
        } 
        goto xnTvn; 
        NEIbL:rrfk1: 
        goto W7bs4; 
        oOsfl: 
        $SaleTypes = []; 
        goto nsls1; 
        xnTvn:sa5zU: 
        goto oaZtg; 
        TCtkL: 
        foreach ($Deliveries as $key => $Delivery) { 
            goto gxhbY; 
            QJ90X: 
            foreach ($PaymentOptions as $PaymentOption) { 
                goto crbmG; 
                KNyJQ: 
                goto ZooKz; 
                goto IQG_V; 
                crbmG: 
                $Payment = $PaymentOption->getPayment(); 
                goto xcC6h; 
                IQG_V:rqAQg: 
                goto saYMv; 
                xcC6h: 
                if (!($Payment->getMethodClass() === AmazonPay::class)) { 
                    goto rqAQg; 
                } 
                goto BtDkp; 
                BtDkp: 
                $amazonPayFlg = true; 
                goto KNyJQ; 
                saYMv:ab0HS: 
                goto HB1mH; 
                HB1mH: 
            } 
            goto x2IHY; 
            gxhbY: 
            $PaymentOptions = $Delivery->getPaymentOptions(); 
            goto pu794; 
            IAS4O:IytQ_: 
            goto pV97G; 
            CLPLm:I5nEw: 
            goto IAS4O; 
            x2IHY:ZooKz: 
            goto Nvntm; 
            Nvntm: 
            if ($amazonPayFlg) { 
                goto I5nEw; 
            } 
            goto X_DSq; 
            pu794: 
            $amazonPayFlg = false; 
            goto QJ90X; 
            X_DSq: 
            unset($Deliveries[$key]); 
            goto CLPLm; 
            pV97G: 
        } 
        goto NEIbL; 
        n4tEg: 
        $OrderItems = $Shipping->getProductOrderItems(); 
        goto oOsfl; 
        oaZtg: 
        $Deliveries = $this->deliveryRepository->getDeliveries($SaleTypes); 
        goto TCtkL; 
        nLa7h: 
        return $Delivery; 
        goto GxM8x; 
        W7bs4: 
        $Delivery = current($Deliveries); 
        goto nLa7h; 
        GxM8x: 
    } 
} 
 ?>

Did this file decode correctly?

Original Code

<?php
/*   __________________________________________________
    |  Obfuscated by YAK Pro - Php Obfuscator  2.0.3   |
    |              on 2023-07-05 10:12:25              |
    |    GitHub: https://github.com/pk-fr/yakpro-po    |
    |__________________________________________________|
*/

namespace Plugin\AmazonPayV2_42\Controller;

use Eccube\Entity\Delivery;
use Eccube\Entity\OrderItem;
use Eccube\Repository\DeliveryRepository;
use Eccube\Repository\Master\OrderStatusRepository;
use Eccube\Repository\OrderRepository;
use Eccube\Repository\TradeLawRepository;
use Plugin\AmazonPayV2_42\Repository\ConfigRepository;
use Plugin\AmazonPayV2_42\Service\AmazonOrderHelper;
use Plugin\AmazonPayV2_42\Service\AmazonRequestService;
use Plugin\AmazonPayV2_42\Service\Method\AmazonPay;
use Eccube\Common\EccubeConfig;
use Eccube\Controller\AbstractShoppingController;
use Eccube\Entity\Order;
use Eccube\Entity\Shipping;
use Eccube\Entity\Master\OrderStatus;
use Eccube\Form\Type\Shopping\OrderType;
use Eccube\Repository\CustomerRepository;
use Eccube\Repository\Master\PrefRepository;
use Eccube\Repository\ProductClassRepository;
use Eccube\Repository\PluginRepository;
use Eccube\Service\CartService;
use Eccube\Service\MailService;
use Eccube\Service\OrderHelper;
use Eccube\Service\PurchaseFlow\PurchaseContext;
use Eccube\Service\PurchaseFlow\PurchaseFlow;
use Eccube\Service\PurchaseFlow\Processor\AddPointProcessor;
use Eccube\Service\PurchaseFlow\Processor\CustomerPurchaseInfoProcessor;
use Plugin\AmazonPayV2_42\Exception\AmazonPaymentException;
use Plugin\AmazonPayV2_42\Amazon\Pay\API\Client;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\DBAL\LockMode;

class AmazonShoppingController extends AbstractShoppingController
{
    private $sessionAmazonProfileKey = 'amazon_pay_v2.profile';
    private $sessionAmazonCheckoutSessionIdKey = 'amazon_pay_v2.checkout_session_id';
    private $sessionAmazonCustomerParamKey = 'amazon_pay_v2.customer_regist_v2';
    private $sessionAmazonCustomerErrorKey = 'amazon_pay_v2.customer_regist_v2_error';
    private $sessionIsShippingRefresh = 'amazon_pay_v2.is_shipping_refresh';
    protected $validator;
    protected $cartService;
    protected $amazonOrderHelper;
    protected $addPointProcessor;
    protected $customerPurchaseInfoProcessor;
    protected $serviceContainer;
    protected TradeLawRepository $tradeLawRepository;

    public function __construct(EccubeConfig $eccubeConfig, PurchaseFlow $cartPurchaseFlow, CartService $cartService, MailService $mailService, OrderHelper $orderHelper, CustomerRepository $customerRepository, OrderRepository $orderRepository, OrderStatusRepository $orderStatusRepository, PrefRepository $prefRepository, ProductClassRepository $productClassRepository, PluginRepository $pluginRepository, ConfigRepository $configRepository, AmazonOrderHelper $amazonOrderHelper, AmazonRequestService $amazonRequestService, ValidatorInterface $validator, EncoderFactoryInterface $encoderFactory, TokenStorageInterface $tokenStorage, DeliveryRepository $deliveryRepository, AddPointProcessor $addPointProcessor, CustomerPurchaseInfoProcessor $customerPurchaseInfoProcessor, TradeLawRepository $tradeLawRepository, ContainerInterface $serviceContainer)
    {
        goto Kd7yb;
        MExLU:
        $this->prefRepository = $prefRepository;
        goto OoByP;
        jQou0:
        $this->validator = $validator;
        goto wQxPa;
        w17UN:
        $this->deliveryRepository = $deliveryRepository;
        goto DZVew;
        d6ucV:
        $this->Config = $configRepository->get();
        goto SGrSA;
        i6IgP:
        $this->cartService = $cartService;
        goto psmsN;
        A3Gpd:
        $this->pluginRepository = $pluginRepository;
        goto d6ucV;
        SGrSA:
        $this->amazonOrderHelper = $amazonOrderHelper;
        goto Pz549;
        psmsN:
        $this->mailService = $mailService;
        goto gBV8X;
        m6oAa:
        $this->purchaseFlow = $cartPurchaseFlow;
        goto i6IgP;
        Pz549:
        $this->amazonRequestService = $amazonRequestService;
        goto jQou0;
        wQxPa:
        $this->encoderFactory = $encoderFactory;
        goto txclS;
        DZVew:
        $this->addPointProcessor = $addPointProcessor;
        goto EYrdr;
        P5EGq:
        $this->orderRepository = $orderRepository;
        goto TFwf0;
        Kd7yb:
        $this->eccubeConfig = $eccubeConfig;
        goto m6oAa;
        u1KUb:
        $this->tradeLawRepository = $tradeLawRepository;
        goto eCW8f;
        EYrdr:
        $this->customerPurchaseInfoProcessor = $customerPurchaseInfoProcessor;
        goto u1KUb;
        txclS:
        $this->tokenStorage = $tokenStorage;
        goto w17UN;
        gBV8X:
        $this->orderHelper = $orderHelper;
        goto y3RLg;
        y3RLg:
        $this->customerRepository = $customerRepository;
        goto P5EGq;
        OoByP:
        $this->productClassRepository = $productClassRepository;
        goto A3Gpd;
        eCW8f:
        $this->serviceContainer = $serviceContainer;
        goto h4BE_;
        TFwf0:
        $this->orderStatusRepository = $orderStatusRepository;
        goto MExLU;
        h4BE_:
    }

    /**
     * @Route("/shopping/amazon_pay", name="amazon_pay_shopping")
     * @Template("Shopping/index.twig")
     *
     * @param Request $request
     */
    public function index(Request $request, PurchaseFlow $cartPurchaseFlow)
    {
        logs('amazon_pay_v2')->info('AmazonShopping::index start.');
        $Cart = $this->cartService->getCart();
        if ($Cart && $this->orderHelper->verifyCart($Cart)) {
            goto KXo5W;
        }
        goto rtUCl;
        ch5EM:
        $form->handleRequest($request);
        goto MILwl;
        tarMb:
        logs('amazon_pay_v2')->info('[] Warning.', [$flowResult->getWarning()]);
        goto xKGCz;
        vIDEM:
        $Customer = $this->getUser() ? $this->getUser() : $this->amazonOrderHelper->getOrderer($checkoutSession->shippingAddress);
        goto L3LVN;
        SpQwO:
        foreach ($arrAmazonCustomerError as $key => $val) {
            $form[$key]->addError(new FormError($val));
            GqYl0:
        }
        goto Njt0Q;
        WZLQG:
        return ['form' => $form->createView(), 'Order' => $Order, 'AmazonCustomer' => $arrAmazonCustomerParam, 'AmazonPaymentDescriptor' => $checkoutSession->paymentPreferences[0]->paymentDescriptor, 'AmazonShippingAddress' => $checkoutSession->shippingAddress, 'activeTradeLaws' => $activeTradeLaws];
        goto emwlJ;
        Nx7WX:
        if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {
            goto vtziA;
        }
        goto tA7Ev;
        zep2W:
        if (!($checkoutSession && $checkoutSession->statusDetails->state !== 'Open')) {
            goto jIJgx;
        }
        goto wkuhn;
        Yp4TK:R6HuP:
        goto bYHkY;
        G4xsu:
        $arrAmazonCustomerParam = ['customer_regist_v2' => true, 'mail_magazine' => true, 'login_check_v2' => 'regist', 'amazon_login_email_v2' => null, 'amazon_login_password_v2' => null];
        goto NCJVy;
        fcxAn:
        $arrAmazonCustomerParam['mail_magazine'] = false;
        goto ZhaV3;
        iumdF:
        goto R6HuP;
        goto lUfnk;
        wZRYy:
        $this->session->set(OrderHelper::SESSION_NON_MEMBER, $Customer);
        goto kMpn0;
        itei1:
        if (!$flowResult->hasError()) {
            goto T97ue;
        }
        goto slt5F;
        cZvmt:
        $activeTradeLaws = $this->tradeLawRepository->findBy(['displayOrderScreen' => true], ['sortNo' => 'ASC']);
        goto ch5EM;
        NioNr:
        $this->entityManager->flush();
        goto DmXXy;
        XtSqj:N9ExI:
        goto cZvmt;
        GuGUi:UsOMX:
        goto dxE5X;
        oJKKD:
        $Shippings = $Order->getShippings();
        goto BMjOt;
        i1pb2:
        if (!($AmazonDefaultDelivery === false)) {
            goto ksEDp;
        }
        goto s7h1C;
        hlGbx:
        return $this->redirectToRoute('shopping_error');
        goto DmD_R;
        EOKZJ:
        $initOrderFlg = true;
        goto iumdF;
        tA7Ev:
        $this->setAmazonCustomerData($form, $arrAmazonCustomerParam);
        goto b3kDJ;
        L3LVN:
        if ($this->isGranted('ROLE_USER')) {
            goto YpC99;
        }
        goto wZRYy;
        sefbj:
        if (!$this->session->get($this->sessionIsShippingRefresh)) {
            goto nf3eB;
        }
        goto oJKKD;
        sYRrK:
        $this->session->remove($this->sessionIsShippingRefresh);
        goto EvnWA;
        n5HGQ:
        if (!$flowResult->hasWarning()) {
            goto Cjwl3;
        }
        goto tarMb;
        PcHDr:
        $Cart = $this->cartService->getCart();
        goto Xxs09;
        WBwdh:
        if (!$Order->isMultiple()) {
            goto g84gp;
        }
        goto wKNIl;
        b3kDJ:vtziA:
        goto Z5lq1;
        LMV3w:
        $this->cartService->save();
        goto nsDJV;
        DmXXy:WnKg2:
        goto OBF85;
        oreFN:
        $Shipping->setShippingDeliveryName($AmazonDefaultDelivery->getName());
        goto NioNr;
        MILwl:
        logs('amazon_pay_v2')->info('AmazonShopping::index end.');
        goto WZLQG;
        bYHkY:
        $Order = $this->orderHelper->initializeOrder($Cart, $Customer);
        goto pCX4a;
        SL21B:
        $checkoutSession = $this->amazonRequestService->getCheckoutSession($amazonCheckoutSessionId);
        goto zep2W;
        gIbPH:
        $arrAmazonCustomerParam['customer_regist_v2'] = false;
        goto GuGUi;
        OBF85:
        $Order = $this->amazonOrderHelper->initializeAmazonOrder($Order, $Customer);
        goto sefbj;
        mBoDW:
        $this->entityManager->flush();
        goto itei1;
        kMpn0:YpC99:
        goto MTeUD;
        DgjS5:
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);
        goto GHduI;
        NCJVy:
        goto MKtg6;
        goto F885H;
        BMjOt:
        $this->amazonOrderHelper->convert($Shippings->first(), $checkoutSession->shippingAddress);
        goto BB3UI;
        s7h1C:
        $this->addError('Amazon Pay');
        goto ELoB2;
        ZTPp3:
        if ($Order = $this->orderHelper->getPurchaseProcessingOrder($Cart->getPreOrderId())) {
            goto OrfdQ;
        }
        goto EOKZJ;
        ELoB2:ksEDp:
        goto HAvLu;
        Vwlfh:
        $amazonCheckoutSessionId = $this->session->get($this->sessionAmazonCheckoutSessionIdKey);
        goto SL21B;
        slt5F:
        logs('amazon_pay_v2')->info('[] Error.', [$flowResult->getErrors()]);
        goto hlGbx;
        lUfnk:OrfdQ:
        goto WBwdh;
        seCby:
        $AmazonDefaultDelivery = $this->getAmazonPayDefaultDelivery($Shipping);
        goto i1pb2;
        ZhaV3:yDROr:
        goto Lu3Kj;
        F885H:eT8Hz:
        goto POlF3;
        xKGCz:
        $cartPurchaseFlow->validate($Cart, new PurchaseContext());
        goto LMV3w;
        rtUCl:
        logs('amazon_pay_v2')->info('[] , .');
        goto GwtFy;
        Lu3Kj:MKtg6:
        goto mUWKN;
        BB3UI:
        $Shippings->first()->setCompanyName('');
        goto Bd9zN;
        wKNIl:
        $Cart->setPreOrderId(null);
        goto U2HwJ;
        sPti2:
        logs('amazon_pay_v2')->info('[] .');
        goto vIDEM;
        DmD_R:T97ue:
        goto n5HGQ;
        vXhcT:jIJgx:
        goto sPti2;
        dxE5X:
        if (!empty($arrAmazonCustomerParam['mail_magazine'])) {
            goto yDROr;
        }
        goto fcxAn;
        Kd2Ef:
        $this->session->set($this->sessionAmazonCustomerErrorKey, null);
        goto XtSqj;
        FTw8u:
        if ($amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey)) {
            goto eT8Hz;
        }
        goto G4xsu;
        mUWKN:
        $form = $this->createForm(OrderType::class, $Order);
        goto Nx7WX;
        dT4TB:
        return $this->redirectToRoute('shopping_error');
        goto vXhcT;
        U2HwJ:g84gp:
        goto Yp4TK;
        POlF3:
        $arrAmazonCustomerParam = unserialize($amazonCustomerParam);
        goto vnRr0;
        Vr3uW:
        $Shipping->setDelivery($AmazonDefaultDelivery);
        goto oreFN;
        EvnWA:nf3eB:
        goto DgjS5;
        fwA4E:KXo5W:
        goto Vwlfh;
        Njt0Q:O44Zl:
        goto Kd2Ef;
        wkuhn:
        logs('amazon_pay_v2')->info('[] CheckoutSessionOpen.', ['CheckoutSessionId => $amazonCheckoutSessionId']);
        goto bmkmp;
        nsDJV:Cjwl3:
        goto FTw8u;
        zc8QX:
        $arrAmazonCustomerError = unserialize($amazonCustomerError);
        goto SpQwO;
        pCX4a:
        $Shipping = $Order->getShippings()->first();
        goto seCby;
        MTeUD:
        $initOrderFlg = false;
        goto ZTPp3;
        HAvLu:
        if (!($initOrderFlg && $AmazonDefaultDelivery)) {
            goto WnKg2;
        }
        goto Vr3uW;
        GHduI:
        $flowResult = $this->executePurchaseFlow($Order, false);
        goto mBoDW;
        Z5lq1:
        if (!($amazonCustomerError = $this->session->get($this->sessionAmazonCustomerErrorKey))) {
            goto N9ExI;
        }
        goto zc8QX;
        Bd9zN:
        $this->entityManager->flush();
        goto sYRrK;
        bmkmp:
        $this->session->remove($this->sessionAmazonCheckoutSessionIdKey);
        goto dT4TB;
        vnRr0:
        if (!empty($arrAmazonCustomerParam['customer_regist_v2'])) {
            goto UsOMX;
        }
        goto gIbPH;
        GwtFy:
        return $this->redirectToRoute('cart');
        goto fwA4E;
        emwlJ:
    }

    /**
     * 
     *
     * @Route("/shopping/amazon_pay/confirm", name="amazon_pay_shopping_confirm", methods={"POST"})
     * @Template("Shopping/confirm.twig")
     */
    public function confirm(Request $request)
    {
        goto X0h_3;
        nchAy:
        $paymentMethod = $this->createPaymentMethod($Order, $form);
        goto ipRI2;
        ipRI2:
        $PaymentResult = $paymentMethod->verify();
        goto oeuLQ;
        gGFiJ:
        logs('amazon_pay_v2')->info('[] , .');
        goto v3JMK;
        d2a10:ZlO1c:
        goto MR0xl;
        UA04F:
        $preOrderId = $this->cartService->getPreOrderId();
        goto BP8f2;
        MUqeb:GdFTe:
        goto d2a10;
        d6D0R:
        logs('amazon_pay_v2')->info('[] PaymentMethod::verify.', [$Order->getPayment()->getMethodClass()]);
        goto nchAy;
        BP8f2:
        $Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);
        goto faeyl;
        YHpWn:
        $this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam));
        goto Jreks;
        MR0xl:
        $this->entityManager->flush();
        goto FnHDF;
        Ypyjn:
        return $this->redirectToRoute('shopping_error');
        goto EDfou;
        H5htw:
        $this->entityManager->flush();
        goto pAVjQ;
        IO_1C:
        logs('amazon_pay_v2')->info('[] .');
        goto P2Fzq;
        rY3vG:
        $Cart = $this->cartService->getCart();
        goto wO0Id;
        FrMIx:
        if (!($response && ($response->isRedirection() || $response->getContent()))) {
            goto GdFTe;
        }
        goto H5htw;
        wO0Id:
        if ($Cart && $this->orderHelper->verifyCart($Cart)) {
            goto toETf;
        }
        goto gGFiJ;
        FnHDF:
        $activeTradeLaws = $this->tradeLawRepository->findBy(['displayOrderScreen' => true], ['sortNo' => 'ASC']);
        goto IO_1C;
        MjvNR:Jo2yS:
        goto DPjPD;
        v3JMK:
        return $this->redirectToRoute('cart');
        goto fA12K;
        X0h_3:
        logs('amazon_pay_v2')->info('AmazonShopping::confirm start.');
        goto rY3vG;
        uoyH2:
        $arrAmazonCustomerParam = $this->getAmazonCustomerParam($request);
        goto YHpWn;
        fA12K:toETf:
        goto UA04F;
        mtmKD:OXgBG:
        goto CldvK;
        J0iWP:sDfZX:
        goto ehpNt;
        htom1:
        if ($PaymentResult->isSuccess()) {
            goto Jo2yS;
        }
        goto H1cAr;
        CldvK:
        logs('amazon_pay_v2')->info('[] , ', [$Order->getId()]);
        goto lTyaL;
        d80mw:dvtR1:
        goto d6D0R;
        R8WJG:JOdgI:
        goto adgLD;
        REeGW:
        if (!($form->isSubmitted() && $form->isValid())) {
            goto OXgBG;
        }
        goto ZXbXH;
        oeuLQ:
        if (!$PaymentResult) {
            goto ZlO1c;
        }
        goto htom1;
        YnVWX:
        if (!($arrAmazonCustomerError = $this->checkAmazonCustomerError($request, $form, $Order))) {
            goto eE0Y8;
        }
        goto s95_B;
        adgLD:
        logs('amazon_pay_v2')->info('[] PaymentMethod::verify, .', [$PaymentResult->getErrors()]);
        goto pdYOU;
        bzPm9:
        return $this->redirectToRoute('amazon_pay_shopping');
        goto d80mw;
        B293x:
        return $response;
        goto MUqeb;
        ehpNt:
        $form->handleRequest($request);
        goto YnVWX;
        VSZML:
        logs('amazon_pay_v2')->info('[] .');
        goto Ypyjn;
        owKnV:
        $this->entityManager->flush();
        goto XfXex;
        lUoiu:
        if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {
            goto sDfZX;
        }
        goto jPsfJ;
        rANA1:
        $response = $this->executePurchaseFlow($Order);
        goto owKnV;
        e1Xks:
        foreach ($PaymentResult->getErrors() as $error) {
            $this->addError($error);
            OyDzV:
        }
        goto R8WJG;
        XfXex:
        if (!$response) {
            goto dvtR1;
        }
        goto bzPm9;
        BSwyD:eE0Y8:
        goto REeGW;
        s95_B:
        $this->session->set($this->sessionAmazonCustomerErrorKey, serialize($arrAmazonCustomerError));
        goto hIPdv;
        pdYOU:
        return $this->redirectToRoute('amazon_pay_shopping');
        goto MjvNR;
        Jreks:
        $form = $this->createForm(OrderType::class, $Order);
        goto lUoiu;
        faeyl:
        if ($Order) {
            goto NN5BD;
        }
        goto VSZML;
        pAVjQ:
        logs('amazon_pay_v2')->info('[] PaymentMethod::verify.');
        goto B293x;
        lTyaL:
        return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307);
        goto w45YS;
        ZXbXH:
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);
        goto rANA1;
        jPsfJ:
        $this->setAmazonCustomerData($form, $arrAmazonCustomerParam);
        goto J0iWP;
        EDfou:NN5BD:
        goto uoyH2;
        P2Fzq:
        return ['form' => $form->createView(), 'Order' => $Order, 'activeTradeLaws' => $activeTradeLaws];
        goto mtmKD;
        DPjPD:
        $response = $PaymentResult->getResponse();
        goto FrMIx;
        H1cAr:
        $this->entityManager->rollback();
        goto e1Xks;
        hIPdv:
        return $this->redirectToRoute('amazon_pay_shopping');
        goto BSwyD;
        w45YS:
    }

    /**
     * 
     *
     * @Route("/shopping/amazon_pay/checkout", name="amazon_pay_shopping_checkout", methods={"POST"})
     * @Template("Shopping/index.twig")
     */
    public function checkout(Request $request)
    {
        goto MqNjp;
        qcYUH:MnfR_:
        goto dUGGn;
        Td5l2:SCPs7:
        goto Pql17;
        RBYTD:
        $this->addError($errMessage);
        goto tIYbU;
        DSCo5:
        if ($this->amazonOrderHelper->checkShippingPref($checkoutSession->shippingAddress)) {
            goto FhXLL;
        }
        goto IO6Rg;
        Jk2M0:
        $checkoutSession = $this->amazonRequestService->getCheckoutSession($amazonCheckoutSessionId);
        goto QqMt2;
        gwg1O:
        logs('amazon_pay_v2')->info('[] , .');
        goto PfjOy;
        BAJwL:
        if ($Cart && $this->orderHelper->verifyCart($Cart)) {
            goto RSSmP;
        }
        goto gwg1O;
        yE3fC:
        $form->handleRequest($request);
        goto eJWPc;
        dA2YP:
        $amazonCheckoutSessionId = $this->session->get($this->sessionAmazonCheckoutSessionIdKey);
        goto Jk2M0;
        NvXdd:
        $Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);
        goto OG8VR;
        eGqyR:
        return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307);
        goto R8Vpz;
        W0JMH:
        goto iDmc_;
        goto GhnJS;
        GhnJS:ZrzSC:
        goto ZADoR;
        ZADoR:iDmc_:
        goto DmxA8;
        FbeRT:
        if (!($checkoutSession && $checkoutSession->statusDetails->state !== 'Open')) {
            goto NMTIX;
        }
        goto djB4G;
        SKC0_:
        return new RedirectResponse($checkoutSession->webCheckoutDetails->amazonPayRedirectUrl);
        goto y5PyT;
        dUGGn:
        if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {
            goto YmRob;
        }
        goto Z_blo;
        Yiim9:
        $Order->setAmazonPayV2SessionTemp(serialize($session_temp));
        goto hP2bF;
        eKqT2:
        $response = $this->executePurchaseFlow($Order);
        goto ggNJn;
        Pql17:
        $checkoutSession = $this->amazonRequestService->updateCheckoutSession($Order, $amazonCheckoutSessionId);
        goto sd76q;
        d_Sob:
        $this->addError('');
        goto oT_81;
        tcOtD:
        return $this->redirectToRoute('shopping_error');
        goto IaBpK;
        CyEkM:
        if (!($response = $paymentMethod->apply())) {
            goto Hz57A;
        }
        goto Bx967;
        tIYbU:
        return $this->redirectToRoute('amazon_pay_shopping');
        goto Td5l2;
        dV_n4:Hz57A:
        goto eQ_5i;
        jlgij:
        logs('amazon_pay_v2')->error('reasonCode: ' . $checkoutSession->reasonCode . ' message: ' . $checkoutSession->message);
        goto d_Sob;
        sd76q:
        if (!isset($checkoutSession->reasonCode)) {
            goto OhlZl;
        }
        goto jlgij;
        f3EwX:
        return $this->redirectToRoute('amazon_pay_shopping');
        goto pPxNn;
        BVmyn:
        $paymentMethod = $this->createPaymentMethod($Order, $form);
        goto OqUu7;
        pPxNn:MGA_f:
        goto BVmyn;
        CQgzb:YmRob:
        goto yE3fC;
        QqMt2:
        $shippingDifference = $this->checkShippingDifference($Order, $checkoutSession->shippingAddress);
        goto vV6TG;
        DmxA8:
        if (!($form->isSubmitted() && $form->isValid())) {
            goto lCq3g;
        }
        goto cXT1D;
        R2piH:SfOPl:
        goto W0JMH;
        OG8VR:
        if ($Order) {
            goto TlhPu;
        }
        goto l_Id9;
        SgAno:
        $this->session->set($this->sessionAmazonCustomerErrorKey, serialize($arrAmazonCustomerError));
        goto i9PVG;
        lgFMq:
        $Cart = $this->cartService->getCart();
        goto BAJwL;
        i9PVG:
        return $this->redirectToRoute('amazon_pay_shopping');
        goto R2piH;
        aORS0:
        return $this->redirectToRoute('shopping_error');
        goto LZedr;
        PfjOy:
        return $this->redirectToRoute('cart');
        goto gAuW6;
        hP2bF:
        $this->entityManager->flush();
        goto SKC0_;
        eJWPc:
        if ($this->Config->getUseConfirmPage() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on']) {
            goto ZrzSC;
        }
        goto aDeES;
        Z_blo:
        $this->setAmazonCustomerData($form, $arrAmazonCustomerParam);
        goto CQgzb;
        vpbeQ:
        $arrAmazonCustomerParam = unserialize($amazonCustomerParam);
        goto tcAA9;
        OqUu7:
        logs('amazon_pay_v2')->info('[] PaymentMethod::apply.');
        goto CyEkM;
        FX3dF:
        logs('amazon_pay_v2')->error('orderId: ' . $Order->getId() . ' message: ' . $errMessage);
        goto RBYTD;
        tEcNQ:
        goto MnfR_;
        goto Us9ck;
        gAuW6:RSSmP:
        goto Adqd7;
        N7kWx:
        $arrAmazonCustomerParam = $this->getAmazonCustomerParam($request);
        goto b_jdw;
        Bx967:
        return $response;
        goto dV_n4;
        EQfAw:OhlZl:
        goto xN3Zx;
        bDv9Y:
        $form = $this->createForm(OrderType::class, $Order);
        goto qcYUH;
        IO6Rg:
        $this->addError('amazon_pay_v2.front.shopping.undefined_pref_error');
        goto xpKyU;
        l_Id9:
        logs('amazon_pay_v2')->info('[] .');
        goto xbusr;
        xN3Zx:
        logs('amazon_pay_v2')->info('', [$Order->getId()]);
        goto eKqT2;
        eQ_5i:
        $session_temp = ['IS_AUTHENTICATED_FULLY' => $this->isGranted('IS_AUTHENTICATED_FULLY'), $this->sessionAmazonCheckoutSessionIdKey => $amazonCheckoutSessionId, $this->sessionAmazonProfileKey => unserialize($this->session->get($this->sessionAmazonProfileKey)), $this->sessionAmazonCustomerParamKey => unserialize($this->session->get($this->sessionAmazonCustomerParamKey))];
        goto Yiim9;
        b_jdw:
        $this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam));
        goto bDv9Y;
        Adqd7:
        $preOrderId = $this->cartService->getPreOrderId();
        goto NvXdd;
        yca1r:
        logs('amazon_pay_v2')->info('', [$Order->getId()]);
        goto eGqyR;
        LZedr:FhXLL:
        goto FbeRT;
        b2CSv:
        if ($this->Config->getUseConfirmPage() == $this->eccubeConfig['amazon_pay_v2']['toggle']['off']) {
            goto pchoj;
        }
        goto T8Ds3;
        xpKyU:
        logs('amazon_pay_v2')->error('[] ', [$Order->getId()]);
        goto aORS0;
        FdNEO:
        $this->session->set($this->sessionIsShippingRefresh, true);
        goto LTw5v;
        cXT1D:
        if (!($Order->getPaymentTotal() == 0)) {
            goto SCPs7;
        }
        goto lklO6;
        ggNJn:
        $this->entityManager->flush();
        goto d6iXp;
        T8Ds3:
        $amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey);
        goto vpbeQ;
        LTw5v:
        return $this->redirectToRoute('amazon_pay_shopping');
        goto Z3AaJ;
        IaBpK:NMTIX:
        goto b2CSv;
        Us9ck:pchoj:
        goto N7kWx;
        y5PyT:lCq3g:
        goto yca1r;
        lklO6:
        $errMessage = AmazonPaymentException::$errorMessages[AmazonPaymentException::ZERO_PAYMENT];
        goto FX3dF;
        aDeES:
        if (!($arrAmazonCustomerError = $this->checkAmazonCustomerError($request, $form, $Order))) {
            goto SfOPl;
        }
        goto SgAno;
        d6iXp:
        if (!$response) {
            goto MGA_f;
        }
        goto f3EwX;
        MqNjp:
        logs('amazon_pay_v2')->info('AmazonShopping::order start.');
        goto lgFMq;
        oT_81:
        return $this->redirectToRoute('amazon_pay_shopping');
        goto EQfAw;
        vV6TG:
        if (!$shippingDifference) {
            goto EPemR;
        }
        goto FdNEO;
        Z3AaJ:EPemR:
        goto DSCo5;
        tcAA9:
        $form = $this->createForm(OrderType::class, $Order, ['skip_add_form' => true]);
        goto tEcNQ;
        xbusr:
        return $this->redirectToRoute('shopping_error');
        goto lyefR;
        r073g:
        $this->session->remove($this->sessionAmazonCheckoutSessionIdKey);
        goto tcOtD;
        djB4G:
        logs('amazon_pay_v2')->info('[] CheckoutSessionOpen.', ['CheckoutSessionId => $amazonCheckoutSessionId']);
        goto r073g;
        lyefR:TlhPu:
        goto dA2YP;
        R8Vpz:
    }

    /**
     * 
     *
     * @Route("/shopping/amazon_pay/checkout_result", name="amazon_pay_shopping_checkout_result")
     */
    public function checkoutResult(Request $request)
    {
        goto JJlBg;
        MnUx3:
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);
        goto FKuvw;
        JJlBg:
        $preOrderId = $this->cartService->getPreOrderId();
        goto kw6DL;
        jBkGa:
        goto NQhYS;
        goto CDdWl;
        CDdWl:Isflu:
        goto IdwGK;
        kvcMx:
        logs('amazon_pay_v2')->info('AmazonShopping::complete_order end.');
        goto OlQg_;
        TkMl3:
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);
        goto nmj0p;
        KFNU5:
        logs('amazon_pay_v2')->info('[] . .', [$Order->getId()]);
        goto TT4vG;
        Pb93B:
        $this->session->set($this->sessionAmazonCustomerErrorKey, null);
        goto KFNU5;
        N313x:
        $amazonCheckoutSessionId = $request->get('amazonCheckoutSessionId');
        goto vOseC;
        G7ptX:
        $this->entityManager->flush();
        goto MnUx3;
        BLu9N:
        try {
            goto yTgOQ;
            jayrb:Mipxs:
            goto f6_BX;
            FbWuA:
            $mail_message = <<<__EOS__
************************************************

************************************************
URL{$url}
{$mail}
{$password}

__EOS__;
            goto nyllz;
            jKMU0:
            $Customers = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);
            goto tWbRT;
            j3hd1:
            if (!($Order['update_date'] != $LockedOrder['update_date'])) {
                goto Mipxs;
            }
            goto tcg0u;
            wvF5W:
            if ($amazonDtbCustomer) {
                goto avgHa;
            }
            goto hgO7Q;
            C3kn4:
            $LockedOrder = $this->orderRepository->find($Order['id'], LockMode::PESSIMISTIC_WRITE);
            goto ABh9X;
            M0mtg:
            goto nILAg;
            goto PfJ6x;
            RHnQQ:nILAg:
            goto BrD6R;
            ILdMJ:SGf52:
            goto KpvDV;
            hU3de:
            $Order->setCustomer($Customer);
            goto ee8_C;
            cSojc:
            $result = $this->abortCheckoutResult($Order);
            goto kkuJC;
            kkuJC:
            $this->entityManager->flush();
            goto m5KwG;
            w0pwf:ux3Rz:
            goto vs1Xg;
            HcooX:
            $Customer = $Order->getCustomer();
            goto ciArF;
            ciArF:
            $Customers = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);
            goto YD3W4;
            YD3W4:
            if (!(!$Customer->getV2AmazonUserId() && empty($Customers[0]))) {
                goto ux3Rz;
            }
            goto APBR_;
            yNpTr:
            if (!($response = $this->executeCheckout($paymentMethod, $Order))) {
                goto oeVv6;
            }
            goto sK2F8;
            YUpr2:
            $form = $this->createForm(OrderType::class, $Order);
            goto hzLv7;
            FbWuX:
            $mail = $Customer->getEmail();
            goto FbWuA;
            FlJcv:PslpN:
            goto M0mtg;
            PfJ6x:Ht8dM:
            goto oQIUG;
            m5KwG:
            $this->entityManager->commit();
            goto zPTgV;
            xmj3B:
            if ($dtbCustomer || $amazonDtbCustomer) {
                goto kEo0y;
            }
            goto t560A;
            l4Icb:
            if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {
                goto sLZp9;
            }
            goto dUCv9;
            zPTgV:
            return $result;
            goto jayrb;
            nf92j:
            $this->entityManager->flush();
            goto OYpYh;
            oQiLv:avgHa:
            goto iLH4h;
            FIYkI:
            $Customer->setV2AmazonUserId($profile->buyerId);
            goto ARkjX;
            iLH4h:
            $mail = $amazonDtbCustomer[0]->getEmail();
            goto ILdMJ;
            f6_BX:
            logs('amazon_pay_v2')->info('[] PaymentMethod::checkout.');
            goto yNpTr;
            rjtYy:kEo0y:
            goto wvF5W;
            ABh9X:
            logs('amazon_pay_v2')->info('$Order[update_date] is ' . $Order['update_date']->format('Y-m-d H:i:s.u') . ', $LockedOrder[update_date] is ' . $LockedOrder['update_date']->format('Y-m-d H:i:s.u'));
            goto j3hd1;
            oyXlZ:
            logs('amazon_pay_v2')->info('', [$Order->getId()]);
            goto v2idf;
            tNpWY:
            $Customer = $this->getUser();
            goto hU3de;
            krHdX:
            $amazonDtbCustomer = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);
            goto xmj3B;
            hzLv7:
            $paymentMethod = $this->createPaymentMethod($Order, $form, $amazonCheckoutSessionId);
            goto Kba1L;
            ARkjX:sXU0_:
            goto PvR5v;
            hgO7Q:
            $mail = $dtbCustomer[0]->getEmail();
            goto hU03a;
            hU03a:
            goto SGf52;
            goto oQiLv;
            RDTCU:
            if (!($arrAmazonCustomerParam['login_check_v2'] == 'login')) {
                goto PslpN;
            }
            goto WTWJ0;
            Kba1L:
            $this->entityManager->beginTransaction();
            goto C3kn4;
            HYaZb:
            $this->addPointProcessor->validate($Order, new PurchaseContext());
            goto nf92j;
            APBR_:
            $Customer->setV2AmazonUserId($profile->buyerId);
            goto w0pwf;
            yTgOQ:
            logs('amazon_pay_v2')->info('', [$Order->getId()]);
            goto YUpr2;
            oQIUG:
            if (!$arrAmazonCustomerParam['customer_regist_v2']) {
                goto YqeRx;
            }
            goto rocsf;
            tWbRT:
            if (!(!$Customer->getV2AmazonUserId() && empty($Customers[0]))) {
                goto sXU0_;
            }
            goto FIYkI;
            lamBL:
            logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);
            goto oyXlZ;
            vs1Xg:LXbz3:
            goto FlJcv;
            BrD6R:
            goto deU7l;
            goto HhK9M;
            tcg0u:
            logs('amazon_pay_v2')->info('[] ');
            goto cSojc;
            t560A:
            $password = $this->amazonOrderHelper->registCustomer($Order, $arrAmazonCustomerParam['mail_magazine']);
            goto tNpWY;
            eQl1B:oeVv6:
            goto l0obX;
            ro74w:YqeRx:
            goto RHnQQ;
            HhK9M:sLZp9:
            goto vVByz;
            KpvDV:
            $mail_message = <<<__EOS__
************************************************

************************************************
URL{$url}
{$mail}

__EOS__;
            goto dNXf3;
            nyllz:
            goto PRRwA;
            goto rjtYy;
            dNXf3:PRRwA:
            goto o2VND;
            WTWJ0:
            if (!$this->setLogin($request, $Order, $arrAmazonCustomerParam['amazon_login_email_v2'])) {
                goto LXbz3;
            }
            goto HcooX;
            FDb8w:
            logs('amazon_pay_v2')->info('AddPointProcessor.', [$Order->getId()]);
            goto HYaZb;
            o2VND:
            $Order->setCompleteMailMessage($mail_message);
            goto ro74w;
            rocsf:
            $url = $this->generateUrl('mypage_login', [], UrlGeneratorInterface::ABSOLUTE_URL);
            goto RBHEg;
            vVByz:
            $Customer = $this->getUser();
            goto jKMU0;
            RBHEg:
            $dtbCustomer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $Order->getEmail()]);
            goto krHdX;
            sK2F8:
            return $response;
            goto eQl1B;
            PvR5v:deU7l:
            goto FDb8w;
            dUCv9:
            if (empty($arrAmazonCustomerParam['login_check_v2']) || $arrAmazonCustomerParam['login_check_v2'] == 'regist') {
                goto Ht8dM;
            }
            goto RDTCU;
            l0obX:
            $profile = unserialize($this->session->get($this->sessionAmazonProfileKey));
            goto l4Icb;
            ee8_C:
            $this->customerPurchaseInfoProcessor->commit($Order, new PurchaseContext());
            goto FbWuX;
            OYpYh:
            $this->entityManager->commit();
            goto lamBL;
            v2idf:
        } catch (ShoppingException $e) {
            goto D2hr6;
            K87Ht:
            logs('amazon_pay_v2')->error('', [$e->getMessage()]);
            goto eud9J;
            lCrKr:
            return $this->redirectToRoute('shopping_error');
            goto S1zSU;
            hfHz5:
            $this->entityManager->commit();
            goto lCrKr;
            M2Pcm:
            $this->entityManager->flush();
            goto hfHz5;
            D2hr6:
            $this->addError($e->getMessage());
            goto K87Ht;
            eud9J:
            $this->purchaseFlow->rollback($Order, new PurchaseContext());
            goto M2Pcm;
            S1zSU:
        } catch (AmazonPaymentException $e) {
            goto zXQTD;
            qP_38:
            $this->entityManager->flush();
            goto mXsGR;
            SXgtJ:
            return $this->redirectToRoute('shopping_error');
            goto HcIE3;
            mXsGR:
            $this->entityManager->commit();
            goto SXgtJ;
            zXQTD:
            $this->addError($e->getMessage());
            goto P1pe0;
            C0k53:
            $this->purchaseFlow->rollback($Order, new PurchaseContext());
            goto qP_38;
            P1pe0:
            logs('amazon_pay_v2')->error($e->getMessage(), [$Order->getId()]);
            goto C0k53;
            HcIE3:
        } catch (\Exception $e) {
            goto uS97Y;
            NUpB2:
            $this->entityManager->flush();
            goto C3HOx;
            uS97Y:
            $this->addError('front.shopping.system_error');
            goto LyJey;
            Znsb5:
            return $this->redirectToRoute('shopping_error');
            goto tsQ47;
            LyJey:
            logs('amazon_pay_v2')->error('', [get_class($e), $e->getMessage()]);
            goto QnWj7;
            QnWj7:
            $this->purchaseFlow->rollback($Order, new PurchaseContext());
            goto NUpB2;
            C3HOx:
            $this->entityManager->commit();
            goto Znsb5;
            tsQ47:
        }
        goto kvcMx;
        xECH3:
        $this->entityManager->flush();
        goto KGZ1h;
        KGZ1h:
        $this->session->set($this->sessionAmazonCheckoutSessionIdKey, null);
        goto Vf14m;
        fFRNd:
        return $result;
        goto SOXz0;
        TT4vG:
        return $this->redirectToRoute('shopping_complete');
        goto nMySU;
        vOseC:
        $amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey);
        goto qh23v;
        kw6DL:
        $Order = $this->orderRepository->findOneBy(['pre_order_id' => $preOrderId]);
        goto X2dGk;
        wJGz5:
        $this->entityManager->flush();
        goto fFRNd;
        HYCZL:GPwQO:
        goto UVHkx;
        IHOcM:
        logs('amazon_pay_v2')->info('[] .');
        goto d876m;
        IdwGK:
        logs('amazon_pay_v2')->info('[] IPN.', [$Order->getId()]);
        goto VCYNW;
        WwNlU:
        $Order->setAmazonPayV2SessionTemp(null);
        goto xECH3;
        Tuviy:Wq5px:
        goto C1weU;
        uJx_5:
        $this->mailService->sendOrderMail($Order);
        goto G7ptX;
        J36WT:HRnro:
        goto uJx_5;
        nmj0p:
        if (is_null($this->Config->getMailNotices())) {
            goto HRnro;
        }
        goto DcpNK;
        ZWQhM:NQhYS:
        goto N313x;
        DcpNK:
        $Order->appendCompleteMailMessage("" . $this->Config->getMailNotices());
        goto J36WT;
        qh23v:
        $arrAmazonCustomerParam = unserialize($amazonCustomerParam);
        goto BLu9N;
        UVHkx:
        logs('amazon_pay_v2')->info('[] .');
        goto vCgCe;
        SOXz0:
        goto NQhYS;
        goto HYCZL;
        C1weU:
        if ($Order->getOrderStatus() == $this->orderStatusRepository->find(OrderStatus::NEW)) {
            goto Isflu;
        }
        goto nQNYe;
        VCYNW:
        $result = $this->abortCheckoutResult($Order);
        goto wJGz5;
        Vf14m:
        $this->session->set($this->sessionAmazonCustomerParamKey, null);
        goto Pb93B;
        FKuvw:
        $this->cartService->clear();
        goto WwNlU;
        nQNYe:
        if ($Order->getOrderStatus() != $this->orderStatusRepository->find(OrderStatus::PENDING)) {
            goto GPwQO;
        }
        goto jBkGa;
        d876m:
        return $this->redirectToRoute('shopping_error');
        goto Tuviy;
        OlQg_:
        $this->session->set(OrderHelper::SESSION_ORDER_ID, $Order->getId());
        goto TkMl3;
        X2dGk:
        if ($Order) {
            goto Wq5px;
        }
        goto IHOcM;
        vCgCe:
        return $this->redirectToRoute('shopping_error');
        goto ZWQhM;
        nMySU:
    }

    function abortCheckoutResult($Order)
    {
        goto hfrPs;
        hfrPs:
        $this->session->set(OrderHelper::SESSION_ORDER_ID, $Order->getId());
        goto ujTD2;
        p_Xpd:
        $Order->setAmazonPayV2SessionTemp(null);
        goto WC7k5;
        LNu2r:
        $this->session->set($this->sessionAmazonCustomerErrorKey, null);
        goto w0fON;
        WC7k5:
        $this->session->set($this->sessionAmazonCheckoutSessionIdKey, null);
        goto rCAJy;
        ujTD2:
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);
        goto VM3nE;
        w0fON:
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);
        goto Sp2oF;
        VM3nE:
        $this->cartService->clear();
        goto p_Xpd;
        Sp2oF:
        return $this->redirectToRoute('shopping_complete');
        goto b1MT9;
        rCAJy:
        $this->session->set($this->sessionAmazonCustomerParamKey, null);
        goto LNu2r;
        b1MT9:
    }

    /**
     * , .
     * DB.
     *
     * @Route("/shopping/amazon_pay/redirect_to", name="amazon_pay_shopping_redirect_to", methods={"POST"})
     * @Template("Shopping/index.twig")
     */
    public function redirectTo(Request $request, RouterInterface $router)
    {
        goto gR0fV;
        MVnCI:
        logs('amazon_pay_v2')->info('Warning.', [$flowResult->getWarning()]);
        goto uYLn5;
        TliqA:
        if (!($form->isSubmitted() && $form->isValid())) {
            goto njmQf;
        }
        goto zlcKZ;
        oRfeD:R74mL:
        goto pPOsh;
        lChYp:
        $redirectTo = $form['redirect_to']->getData();
        goto iGUUA;
        G7bmu:
        logs('amazon_pay_v2')->info('Error.', [$flowResult->getErrors()]);
        goto xC_jd;
        sqBMW:
        $form->handleRequest($request);
        goto TliqA;
        zw60q:
        if (!$flowResult->hasError()) {
            goto JiSCY;
        }
        goto G7bmu;
        TL4D4:
        return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307);
        goto Vrye8;
        etrks:Tquyx:
        goto WO8oM;
        HTBRQ:
        if ($Order) {
            goto Tquyx;
        }
        goto KKmPe;
        uYLn5:
        return $this->redirectToRoute('amazon_pay_shopping');
        goto mbaDP;
        zMYqC:
        if (!$flowResult->hasWarning()) {
            goto dP7uH;
        }
        goto MVnCI;
        svCGn:
        return $this->redirectToRoute('amazon_pay_shopping');
        goto oRfeD;
        mbaDP:dP7uH:
        goto lChYp;
        pPOsh:
        try {
            goto eISYC;
            FOZqE:
            $result = $router->match($redirectTo);
            goto eugT2;
            eugT2:
            return $this->forwardToRoute($result['_route']);
            goto huw1S;
            eISYC:
            $pattern = '/^' . preg_quote($request->getBasePath(), '/') . '/';
            goto xJsDw;
            xJsDw:
            $redirectTo = preg_replace($pattern, '', $redirectTo);
            goto FOZqE;
            huw1S:
        } catch (\Exception $e) {
            logs('amazon_pay_v2')->info('[] URL', [$redirectTo, $e->getMessage()]);
            return $this->redirectToRoute('shopping_error');
        }
        goto IFDDe;
        xC_jd:
        return $this->redirectToRoute('shopping_error');
        goto bsX2z;
        Xvs7s:
        return $this->redirectToRoute('shopping_error');
        goto etrks;
        WO8oM:
        $form = $this->createForm(OrderType::class, $Order);
        goto sqBMW;
        zlcKZ:
        logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);
        goto fxCQr;
        XX29o:
        logs('amazon_pay_v2')->info('[] , .', [$Order->getId()]);
        goto TL4D4;
        KKmPe:
        logs('amazon_pay_v2')->info('[] .');
        goto Xvs7s;
        gR0fV:
        $preOrderId = $this->cartService->getPreOrderId();
        goto tn4s8;
        lu1uv:
        $this->entityManager->flush();
        goto zw60q;
        pRKzs:
        logs('amazon_pay_v2')->info('[] .');
        goto svCGn;
        IFDDe:njmQf:
        goto XX29o;
        fxCQr:
        $flowResult = $this->executePurchaseFlow($Order, false);
        goto lu1uv;
        tn4s8:
        $Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);
        goto HTBRQ;
        iGUUA:
        if (!empty($redirectTo)) {
            goto R74mL;
        }
        goto pRKzs;
        bsX2z:JiSCY:
        goto zMYqC;
        Vrye8:
    }

    /**
     * APIDB.
     *
     * @Route("/shopping/amazon_pay/order_save", name="amazon_pay_shopping_order_save", methods={"POST", "GET"})
     */
    public function orderSave(Request $request)
    {
        goto bOD8_;
        HUe1c:
        $this->entityManager->flush();
        goto WdEx2;
        s0Tn1:
        $form->handleRequest($request);
        goto uAs5n;
        AaqI7:KXYXc:
        goto JIKYw;
        WqxCb:
        if (!$flowResult->hasWarning()) {
            goto KXYXc;
        }
        goto NIxnU;
        z1wzV:
        $preOrderId = $this->cartService->getPreOrderId();
        goto l7Wby;
        ztEAo:
        logs('amazon_pay_v2')->info('executePurchaseFlowError.', [$flowResult->getErrors()]);
        goto gU2_c;
        JIKYw:
        return $this->json([]);
        goto QsZsk;
        l7Wby:
        $Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);
        goto EkfeD;
        kTiTG:
        return $this->json(['error' => 'validateError'], 500);
        goto KNim3;
        AQs1R:a_OKn:
        goto GvKvx;
        Xt5wm:
        return $this->json(['error' => 'executePurchaseFlow::Warning'], 500);
        goto AaqI7;
        SIz68:
        $this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam));
        goto hEUw_;
        QsZsk:uFBMG:
        goto aYoJZ;
        EkfeD:
        if ($Order) {
            goto a_OKn;
        }
        goto m9WW7;
        GvKvx:
        $form = $this->createForm(OrderType::class, $Order);
        goto s0Tn1;
        uAs5n:
        $arrAmazonCustomerParam = $this->getAmazonCustomerParam($request);
        goto SIz68;
        hro4e:
        logs('amazon_pay_v2')->info('.', [$Order->getId()]);
        goto WmI0K;
        bOD8_:
        if ($request->isXmlHttpRequest()) {
            goto pFe26;
        }
        goto MOeYJ;
        aYoJZ:
        logs('amazon_pay_v2')->info('.');
        goto kTiTG;
        Y4GYF:pFe26:
        goto z1wzV;
        AHzuh:zQaPb:
        goto WqxCb;
        m9WW7:
        logs('amazon_pay_v2')->info('.');
        goto lbbQo;
        lbbQo:
        return $this->json(['error' => 'OrderNotFound'], 500);
        goto AQs1R;
        WdEx2:
        if (!$flowResult->hasError()) {
            goto zQaPb;
        }
        goto ztEAo;
        gU2_c:
        return $this->json(['error' => 'executePurchaseFlow::Error'], 500);
        goto AHzuh;
        WmI0K:
        $flowResult = $this->executePurchaseFlow($Order, false);
        goto HUe1c;
        NIxnU:
        logs('amazon_pay_v2')->info('executePurchaseFlowWarning.', [$flowResult->getWarning()]);
        goto Xt5wm;
        MOeYJ:
        throw new BadRequestHttpException();
        goto Y4GYF;
        hEUw_:
        if (!($form->isSubmitted() && $form->isValid())) {
            goto uFBMG;
        }
        goto hro4e;
        KNim3:
    }

    private function createPaymentMethod(Order $Order, FormInterface $form, $amazonCheckoutSessionId = null)
    {
        goto jtu82;
        jtu82:
        $PaymentMethod = $this->serviceContainer->get($Order->getPayment()->getMethodClass());
        goto TBiii;
        u2Ay6:
        return $PaymentMethod;
        goto NmH22;
        XNMsv:k4gzT:
        goto u2Ay6;
        UU61s:
        if (is_null($amazonCheckoutSessionId)) {
            goto k4gzT;
        }
        goto qtKAs;
        TBiii:
        $PaymentMethod->setOrder($Order);
        goto WeAFq;
        qtKAs:
        $PaymentMethod->setAmazonCheckoutSessionId($amazonCheckoutSessionId);
        goto XNMsv;
        WeAFq:
        $PaymentMethod->setFormType($form);
        goto UU61s;
        NmH22:
    }

    protected function executeCheckout(AmazonPay $paymentMethod, Order $Order)
    {
        goto SMShg;
        H3NJ4:
        logs('amazon_pay_v2')->info('[] PaymentMethod::checkout, .', [$PaymentResult->getErrors()]);
        goto X5HaZ;
        rFVW8:
        foreach ($PaymentResult->getErrors() as $error) {
            $this->addError($error);
            aTnSI:
        }
        goto WEnbd;
        mv3LP:
        $response = $PaymentResult->getResponse();
        goto An78P;
        SMShg:
        $PaymentResult = $paymentMethod->checkout();
        goto mv3LP;
        X5HaZ:
        return $this->redirectToRoute('shopping_error');
        goto RbdMl;
        An78P:
        if (!($response && ($response->isRedirection() || $response->getContent()))) {
            goto I5gny;
        }
        goto nco0j;
        RbdMl:n6TIe:
        goto sVL0S;
        IphrN:
        if ($PaymentResult->isSuccess()) {
            goto n6TIe;
        }
        goto n69Tx;
        EqegQ:I5gny:
        goto IphrN;
        d6Q67:
        return $response;
        goto EqegQ;
        nco0j:
        $this->entityManager->flush();
        goto OfsLy;
        OfsLy:
        logs('amazon_pay_v2')->info('[] PaymentMethod::checkout.');
        goto d6Q67;
        WEnbd:vzPge:
        goto H3NJ4;
        n69Tx:
        $this->purchaseFlow->rollback($Order, new PurchaseContext());
        goto rFVW8;
        sVL0S:
    }

    private function getAmazonCustomerParam($request)
    {
        goto bpbQ2;
        s95Jr:
        $mail_magazine = empty($request->get('_shopping_order')['mail_magazine']) ? false : true;
        goto tbpt1;
        oGxuE:
        $amazon_login_email_v2 = empty($request->get('_shopping_order')['amazon_login_email_v2']) ? null : $request->get('_shopping_order')['amazon_login_email_v2'];
        goto YDGqo;
        RUJjg:
        return ['customer_regist_v2' => $customer_regist_v2, 'mail_magazine' => $mail_magazine, 'login_check_v2' => $login_check_v2, 'amazon_login_email_v2' => $amazon_login_email_v2, 'amazon_login_password_v2' => $amazon_login_password_v2];
        goto IBRyS;
        tbpt1:
        $login_check_v2 = empty($request->get('_shopping_order')['login_check_v2']) ? null : $request->get('_shopping_order')['login_check_v2'];
        goto oGxuE;
        bpbQ2:
        $customer_regist_v2 = empty($request->get('_shopping_order')['customer_regist_v2']) ? false : true;
        goto s95Jr;
        YDGqo:
        $amazon_login_password_v2 = empty($request->get('_shopping_order')['amazon_login_password_v2']) ? null : $request->get('_shopping_order')['amazon_login_password_v2'];
        goto RUJjg;
        IBRyS:
    }

    private function checkAmazonCustomerError($request, $form, $Order)
    {
        goto O0x75;
        Z8Nkc:Q6J2s:
        goto BFDtj;
        IGmk1:
        $arrError['customer_regist_v2'] = ' ' . $Order->getEmail() . '';
        goto L_UuX;
        ykaaK:qvmLu:
        goto IGmk1;
        O0x75:
        $arrError = [];
        goto ODqqR;
        F1HZH:
        foreach ($violations as $violation) {
            $amazon_login_email_v2_error .= $violation->getMessage() . PHP_EOL;
            PTVpX:
        }
        goto oKOJF;
        Ha9kH:
        if (!('POST' === $request->getMethod() && strpos($request_uri, 'shopping/amazon_pay/address') === false && strpos($request_uri, 'shopping/amazon_pay/delivery') === false)) {
            goto guyRX;
        }
        goto EuaBm;
        eXX1q:ocst0:
        goto Q466b;
        ODqqR:
        if (!(!$this->isGranted('IS_AUTHENTICATED_FULLY') && $this->Config->getLoginRequired() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on'])) {
            goto iJ1uw;
        }
        goto u7Vww;
        qFwBx:
        $profile = unserialize($this->session->get($this->sessionAmazonProfileKey));
        goto gCqIg;
        K5ia8:
        $Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $Order->getEmail()]);
        goto qFwBx;
        W2Gcl:
        $arrError['amazon_login_password_v2'] = ' ' . $amazon_login_password_v2_error;
        goto wVGXf;
        bn4qb:
        $arrError['amazon_login_email_v2'] = ' ';
        goto eGUwb;
        iDN79:
        if (empty($AmazonCustomer[0])) {
            goto pn4FT;
        }
        goto xZ_bq;
        nVewU:
        $arrError['amazon_login_email_v2'] = ' ' . $amazon_login_email_v2_error;
        goto lAYQY;
        gCqIg:
        $AmazonCustomer = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);
        goto jRltB;
        L_UuX:bpCus:
        goto yQZuS;
        VzDvK:
        if ($login_check_v2 == 'regist') {
            goto SV7VO;
        }
        goto L70PH;
        xn0QP:rimeB:
        goto wfT9r;
        hIQk2:
        $amazon_login_email_v2_error = '';
        goto F1HZH;
        HFX4z:
        $amazon_login_password_v2_error = '';
        goto Hxzp6;
        wq98Y:guyRX:
        goto WJ4En;
        BlYes:RFW2b:
        goto wq98Y;
        BFDtj:
        goto S0Wzw;
        goto nAGJG;
        KsJPP:
        if (!(empty($login_check_v2_error) && empty($amazon_login_email_v2_error) && empty($amazon_login_password_v2_error))) {
            goto Td7gj;
        }
        goto ndvEE;
        Uc8KM:
        goto bpCus;
        goto ykaaK;
        hBYVq:
        if (empty($amazon_login_email_v2_error)) {
            goto pt_Sq;
        }
        goto nVewU;
        xZ_bq:
        $arrError['customer_regist_v2'] = ' Amazon' . $AmazonCustomer[0]->getEmail() . '';
        goto C18pn;
        u7Vww:
        $request_uri = $request->getUri();
        goto Ha9kH;
        nAGJG:tApo2:
        goto bn4qb;
        Q466b:
        if (empty($amazon_login_password_v2_error)) {
            goto o3OFc;
        }
        goto W2Gcl;
        yKQa8:
        $arrError['amazon_login_email_v2'] = ' ';
        goto Z8Nkc;
        FWfmv:SV7VO:
        goto zfYSR;
        EuaBm:
        $login_check_v2 = $form['login_check_v2']->getData();
        goto VzDvK;
        oz_9F:yAkIl:
        goto BlYes;
        jRltB:
        if (!empty($Customer[0])) {
            goto qvmLu;
        }
        goto iDN79;
        yQZuS:
        goto yAkIl;
        goto kJD_E;
        MScNC:
        $violations = $this->validator->validate($form['amazon_login_email_v2']->getData(), [new Assert\NotBlank(), new Assert\Email()]);
        goto hIQk2;
        kJD_E:fJ_mc:
        goto ZQWtC;
        zfYSR:
        if (empty($form['customer_regist_v2']->getData())) {
            goto fJ_mc;
        }
        goto K5ia8;
        m98cE:
        if (empty($Customer[0])) {
            goto tApo2;
        }
        goto Q2QZ2;
        O3WVX:
        $violations = $this->validator->validate($form['amazon_login_password_v2']->getData(), [new Assert\NotBlank()]);
        goto HFX4z;
        oKOJF:iQ17u:
        goto hBYVq;
        Hxzp6:
        foreach ($violations as $violation) {
            $amazon_login_password_v2_error .= $violation->getMessage() . PHP_EOL;
            VWh9e:
        }
        goto eXX1q;
        jCG5P:
        $salt = $Customer[0]->getSalt();
        goto c6EJJ;
        L70PH:
        if (!($login_check_v2 == 'login')) {
            goto rimeB;
        }
        goto MScNC;
        D7mXt:
        if ($encoder->isPasswordValid($customerPassword, $form['amazon_login_password_v2']->getData(), $salt)) {
            goto Q6J2s;
        }
        goto yKQa8;
        Q2QZ2:
        $encoder = $this->encoderFactory->getEncoder($Customer[0]);
        goto jCG5P;
        wVGXf:o3OFc:
        goto KsJPP;
        wfT9r:
        goto RFW2b;
        goto FWfmv;
        WJ4En:iJ1uw:
        goto MPmki;
        eGUwb:S0Wzw:
        goto YHVOG;
        ndvEE:
        $Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $form['amazon_login_email_v2']->getData()]);
        goto m98cE;
        YHVOG:Td7gj:
        goto xn0QP;
        c6EJJ:
        $customerPassword = $Customer[0]->getPassword();
        goto D7mXt;
        C18pn:pn4FT:
        goto Uc8KM;
        ZQWtC:
        $arrError['customer_regist_v2'] = ' ';
        goto oz_9F;
        lAYQY:pt_Sq:
        goto O3WVX;
        MPmki:
        return $arrError;
        goto b1XB0;
        b1XB0:
    }

    private function setLogin($request, $Order, $email)
    {
        goto GegUd;
        st39L:
        return $ret;
        goto s4jcJ;
        kY8lj:
        try {
            goto r74YX;
            Ptj31:
            $this->tokenStorage->setToken($token);
            goto j4WEX;
            r74YX:
            $Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $email]);
            goto pLxDs;
            gIoRu:
            $token = new UsernamePasswordToken($Customer[0], null, 'customer', ['ROLE_USER']);
            goto Ptj31;
            j4WEX:
            $this->amazonOrderHelper->copyToOrderFromCustomer($Order, $Customer[0]);
            goto eGDjI;
            pLxDs:
            $Order->setCustomer($Customer[0]);
            goto gIoRu;
            eGDjI:
            $ret = true;
            goto ujBia;
            ujBia:
        } catch (\Exception $e) {
            logs('amazon_pay_v2')->error($e);
        }
        goto st39L;
        GegUd:
        $ret = false;
        goto kY8lj;
        s4jcJ:
    }

    private function setAmazonCustomerData($form, $arrAmazonCustomerParam)
    {
        goto G3kae;
        uzDDb:
        $form->get('amazon_login_email_v2')->setData($arrAmazonCustomerParam['amazon_login_email_v2']);
        goto IG8U0;
        NAWyD:
        if (!($this->Config->getLoginRequired() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on'] && !$this->isGranted('IS_AUTHENTICATED_FULLY'))) {
            goto ux3Rs;
        }
        goto SaKOx;
        QD1rc:EhBh6:
        goto NAWyD;
        IG8U0:
        $form->get('amazon_login_password_v2')->setData($arrAmazonCustomerParam['amazon_login_password_v2']);
        goto Mg3_2;
        uZl10:
        if (!($this->pluginRepository->findOneBy(['code' => 'MailMagazine42', 'enabled' => true]) || $this->pluginRepository->findOneBy(['code' => 'PostCarrier42', 'enabled' => true]))) {
            goto EhBh6;
        }
        goto CHw1r;
        CHw1r:
        $form->get('mail_magazine')->setData($arrAmazonCustomerParam['mail_magazine']);
        goto QD1rc;
        SaKOx:
        $form->get('login_check_v2')->setData($arrAmazonCustomerParam['login_check_v2']);
        goto uzDDb;
        Mg3_2:ux3Rs:
        goto bLA33;
        G3kae:
        $form->get('customer_regist_v2')->setData($arrAmazonCustomerParam['customer_regist_v2']);
        goto uZl10;
        bLA33:
    }

    public function getPendingProcessingOrder($preOrderId = null)
    {
        goto x8tDQ;
        qaykP:
        return null;
        goto gVFvi;
        Cji0Z:
        $OrderStatus = $this->orderStatusRepository->find(OrderStatus::PENDING);
        goto QEfKW;
        QEfKW:
        return $this->orderRepository->findOneBy(['pre_order_id' => $preOrderId, 'OrderStatus' => $OrderStatus]);
        goto VMuMN;
        x8tDQ:
        if (!(null === $preOrderId)) {
            goto kW9pX;
        }
        goto qaykP;
        gVFvi:kW9pX:
        goto Cji0Z;
        VMuMN:
    }

    private function checkShippingDifference($Order, $shippingAddress)
    {
        goto DXSlO;
        XyUNC:
        $shippingDifference = false;
        goto AfnzL;
        Qnukx:
        $this->amazonOrderHelper->convert($amazonShipping, $shippingAddress);
        goto MhWoE;
        Q21Xd:
        $amazonShipping->setOrder($Order);
        goto Qnukx;
        AfnzL:
        if (!($Shippings->first()->getPostalCode() !== $amazonShipping->getPostalCode() || $Shippings->first()->getName01() !== $amazonShipping->getName01() || $Shippings->first()->getName02() !== $amazonShipping->getName02() || $Shippings->first()->getKana01() !== $amazonShipping->getKana01() || $Shippings->first()->getKana02() !== $amazonShipping->getKana02() || $Shippings->first()->getPref() !== $amazonShipping->getPref() || $Shippings->first()->getAddr01() !== $amazonShipping->getAddr01() || $Shippings->first()->getAddr02() !== $amazonShipping->getAddr02())) {
            goto ak7GS;
        }
        goto G0Iwo;
        Hmkgr:ak7GS:
        goto cbFvz;
        G0Iwo:
        $shippingDifference = true;
        goto Hmkgr;
        MhWoE:
        $Shippings = $Order->getShippings();
        goto XyUNC;
        cbFvz:
        return $shippingDifference;
        goto wnXb4;
        DXSlO:
        $amazonShipping = new Shipping();
        goto Q21Xd;
        wnXb4:
    }

    protected function getAmazonPayDefaultDelivery(Shipping $Shipping)
    {
        goto n4tEg;
        nsls1:
        foreach ($OrderItems as $OrderItem) {
            goto Z_9M3;
            B7guc:
            $SaleType = $ProductClass->getSaleType();
            goto CdIw7;
            CdIw7:
            $SaleTypes[$SaleType->getId()] = $SaleType;
            goto tv3D5;
            Z_9M3:
            $ProductClass = $OrderItem->getProductClass();
            goto B7guc;
            tv3D5:k43zi:
            goto ZxM6I;
            ZxM6I:
        }
        goto xnTvn;
        NEIbL:rrfk1:
        goto W7bs4;
        oOsfl:
        $SaleTypes = [];
        goto nsls1;
        xnTvn:sa5zU:
        goto oaZtg;
        TCtkL:
        foreach ($Deliveries as $key => $Delivery) {
            goto gxhbY;
            QJ90X:
            foreach ($PaymentOptions as $PaymentOption) {
                goto crbmG;
                KNyJQ:
                goto ZooKz;
                goto IQG_V;
                crbmG:
                $Payment = $PaymentOption->getPayment();
                goto xcC6h;
                IQG_V:rqAQg:
                goto saYMv;
                xcC6h:
                if (!($Payment->getMethodClass() === AmazonPay::class)) {
                    goto rqAQg;
                }
                goto BtDkp;
                BtDkp:
                $amazonPayFlg = true;
                goto KNyJQ;
                saYMv:ab0HS:
                goto HB1mH;
                HB1mH:
            }
            goto x2IHY;
            gxhbY:
            $PaymentOptions = $Delivery->getPaymentOptions();
            goto pu794;
            IAS4O:IytQ_:
            goto pV97G;
            CLPLm:I5nEw:
            goto IAS4O;
            x2IHY:ZooKz:
            goto Nvntm;
            Nvntm:
            if ($amazonPayFlg) {
                goto I5nEw;
            }
            goto X_DSq;
            pu794:
            $amazonPayFlg = false;
            goto QJ90X;
            X_DSq:
            unset($Deliveries[$key]);
            goto CLPLm;
            pV97G:
        }
        goto NEIbL;
        n4tEg:
        $OrderItems = $Shipping->getProductOrderItems();
        goto oOsfl;
        oaZtg:
        $Deliveries = $this->deliveryRepository->getDeliveries($SaleTypes);
        goto TCtkL;
        nLa7h:
        return $Delivery;
        goto GxM8x;
        W7bs4:
        $Delivery = current($Deliveries);
        goto nLa7h;
        GxM8x:
    }
}

Function Calls

None

Variables

None

Stats

MD5 543477d80376961008e03f4eb3932958
Eval Count 0
Decode Time 88 ms