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-06-12 16:46:08              | 
    |    GitHub: https://github.com/pk-fr/yakpro-po    | 
    |__________________________________________________| 
*/ 
namespace Plugin\AmazonPayV2\Controller;use Eccube\Entity\Delivery;use Eccube\Entity\OrderItem;use Eccube\Repository\DeliveryRepository;use Eccube\Repository\Master\OrderStatusRepository;use Eccube\Repository\OrderRepository;use Plugin\AmazonPayV2\Repository\ConfigRepository;use Plugin\AmazonPayV2\Service\AmazonOrderHelper;use Plugin\AmazonPayV2\Service\AmazonRequestService;use Plugin\AmazonPayV2\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\Exception\AmazonPaymentException;use Plugin\AmazonPayV2\Amazon\Pay\API\Client;use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;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;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){goto ABVtp;ANszI:$this->prefRepository = $prefRepository;goto poddg;R0Hkf:$this->orderStatusRepository = $orderStatusRepository;goto ANszI;RQj5H:$this->validator = $validator;goto Log7n;Gs76t:$this->cartService = $cartService;goto mZj1j;e8JtZ:$this->amazonRequestService = $amazonRequestService;goto RQj5H;VlnqG:$this->deliveryRepository = $deliveryRepository;goto DAZ03;x_avn:$this->Config = $configRepository->get();goto Su8GZ;rsgkg:$this->customerRepository = $customerRepository;goto HA1gX;KHW33:$this->customerPurchaseInfoProcessor = $customerPurchaseInfoProcessor;goto TiRBT;ABVtp:$this->eccubeConfig = $eccubeConfig;goto WkJCf;mZj1j:$this->mailService = $mailService;goto Svfcn;HA1gX:$this->orderRepository = $orderRepository;goto R0Hkf;Log7n:$this->encoderFactory = $encoderFactory;goto o13OH;poddg:$this->productClassRepository = $productClassRepository;goto aBZcn;DAZ03:$this->addPointProcessor = $addPointProcessor;goto KHW33;Svfcn:$this->orderHelper = $orderHelper;goto rsgkg;Su8GZ:$this->amazonOrderHelper = $amazonOrderHelper;goto e8JtZ;o13OH:$this->tokenStorage = $tokenStorage;goto VlnqG;WkJCf:$this->purchaseFlow = $cartPurchaseFlow;goto Gs76t;aBZcn:$this->pluginRepository = $pluginRepository;goto x_avn;TiRBT:}    /** 
     * @Route("/shopping/amazon_pay", name="amazon_pay_shopping") 
     * @Template("Shopping/index.twig") 
     * 
     * @param Request $request 
     */ 
public function index(Request $request, PurchaseFlow $cartPurchaseFlow){goto O6oL0;h87IH:S7VKj:goto LP8EG;JJXVH:logs('amazon_pay_v2')->info('[] , .');goto EOMrz;IQVre:$Shipping->setShippingDeliveryName($AmazonDefaultDelivery->getName());goto dXVyS;k8SAZ:viJpW:goto MsW8E;Z0fTQ:if ($Cart && $this->orderHelper->verifyCart($Cart)) {goto C_7e0;}goto JJXVH;iHhfj:$arrAmazonCustomerParam['mail_magazine'] = false;goto k8SAZ;GKq6X:if (!($checkoutSession && $checkoutSession->statusDetails->state !== 'Open')) {goto apXWm;}goto rqXrQ;A9KS0:if (!$this->session->get($this->sessionIsShippingRefresh)) {goto Ah_lX;}goto o4Njs;HhF_H:$Shipping->setDelivery($AmazonDefaultDelivery);goto IQVre;QR1ji:$this->session->set($this->sessionAmazonCustomerErrorKey, null);goto jPoC6;b8G5r:foreach ($arrAmazonCustomerError as $key => $val) {$form[$key]->addError(new FormError($val));pAKMq:}goto DcMAB;CEZn4:QQBYF:goto qpZ3v;lpcgU:$this->session->set(OrderHelper::SESSION_NON_MEMBER, $Customer);goto vr3Rx;fM29h:$Shipping = $Order->getShippings()->first();goto wBWPa;bz3uI:$flowResult = $this->executePurchaseFlow($Order, false);goto UnAue;DcMAB:NdS2a:goto QR1ji;KmgdV:$this->cartService->save();goto W1694;QwoyE:$checkoutSession = $this->amazonRequestService->getCheckoutSession($amazonCheckoutSessionId);goto GKq6X;MxHB2:$this->amazonOrderHelper->convert($Shippings->first(), $checkoutSession->shippingAddress);goto dYjcs;LP8EG:if (!$flowResult->hasWarning()) {goto WSbOa;}goto L_u6w;k7gXI:goto COWui;goto zigoG;kVJkP:logs('amazon_pay_v2')->info('[] .');goto OkwpX;vr3Rx:YyNkC:goto IhAP2;giPAG:$amazonCheckoutSessionId = $this->session->get($this->sessionAmazonCheckoutSessionIdKey);goto QwoyE;fyJGw:$arrAmazonCustomerParam = ['customer_regist_v2' => true, 'mail_magazine' => true, 'login_check_v2' => 'regist', 'amazon_login_email_v2' => null, 'amazon_login_password_v2' => null];goto ICYST;L_u6w:logs('amazon_pay_v2')->info('[] Warning.', [$flowResult->getWarning()]);goto NLdEB;IhAP2:$initOrderFlg = false;goto Y5ZIo;qpZ3v:$Order = $this->amazonOrderHelper->initializeAmazonOrder($Order, $Customer);goto A9KS0;ICYST:goto v_KUI;goto z9Y6J;wx5O8:if (!empty($arrAmazonCustomerParam['mail_magazine'])) {goto viJpW;}goto iHhfj;bpfA0:$arrAmazonCustomerParam['customer_regist_v2'] = false;goto kmzQq;dYjcs:$Shippings->first()->setCompanyName('');goto n9Fcm;ai29h:$arrAmazonCustomerParam = unserialize($amazonCustomerParam);goto EKP9P;oLOgc:if (!($AmazonDefaultDelivery === false)) {goto ozKNH;}goto tvtW7;bpttu:if (!($initOrderFlg && $AmazonDefaultDelivery)) {goto QQBYF;}goto HhF_H;VUYZN:GS4n0:goto eO3Za;MsW8E:v_KUI:goto pWWPx;zmQPB:if (!$Order->isMultiple()) {goto GS4n0;}goto CkVyq;Y6w0Z:$this->session->remove($this->sessionIsShippingRefresh);goto RO00p;n9Fcm:$this->entityManager->flush();goto Y6w0Z;BB0pe:$Cart = $this->cartService->getCart();goto Z0fTQ;mIMBX:$this->session->remove($this->sessionAmazonCheckoutSessionIdKey);goto iyYk0;NLdEB:$cartPurchaseFlow->validate($Cart, new PurchaseContext());goto KmgdV;Buj6C:if ($this->isGranted('ROLE_USER')) {goto YyNkC;}goto lpcgU;jPoC6:CCZO4:goto cJ3Pd;W1694:WSbOa:goto pNF_P;dXVyS:$this->entityManager->flush();goto CEZn4;EOMrz:return $this->redirectToRoute('cart');goto xnl8h;eO3Za:COWui:goto hiNIC;OkwpX:$Customer = $this->getUser() ? $this->getUser() : $this->amazonOrderHelper->getOrderer($checkoutSession->shippingAddress);goto Buj6C;wkzBR:OfkML:goto Wfqju;pWWPx:$form = $this->createForm(OrderType::class, $Order);goto sbaox;pNF_P:if ($amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey)) {goto Dmzgt;}goto fyJGw;qYn92:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto bz3uI;wBWPa:$AmazonDefaultDelivery = $this->getAmazonPayDefaultDelivery($Shipping);goto oLOgc;hO8_v:apXWm:goto kVJkP;YrhXX:return ['form' => $form->createView(), 'Order' => $Order, 'AmazonCustomer' => $arrAmazonCustomerParam, 'AmazonPaymentDescriptor' => $checkoutSession->paymentPreferences[0]->paymentDescriptor, 'AmazonShippingAddress' => $checkoutSession->shippingAddress];goto HLQaa;xnl8h:C_7e0:goto giPAG;kmzQq:Pz5xT:goto wx5O8;o4Njs:$Shippings = $Order->getShippings();goto MxHB2;Wfqju:if (!($amazonCustomerError = $this->session->get($this->sessionAmazonCustomerErrorKey))) {goto CCZO4;}goto hSzx5;sdCSP:$this->setAmazonCustomerData($form, $arrAmazonCustomerParam);goto wkzBR;UnAue:$this->entityManager->flush();goto BQFg7;cjV1f:return $this->redirectToRoute('shopping_error');goto h87IH;tvtW7:$this->addError('Amazon Pay');goto k2v1k;iyYk0:return $this->redirectToRoute('shopping_error');goto hO8_v;rqXrQ:logs('amazon_pay_v2')->info('[] CheckoutSessionOpen.', ['CheckoutSessionId => $amazonCheckoutSessionId']);goto mIMBX;EKP9P:if (!empty($arrAmazonCustomerParam['customer_regist_v2'])) {goto Pz5xT;}goto bpfA0;Tovlh:logs('amazon_pay_v2')->info('AmazonShopping::index end.');goto YrhXX;k2v1k:ozKNH:goto bpttu;RO00p:Ah_lX:goto qYn92;hiNIC:$Order = $this->orderHelper->initializeOrder($Cart, $Customer);goto fM29h;CkVyq:$Cart->setPreOrderId(null);goto VUYZN;O6oL0:logs('amazon_pay_v2')->info('AmazonShopping::index start.');goto BB0pe;z9Y6J:Dmzgt:goto ai29h;sbaox:if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {goto OfkML;}goto sdCSP;Y5ZIo:if ($Order = $this->orderHelper->getPurchaseProcessingOrder($Cart->getPreOrderId())) {goto mqp36;}goto GXimb;BQFg7:if (!$flowResult->hasError()) {goto S7VKj;}goto sO3mB;zigoG:mqp36:goto zmQPB;cJ3Pd:$form->handleRequest($request);goto Tovlh;sO3mB:logs('amazon_pay_v2')->info('[] Error.', [$flowResult->getErrors()]);goto cjV1f;hSzx5:$arrAmazonCustomerError = unserialize($amazonCustomerError);goto b8G5r;GXimb:$initOrderFlg = true;goto k7gXI;HLQaa:}    /** 
     *  
     * 
     * @Route("/shopping/amazon_pay/confirm", name="amazon_pay_shopping_confirm", methods={"POST"}) 
     * @Template("Shopping/confirm.twig") 
     */ 
public function confirm(Request $request){goto PeMa_;d5ZuJ:logs('amazon_pay_v2')->info('[] , .');goto tHeia;DeJWV:logs('amazon_pay_v2')->info('[] PaymentMethod::verify.', [$Order->getPayment()->getMethodClass()]);goto wG5Cd;qAfNZ:return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307);goto x3yAQ;L6YhM:return $this->redirectToRoute('shopping_error');goto oIQGk;Nhb6O:$this->entityManager->flush();goto JpdMY;FEZXt:$this->entityManager->flush();goto fSr1o;lhq5A:if (!($response && ($response->isRedirection() || $response->getContent()))) {goto YMhfT;}goto Nhb6O;zh4Gl:ZDvoM:goto FEZXt;ihL4A:oF3vD:goto FT19E;c_Omu:logs('amazon_pay_v2')->info('[] PaymentMethod::verify, .', [$PaymentResult->getErrors()]);goto hEfZp;qOCso:return ['form' => $form->createView(), 'Order' => $Order];goto ihL4A;uLqn8:if (!$PaymentResult) {goto ZDvoM;}goto RPE98;On1jk:$response = $PaymentResult->getResponse();goto lhq5A;Zn5l7:zW0c0:goto DeJWV;e0DOb:$form = $this->createForm(OrderType::class, $Order);goto Ui9yZ;tHeia:return $this->redirectToRoute('cart');goto QHdW3;gQ9K5:return $this->redirectToRoute('amazon_pay_shopping');goto Ip65I;JsAjG:if (!($form->isSubmitted() && $form->isValid())) {goto oF3vD;}goto q6tW6;fSr1o:logs('amazon_pay_v2')->info('[] .');goto qOCso;PeMa_:logs('amazon_pay_v2')->info('AmazonShopping::confirm start.');goto LBPc3;JpdMY:logs('amazon_pay_v2')->info('[] PaymentMethod::verify.');goto reW9b;D8dne:$form->handleRequest($request);goto xL38Z;hEfZp:return $this->redirectToRoute('amazon_pay_shopping');goto vz7m_;uDs5D:if ($Order) {goto l2ILn;}goto wIeEw;xL38Z:if (!($arrAmazonCustomerError = $this->checkAmazonCustomerError($request, $form, $Order))) {goto HemaM;}goto yVgIW;c7f1a:$arrAmazonCustomerParam = $this->getAmazonCustomerParam($request);goto wDcH8;Lx1uv:YMhfT:goto zh4Gl;wDcH8:$this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam));goto e0DOb;i9ah5:$PaymentResult = $paymentMethod->verify();goto uLqn8;reW9b:return $response;goto Lx1uv;qRbX3:$response = $this->executePurchaseFlow($Order);goto wVfTG;wG5Cd:$paymentMethod = $this->createPaymentMethod($Order, $form);goto i9ah5;yU7MA:if ($Cart && $this->orderHelper->verifyCart($Cart)) {goto axEOx;}goto d5ZuJ;wIeEw:logs('amazon_pay_v2')->info('[] .');goto L6YhM;QHdW3:axEOx:goto JLjD9;pemDp:$this->entityManager->rollback();goto yoLoO;Ip65I:HemaM:goto JsAjG;yVgIW:$this->session->set($this->sessionAmazonCustomerErrorKey, serialize($arrAmazonCustomerError));goto gQ9K5;W1j9C:return $this->redirectToRoute('amazon_pay_shopping');goto Zn5l7;Ui9yZ:if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {goto Yh3vl;}goto bV96e;ypZE_:Yh3vl:goto D8dne;FT19E:logs('amazon_pay_v2')->info('[] , ', [$Order->getId()]);goto qAfNZ;LBPc3:$Cart = $this->cartService->getCart();goto yU7MA;mLv4D:if (!$response) {goto zW0c0;}goto W1j9C;q6tW6:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto qRbX3;bV96e:$this->setAmazonCustomerData($form, $arrAmazonCustomerParam);goto ypZE_;RPE98:if ($PaymentResult->isSuccess()) {goto ZM39y;}goto pemDp;z1rqB:$Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);goto uDs5D;wVfTG:$this->entityManager->flush();goto mLv4D;RfYpN:C1JYY:goto c_Omu;oIQGk:l2ILn:goto c7f1a;yoLoO:foreach ($PaymentResult->getErrors() as $error) {$this->addError($error);nl8gh:}goto RfYpN;vz7m_:ZM39y:goto On1jk;JLjD9:$preOrderId = $this->cartService->getPreOrderId();goto z1rqB;x3yAQ:}    /** 
     *  
     * 
     * @Route("/shopping/amazon_pay/checkout", name="amazon_pay_shopping_checkout", methods={"POST"}) 
     * @Template("Shopping/index.twig") 
     */ 
public function checkout(Request $request){goto G9oaR;uEAE6:$arrAmazonCustomerParam = unserialize($amazonCustomerParam);goto HdJ7s;H85vZ:LpGG2:goto VHvZJ;zNxzt:logs('amazon_pay_v2')->info('[] , .');goto FYDKa;GufsD:if (!($arrAmazonCustomerError = $this->checkAmazonCustomerError($request, $form, $Order))) {goto Zua_G;}goto W8zif;XiOvn:$form->handleRequest($request);goto mqgHx;H4uaV:return $this->redirectToRoute('amazon_pay_shopping');goto qoLOB;jE2bD:Do4y_:goto jTQDO;n90kD:GEYwc:goto rQZhW;LrjvL:logs('amazon_pay_v2')->info('[] .');goto tDNgb;iMKAP:if (!($checkoutSession && $checkoutSession->statusDetails->state !== 'Open')) {goto sdYLz;}goto Syv7z;bH9Pp:$form = $this->createForm(OrderType::class, $Order);goto k1UWk;CJTKF:if ($Order) {goto Do4y_;}goto LrjvL;U02Sk:$this->entityManager->flush();goto Jf4AI;t_Lj0:brxzt:goto tmRO6;aq9lt:if (!$shippingDifference) {goto GEYwc;}goto Kl0Oi;HyO_i:aHPPR:goto XiOvn;PCD03:Zua_G:goto auXC1;nrX7Z:return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307);goto ePaoL;tmRO6:$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 h2aSA;Jf4AI:if (!$response) {goto azCq5;}goto H4uaV;tDNgb:return $this->redirectToRoute('shopping_error');goto jE2bD;vE26y:uurwL:goto aTgCL;GUnMo:$response = $this->executePurchaseFlow($Order);goto U02Sk;LuxPa:OoZcD:goto DMf9q;cf8Oc:logs('amazon_pay_v2')->info('[] PaymentMethod::apply.');goto tvPha;auXC1:goto sLE1s;goto wx0Il;tAFXm:return $this->redirectToRoute('amazon_pay_shopping');goto LuxPa;aTgCL:logs('amazon_pay_v2')->info('', [$Order->getId()]);goto nrX7Z;HFCmj:return $this->redirectToRoute('shopping_error');goto dbYZ4;w5SfC:$this->addError('');goto tAFXm;LEhwx:if ($Cart && $this->orderHelper->verifyCart($Cart)) {goto jPqhQ;}goto zNxzt;rJnVX:if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {goto aHPPR;}goto usWL9;J7YUf:return $this->redirectToRoute('amazon_pay_shopping');goto n90kD;Qm644:return $this->redirectToRoute('amazon_pay_shopping');goto PCD03;Nj2TO:return $this->redirectToRoute('shopping_error');goto vyYHC;wx0Il:LBU5i:goto yL6fr;KMwdP:logs('amazon_pay_v2')->error('reasonCode: ' . $checkoutSession->reasonCode . ' message: ' . $checkoutSession->message);goto w5SfC;vyYHC:plL55:goto iMKAP;iwT3J:if (!($form->isSubmitted() && $form->isValid())) {goto uurwL;}goto G6y00;twW4L:$shippingDifference = $this->checkShippingDifference($Order, $checkoutSession->shippingAddress);goto aq9lt;usWL9:$this->setAmazonCustomerData($form, $arrAmazonCustomerParam);goto HyO_i;SKkze:if ($this->Config->getUseConfirmPage() == $this->eccubeConfig['amazon_pay_v2']['toggle']['off']) {goto fb4MH;}goto k9_QF;k9_QF:$amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey);goto uEAE6;dbYZ4:sdYLz:goto SKkze;G6y00:if (!($Order->getPaymentTotal() == 0)) {goto LpGG2;}goto Pocb7;mqgHx:if ($this->Config->getUseConfirmPage() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on']) {goto LBU5i;}goto GufsD;XIBb4:$this->entityManager->flush();goto nykHg;Bn_zm:$this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam));goto bH9Pp;Kl0Oi:$this->session->set($this->sessionIsShippingRefresh, true);goto J7YUf;VHvZJ:$checkoutSession = $this->amazonRequestService->updateCheckoutSession($Order, $amazonCheckoutSessionId);goto B8lrE;h2aSA:$Order->setAmazonPayV2SessionTemp(serialize($session_temp));goto XIBb4;G9oaR:logs('amazon_pay_v2')->info('AmazonShopping::order start.');goto wGAWY;WlJwa:$this->session->remove($this->sessionAmazonCheckoutSessionIdKey);goto HFCmj;HR8Iv:$Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);goto CJTKF;PmAqh:return $this->redirectToRoute('amazon_pay_shopping');goto H85vZ;tvPha:if (!($response = $paymentMethod->apply())) {goto brxzt;}goto MzSvg;HdJ7s:$form = $this->createForm(OrderType::class, $Order, ['skip_add_form' => true]);goto aVtUp;Pocb7:$errMessage = AmazonPaymentException::$errorMessages[AmazonPaymentException::ZERO_PAYMENT];goto HtM0r;B8lrE:if (!isset($checkoutSession->reasonCode)) {goto OoZcD;}goto KMwdP;HtM0r:logs('amazon_pay_v2')->error('orderId: ' . $Order->getId() . ' message: ' . $errMessage);goto JyXR2;JyXR2:$this->addError($errMessage);goto PmAqh;Uugh8:$paymentMethod = $this->createPaymentMethod($Order, $form);goto cf8Oc;W8zif:$this->session->set($this->sessionAmazonCustomerErrorKey, serialize($arrAmazonCustomerError));goto Qm644;rQZhW:if ($this->amazonOrderHelper->checkShippingPref($checkoutSession->shippingAddress)) {goto plL55;}goto nAlk5;WXGBJ:fb4MH:goto J8oCX;wGAWY:$Cart = $this->cartService->getCart();goto LEhwx;nAlk5:$this->addError('amazon_pay_v2.front.shopping.undefined_pref_error');goto kZSuR;Syv7z:logs('amazon_pay_v2')->info('[] CheckoutSessionOpen.', ['CheckoutSessionId => $amazonCheckoutSessionId']);goto WlJwa;qoLOB:azCq5:goto Uugh8;MzSvg:return $response;goto t_Lj0;yL6fr:sLE1s:goto iwT3J;DMf9q:logs('amazon_pay_v2')->info('', [$Order->getId()]);goto GUnMo;J8oCX:$arrAmazonCustomerParam = $this->getAmazonCustomerParam($request);goto Bn_zm;k1UWk:CR4nP:goto rJnVX;blEBS:$checkoutSession = $this->amazonRequestService->getCheckoutSession($amazonCheckoutSessionId);goto twW4L;jTQDO:$amazonCheckoutSessionId = $this->session->get($this->sessionAmazonCheckoutSessionIdKey);goto blEBS;FYDKa:return $this->redirectToRoute('cart');goto SRhnT;SRhnT:jPqhQ:goto USP6i;nykHg:return new RedirectResponse($checkoutSession->webCheckoutDetails->amazonPayRedirectUrl);goto vE26y;USP6i:$preOrderId = $this->cartService->getPreOrderId();goto HR8Iv;kZSuR:logs('amazon_pay_v2')->error('[] ', [$Order->getId()]);goto Nj2TO;aVtUp:goto CR4nP;goto WXGBJ;ePaoL:}    /** 
     *  
     * 
     * @Route("/shopping/amazon_pay/checkout_result", name="amazon_pay_shopping_checkout_result") 
     */ 
public function checkoutResult(Request $request){goto dU7vD;G6595:return $result;goto fkTGg;PEq0B:$this->session->set($this->sessionAmazonCheckoutSessionIdKey, null);goto Pt_P5;Tmnwp:lzC2x:goto wg1JB;VokHK:ym1FZ:goto BuPOy;ZjWbE:$amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey);goto hgBm2;CLui9:uRfFN:goto lypku;KnDWV:fmHEX:goto I3pTI;oBQug:$this->entityManager->flush();goto NQAoZ;dU7vD:$preOrderId = $this->cartService->getPreOrderId();goto eXOar;lypku:logs('amazon_pay_v2')->info('[] .');goto IOhFq;ZtBlR:$this->entityManager->flush();goto PEq0B;eXOar:$Order = $this->orderRepository->findOneBy(['pre_order_id' => $preOrderId]);goto mhZby;Q_1gf:$Order->setAmazonPayV2SessionTemp(null);goto ZtBlR;nJCVU:logs('amazon_pay_v2')->info('[] . .', [$Order->getId()]);goto EAMJr;Bg17C:logs('amazon_pay_v2')->info('AmazonShopping::complete_order end.');goto DR6Hc;uqgqT:$this->entityManager->flush();goto G6595;uXpWC:return $this->redirectToRoute('shopping_error');goto fEO6N;xG33P:try {goto G0p2u;tEqOm:goto Zfuoe;goto E3ZI5;l74jS:NBeUz:goto eeikP;h2npy:$Customers = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);goto gbSxb;iPYiF:$Customer = $this->getUser();goto froZh;yqx3X:$this->customerPurchaseInfoProcessor->commit($Order, new PurchaseContext());goto JgP_i;Wionn:return $result;goto eh2_Z;DV9iQ:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto iEchu;XJRgh:if (!$this->setLogin($request, $Order, $arrAmazonCustomerParam['amazon_login_email_v2'])) {goto vKqXU;}goto ySlBE;EjOqN:$this->entityManager->flush();goto kEZMb;PTCBG:goto Q0Jkm;goto sVRiX;A3EpL:if (!($response = $this->executeCheckout($paymentMethod, $Order))) {goto XbBVZ;}goto k3Lm0;gbSxb:if (!(!$Customer->getV2AmazonUserId() && empty($Customers[0]))) {goto NBeUz;}goto ZDqUz;ah0tJ:tTAQo:goto ZDXxL;zKRdh:$amazonDtbCustomer = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);goto JTdRU;JTdRU:if ($dtbCustomer || $amazonDtbCustomer) {goto tTAQo;}goto LniYF;EnJqL:$Order->setCustomer($Customer);goto yqx3X;Zof7y:$Customer = $this->getUser();goto EnJqL;PqvkX:logs('amazon_pay_v2')->info('[] PaymentMethod::checkout.');goto A3EpL;SByNj:$LockedOrder = $this->orderRepository->find($Order['id'], LockMode::PESSIMISTIC_WRITE);goto JraTB;JgP_i:$mail = $Customer->getEmail();goto WdBlp;ZcjN9:tGuSp:goto btTYk;WdBlp:            $mail_message = <<<__EOS__ 
************************************************ 
 
************************************************ 
URL{$url} 
{$mail} 
{$password} 
 
__EOS__; 
goto IV9LD;fChGk:$paymentMethod = $this->createPaymentMethod($Order, $form, $amazonCheckoutSessionId);goto Gqa8P;bLdlq:$result = $this->abortCheckoutResult($Order);goto EjOqN;k3Lm0:return $response;goto P8uRE;UgiEL:            $mail_message = <<<__EOS__ 
************************************************ 
 
************************************************ 
URL{$url} 
{$mail} 
 
__EOS__; 
goto ZcjN9;o8Hwm:efdG7:goto tEqOm;q1g6S:$this->addPointProcessor->validate($Order, new PurchaseContext());goto OH0v9;hOv7x:$Customer->setV2AmazonUserId($profile->buyerId);goto Y9q_r;CAnOT:$url = $this->generateUrl('mypage_login', [], UrlGeneratorInterface::ABSOLUTE_URL);goto n3iJh;kEZMb:$this->entityManager->commit();goto Wionn;froZh:$Customers = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);goto ixAgU;sVRiX:ddqYB:goto xfOsb;ZoWTG:YMTzv:goto iPYiF;btTYk:$Order->setCompleteMailMessage($mail_message);goto qWZKs;RwxUn:if (!($Order['update_date'] != $LockedOrder['update_date'])) {goto mzRGa;}goto pUNrf;Gqa8P:$this->entityManager->beginTransaction();goto SByNj;qWZKs:PgtnX:goto gA3lV;eeikP:vKqXU:goto o8Hwm;RfbbE:goto OXuYx;goto ZoWTG;ZDqUz:$Customer->setV2AmazonUserId($profile->buyerId);goto l74jS;E3ZI5:lhHvj:goto RY9ly;G0p2u:logs('amazon_pay_v2')->info('', [$Order->getId()]);goto n5LQ0;pUNrf:logs('amazon_pay_v2')->info('[] ');goto bLdlq;IV9LD:goto tGuSp;goto ah0tJ;eh2_Z:mzRGa:goto PqvkX;ZDXxL:if ($amazonDtbCustomer) {goto ddqYB;}goto LltFG;dNxGh:logs('amazon_pay_v2')->info('AddPointProcessor.', [$Order->getId()]);goto q1g6S;n3iJh:$dtbCustomer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $Order->getEmail()]);goto zKRdh;OH0v9:$this->entityManager->flush();goto YBx6U;ySlBE:$Customer = $Order->getCustomer();goto h2npy;LniYF:$password = $this->amazonOrderHelper->registCustomer($Order, $arrAmazonCustomerParam['mail_magazine']);goto Zof7y;LltFG:$mail = $dtbCustomer[0]->getEmail();goto PTCBG;gA3lV:Zfuoe:goto RfbbE;eYiU0:if (empty($arrAmazonCustomerParam['login_check_v2']) || $arrAmazonCustomerParam['login_check_v2'] == 'regist') {goto lhHvj;}goto NGlzM;YBx6U:$this->entityManager->commit();goto DV9iQ;iEchu:logs('amazon_pay_v2')->info('', [$Order->getId()]);goto ru6Y3;NGlzM:if (!($arrAmazonCustomerParam['login_check_v2'] == 'login')) {goto efdG7;}goto XJRgh;RY9ly:if (!$arrAmazonCustomerParam['customer_regist_v2']) {goto PgtnX;}goto CAnOT;psFhZ:$profile = unserialize($this->session->get($this->sessionAmazonProfileKey));goto WqpR8;WqpR8:if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {goto YMTzv;}goto eYiU0;qurfk:Q0Jkm:goto UgiEL;Y9q_r:HGY2k:goto SI2Pj;xfOsb:$mail = $amazonDtbCustomer[0]->getEmail();goto qurfk;ixAgU:if (!(!$Customer->getV2AmazonUserId() && empty($Customers[0]))) {goto HGY2k;}goto hOv7x;P8uRE:XbBVZ:goto psFhZ;JraTB: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 RwxUn;SI2Pj:OXuYx:goto dNxGh;n5LQ0:$form = $this->createForm(OrderType::class, $Order);goto fChGk;ru6Y3:} catch (ShoppingException $e) {goto BFF2M;BFF2M:$this->addError($e->getMessage());goto EzOb5;EzOb5:logs('amazon_pay_v2')->error('', [$e->getMessage()]);goto GdKv3;LG7wP:$this->entityManager->commit();goto CWhtI;CWhtI:return $this->redirectToRoute('shopping_error');goto Ri235;kDrxB:$this->entityManager->flush();goto LG7wP;GdKv3:$this->purchaseFlow->rollback($Order, new PurchaseContext());goto kDrxB;Ri235:} catch (AmazonPaymentException $e) {goto M9ucX;VrelQ:logs('amazon_pay_v2')->error($e->getMessage(), [$Order->getId()]);goto EMSHB;KGyy2:$this->entityManager->flush();goto flRoU;flRoU:$this->entityManager->commit();goto i0sEB;EMSHB:$this->purchaseFlow->rollback($Order, new PurchaseContext());goto KGyy2;M9ucX:$this->addError($e->getMessage());goto VrelQ;i0sEB:return $this->redirectToRoute('shopping_error');goto enPHv;enPHv:} catch (\Exception $e) {goto lHzzK;tWYXG:$this->purchaseFlow->rollback($Order, new PurchaseContext());goto jIbr9;zuTm6:return $this->redirectToRoute('shopping_error');goto CQAZ1;IEIBW:logs('amazon_pay_v2')->error('', [get_class($e), $e->getMessage()]);goto tWYXG;jIbr9:$this->entityManager->flush();goto aUrUf;aUrUf:$this->entityManager->commit();goto zuTm6;lHzzK:$this->addError('front.shopping.system_error');goto IEIBW;CQAZ1:}goto Bg17C;DR6Hc:$this->session->set(OrderHelper::SESSION_ORDER_ID, $Order->getId());goto tkZ60;hRUeI:if ($Order->getOrderStatus() == $this->orderStatusRepository->find(OrderStatus::NEW)) {goto fmHEX;}goto vUOMP;tkZ60:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto wlKA1;wg1JB:$amazonCheckoutSessionId = $request->get('amazonCheckoutSessionId');goto ZjWbE;l2RR6:goto lzC2x;goto KnDWV;EAMJr:return $this->redirectToRoute('shopping_complete');goto EZ1As;Pt_P5:$this->session->set($this->sessionAmazonCustomerParamKey, null);goto Wst5s;Zmzfp:logs('amazon_pay_v2')->info('[] .');goto uXpWC;fH18b:$Order->appendCompleteMailMessage("" . $this->Config->getMailNotices());goto VokHK;vUOMP:if ($Order->getOrderStatus() != $this->orderStatusRepository->find(OrderStatus::PENDING)) {goto uRfFN;}goto l2RR6;BXhU9:$result = $this->abortCheckoutResult($Order);goto uqgqT;wlKA1:if (is_null($this->Config->getMailNotices())) {goto ym1FZ;}goto fH18b;I3pTI:logs('amazon_pay_v2')->info('[] IPN.', [$Order->getId()]);goto BXhU9;fEO6N:EP73r:goto hRUeI;fkTGg:goto lzC2x;goto CLui9;BuPOy:$this->mailService->sendOrderMail($Order);goto oBQug;mhZby:if ($Order) {goto EP73r;}goto Zmzfp;IOhFq:return $this->redirectToRoute('shopping_error');goto Tmnwp;NQAoZ:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto d3yxz;hgBm2:$arrAmazonCustomerParam = unserialize($amazonCustomerParam);goto xG33P;Wst5s:$this->session->set($this->sessionAmazonCustomerErrorKey, null);goto nJCVU;d3yxz:$this->cartService->clear();goto Q_1gf;EZ1As:}function abortCheckoutResult($Order){goto gdoJZ;GobS2:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto Bi4G1;gdoJZ:$this->session->set(OrderHelper::SESSION_ORDER_ID, $Order->getId());goto NiMc9;Bi4G1:return $this->redirectToRoute('shopping_complete');goto CHVeP;ss1un:$this->cartService->clear();goto IjSFI;k_r3X:$this->session->set($this->sessionAmazonCustomerErrorKey, null);goto GobS2;xJ9Tp:$this->session->set($this->sessionAmazonCustomerParamKey, null);goto k_r3X;mQCV7:$this->session->set($this->sessionAmazonCheckoutSessionIdKey, null);goto xJ9Tp;NiMc9:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto ss1un;IjSFI:$Order->setAmazonPayV2SessionTemp(null);goto mQCV7;CHVeP:}    /** 
     * , . 
     * 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 Bvnpv;Bvnpv:$preOrderId = $this->cartService->getPreOrderId();goto tUUxO;Th1yQ:logs('amazon_pay_v2')->info('Error.', [$flowResult->getErrors()]);goto SxdPT;P2VY_:logs('amazon_pay_v2')->info('[] , .', [$Order->getId()]);goto prJQo;AwFM1:logs('amazon_pay_v2')->info('[] .');goto DiaW1;vfEFF:return $this->redirectToRoute('shopping_error');goto jUX5o;tC099:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto PMQdI;dpYxW:if (!$flowResult->hasError()) {goto GrDvG;}goto Th1yQ;xjwvB:$form = $this->createForm(OrderType::class, $Order);goto Jd8Uj;k02b7:if (!$flowResult->hasWarning()) {goto XfLKe;}goto LzzKc;DiaW1:return $this->redirectToRoute('amazon_pay_shopping');goto tE2Bh;SxdPT:return $this->redirectToRoute('shopping_error');goto PmXD1;fJQXx:qYOZi:goto P2VY_;PMQdI:$flowResult = $this->executePurchaseFlow($Order, false);goto AHSOt;fveew:XfLKe:goto jrPiQ;v5ssh:if (!($form->isSubmitted() && $form->isValid())) {goto qYOZi;}goto tC099;yBskY:try {goto xcIvZ;VzQWq:return $this->forwardToRoute($result['_route']);goto YUHro;k0rhX:$result = $router->match($redirectTo);goto VzQWq;HNW3Z:$redirectTo = preg_replace($pattern, '', $redirectTo);goto k0rhX;xcIvZ:$pattern = '/^' . preg_quote($request->getBasePath(), '/') . '/';goto HNW3Z;YUHro:} catch (\Exception $e) {logs('amazon_pay_v2')->info('[] URL', [$redirectTo, $e->getMessage()]);return $this->redirectToRoute('shopping_error');}goto fJQXx;PmXD1:GrDvG:goto k02b7;xccde:if (!empty($redirectTo)) {goto bD5ao;}goto AwFM1;p6sDF:logs('amazon_pay_v2')->info('[] .');goto vfEFF;jrPiQ:$redirectTo = $form['redirect_to']->getData();goto xccde;tE2Bh:bD5ao:goto yBskY;AHSOt:$this->entityManager->flush();goto dpYxW;prJQo:return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307);goto biP78;Jd8Uj:$form->handleRequest($request);goto v5ssh;CZ42l:return $this->redirectToRoute('amazon_pay_shopping');goto fveew;tUUxO:$Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);goto ULgc6;ULgc6:if ($Order) {goto thb05;}goto p6sDF;jUX5o:thb05:goto xjwvB;LzzKc:logs('amazon_pay_v2')->info('Warning.', [$flowResult->getWarning()]);goto CZ42l;biP78:}    /** 
     * APIDB. 
     * 
     * @Route("/shopping/amazon_pay/order_save", name="amazon_pay_shopping_order_save", methods={"POST", "GET"}) 
     */ 
public function orderSave(Request $request){goto HwWLp;dDnq3:pA2qg:goto HKiY1;Mjcyk:if ($Order) {goto G_e3s;}goto EJeUj;JndZQ:iGgbv:goto J3C3b;HwWLp:if ($request->isXmlHttpRequest()) {goto Kf3y8;}goto Wo9Su;HKiY1:logs('amazon_pay_v2')->info('.');goto jH8nP;EJeUj:logs('amazon_pay_v2')->info('.');goto kxmLc;DHCbA:$this->entityManager->flush();goto vF2fT;VWivp:Kf3y8:goto AXxAW;p_IkP:$this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam));goto qy4PR;QzbgD:if (!$flowResult->hasWarning()) {goto iGgbv;}goto cZz2A;E1u1X:return $this->json(['error' => 'executePurchaseFlow::Warning'], 500);goto JndZQ;kxmLc:return $this->json(['error' => 'OrderNotFound'], 500);goto V4sey;UHLiJ:$Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);goto Mjcyk;pkmjf:$form = $this->createForm(OrderType::class, $Order);goto xDwmi;XaUF5:return $this->json(['error' => 'executePurchaseFlow::Error'], 500);goto Vc6_E;J3C3b:return $this->json([]);goto dDnq3;aZ25i:$flowResult = $this->executePurchaseFlow($Order, false);goto DHCbA;jH8nP:return $this->json(['error' => 'validateError'], 500);goto jNsW9;cZz2A:logs('amazon_pay_v2')->info('executePurchaseFlowWarning.', [$flowResult->getWarning()]);goto E1u1X;Wo9Su:throw new BadRequestHttpException();goto VWivp;V4sey:G_e3s:goto pkmjf;xDwmi:$form->handleRequest($request);goto lecQq;C_mdK:logs('amazon_pay_v2')->info('.', [$Order->getId()]);goto aZ25i;vF2fT:if (!$flowResult->hasError()) {goto W5hEZ;}goto Uvfe4;lecQq:$arrAmazonCustomerParam = $this->getAmazonCustomerParam($request);goto p_IkP;qy4PR:if (!($form->isSubmitted() && $form->isValid())) {goto pA2qg;}goto C_mdK;AXxAW:$preOrderId = $this->cartService->getPreOrderId();goto UHLiJ;Vc6_E:W5hEZ:goto QzbgD;Uvfe4:logs('amazon_pay_v2')->info('executePurchaseFlowError.', [$flowResult->getErrors()]);goto XaUF5;jNsW9:}private function createPaymentMethod(Order $Order, FormInterface $form, $amazonCheckoutSessionId = null){goto NIXmh;NIXmh:$PaymentMethod = $this->container->get($Order->getPayment()->getMethodClass());goto QIIcw;QIIcw:$PaymentMethod->setOrder($Order);goto gF0sz;IudB2:$PaymentMethod->setAmazonCheckoutSessionId($amazonCheckoutSessionId);goto JQ61B;JQ61B:NSETP:goto cd11n;eFVnT:if (is_null($amazonCheckoutSessionId)) {goto NSETP;}goto IudB2;cd11n:return $PaymentMethod;goto wLa0g;gF0sz:$PaymentMethod->setFormType($form);goto eFVnT;wLa0g:}protected function executeCheckout(AmazonPay $paymentMethod, Order $Order){goto ELWtD;SLmGp:foreach ($PaymentResult->getErrors() as $error) {$this->addError($error);rN6Ga:}goto S0Y9T;GZw5j:return $response;goto sPW0Q;HqFOa:$response = $PaymentResult->getResponse();goto d1hiz;zr_17:logs('amazon_pay_v2')->info('[] PaymentMethod::checkout, .', [$PaymentResult->getErrors()]);goto WZ65m;WZ65m:return $this->redirectToRoute('shopping_error');goto iKUxy;sPW0Q:ozSjj:goto hWv5W;d1hiz:if (!($response && ($response->isRedirection() || $response->getContent()))) {goto ozSjj;}goto XMaoO;j4rSb:logs('amazon_pay_v2')->info('[] PaymentMethod::checkout.');goto GZw5j;hWv5W:if ($PaymentResult->isSuccess()) {goto e4_h5;}goto PMnNA;XMaoO:$this->entityManager->flush();goto j4rSb;iKUxy:e4_h5:goto dPpnH;S0Y9T:uVOam:goto zr_17;ELWtD:$PaymentResult = $paymentMethod->checkout();goto HqFOa;PMnNA:$this->purchaseFlow->rollback($Order, new PurchaseContext());goto SLmGp;dPpnH:}private function getAmazonCustomerParam($request){goto I1pXS;yrMau:$login_check_v2 = empty($request->get('_shopping_order')['login_check_v2']) ? null : $request->get('_shopping_order')['login_check_v2'];goto zfTdy;IiqgI: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 ALLis;zfTdy:$amazon_login_email_v2 = empty($request->get('_shopping_order')['amazon_login_email_v2']) ? null : $request->get('_shopping_order')['amazon_login_email_v2'];goto fqv1w;I1pXS:$customer_regist_v2 = empty($request->get('_shopping_order')['customer_regist_v2']) ? false : true;goto tA6rP;fqv1w:$amazon_login_password_v2 = empty($request->get('_shopping_order')['amazon_login_password_v2']) ? null : $request->get('_shopping_order')['amazon_login_password_v2'];goto IiqgI;tA6rP:$mail_magazine = empty($request->get('_shopping_order')['mail_magazine']) ? false : true;goto yrMau;ALLis:}private function checkAmazonCustomerError($request, $form, $Order){goto TLI38;RTeoR:$arrError['amazon_login_email_v2'] = ' ' . $amazon_login_email_v2_error;goto rWie7;sl0SY:goto gPraf;goto X019Z;FLzzX:$amazon_login_email_v2_error = '';goto Ity6v;DcLiw:$Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $Order->getEmail()]);goto K71AV;v8VFN:HI4AY:goto wpN2b;wqsqo:cy3Qc:goto DUtS0;f7NNo:PFNo1:goto sl0SY;m2csZ:foreach ($violations as $violation) {$amazon_login_password_v2_error .= $violation->getMessage() . PHP_EOL;mwNk0:}goto RXeaC;V65KZ:$AmazonCustomer = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);goto ki4zX;VH9bj:NlfBb:goto XbiTn;FJaH8:$login_check_v2 = $form['login_check_v2']->getData();goto yDAbD;z5igu:$encoder = $this->encoderFactory->getEncoder($Customer[0]);goto c1A31;SO3Fg:$arrError['amazon_login_email_v2'] = ' ';goto v8VFN;A2z7e:$arrError['amazon_login_password_v2'] = ' ' . $amazon_login_password_v2_error;goto sk5IY;A47mW:Bl8v2:goto SO3Fg;WB2w5:$customerPassword = $Customer[0]->getPassword();goto iVXxh;omeoS:gPraf:goto VH9bj;hj6b7:if (empty($AmazonCustomer[0])) {goto cy3Qc;}goto LaGon;h03Vc:$arrError['amazon_login_email_v2'] = ' ';goto cGY0U;t_Lil:$request_uri = $request->getUri();goto mgxYS;DUtS0:goto VpMpD;goto T8pS8;cGY0U:LXy1e:goto xjrp0;c1A31:$salt = $Customer[0]->getSalt();goto WB2w5;ztL4H:VpMpD:goto aaUmx;cOEsD:if (empty($Customer[0])) {goto Bl8v2;}goto z5igu;aaUmx:goto b5ob5;goto dDrSB;iVXxh:if ($encoder->isPasswordValid($customerPassword, $form['amazon_login_password_v2']->getData(), $salt)) {goto LXy1e;}goto h03Vc;tGdXN:if (empty($amazon_login_password_v2_error)) {goto oFsQZ;}goto A2z7e;rWie7:YZOc1:goto FJHs_;XbiTn:nU9qn:goto O5Eyc;VZCr4:$Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $form['amazon_login_email_v2']->getData()]);goto cOEsD;AG9_d:$arrError['customer_regist_v2'] = ' ';goto i3Cy0;JMa2w:$arrError['customer_regist_v2'] = ' ' . $Order->getEmail() . '';goto ztL4H;T8pS8:OJtuo:goto JMa2w;A26xP:if (empty($amazon_login_email_v2_error)) {goto YZOc1;}goto RTeoR;i3Cy0:b5ob5:goto omeoS;yDAbD:if ($login_check_v2 == 'regist') {goto GlVLf;}goto y5V64;MsIkC:if (!(!$this->isGranted('IS_AUTHENTICATED_FULLY') && $this->Config->getLoginRequired() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on'])) {goto nU9qn;}goto t_Lil;RXeaC:B_0S4:goto tGdXN;wpN2b:VLu_9:goto f7NNo;X019Z:GlVLf:goto hJcE5;Ity6v:foreach ($violations as $violation) {$amazon_login_email_v2_error .= $violation->getMessage() . PHP_EOL;DYejv:}goto Trxa5;OB3by:$amazon_login_password_v2_error = '';goto m2csZ;xjrp0:goto HI4AY;goto A47mW;mgxYS:if (!('POST' === $request->getMethod() && strpos($request_uri, 'shopping/amazon_pay/address') === false && strpos($request_uri, 'shopping/amazon_pay/delivery') === false)) {goto NlfBb;}goto FJaH8;mMNAC:$violations = $this->validator->validate($form['amazon_login_email_v2']->getData(), [new Assert\NotBlank(), new Assert\Email()]);goto FLzzX;sk5IY:oFsQZ:goto OXeeS;K71AV:$profile = unserialize($this->session->get($this->sessionAmazonProfileKey));goto V65KZ;FJHs_:$violations = $this->validator->validate($form['amazon_login_password_v2']->getData(), [new Assert\NotBlank()]);goto OB3by;O5Eyc:return $arrError;goto Zlw4C;ki4zX:if (!empty($Customer[0])) {goto OJtuo;}goto hj6b7;TLI38:$arrError = [];goto MsIkC;OXeeS:if (!(empty($login_check_v2_error) && empty($amazon_login_email_v2_error) && empty($amazon_login_password_v2_error))) {goto VLu_9;}goto VZCr4;hJcE5:if (empty($form['customer_regist_v2']->getData())) {goto l11Lm;}goto DcLiw;Trxa5:jz8h0:goto A26xP;y5V64:if (!($login_check_v2 == 'login')) {goto PFNo1;}goto mMNAC;dDrSB:l11Lm:goto AG9_d;LaGon:$arrError['customer_regist_v2'] = ' Amazon' . $AmazonCustomer[0]->getEmail() . '';goto wqsqo;Zlw4C:}private function setLogin($request, $Order, $email){goto mfWV9;dTXPN:return $ret;goto MB96E;DGoZW:try {goto eiQKv;kfXvP:$ret = true;goto A630k;QxHLz:$token = new UsernamePasswordToken($Customer[0], null, 'customer', ['ROLE_USER']);goto oI6MN;oI6MN:$this->tokenStorage->setToken($token);goto B3Bpl;B3Bpl:$this->amazonOrderHelper->copyToOrderFromCustomer($Order, $Customer[0]);goto kfXvP;eiQKv:$Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $email]);goto luMfQ;luMfQ:$Order->setCustomer($Customer[0]);goto QxHLz;A630k:} catch (\Exception $e) {logs('amazon_pay_v2')->error($e);}goto dTXPN;mfWV9:$ret = false;goto DGoZW;MB96E:}private function setAmazonCustomerData($form, $arrAmazonCustomerParam){goto MuXH2;ORwql:ZtdKF:goto QGwtE;Nf01A:$form->get('mail_magazine')->setData($arrAmazonCustomerParam['mail_magazine']);goto iBO9B;ieEPq:$form->get('login_check_v2')->setData($arrAmazonCustomerParam['login_check_v2']);goto TLF_4;MuXH2:$form->get('customer_regist_v2')->setData($arrAmazonCustomerParam['customer_regist_v2']);goto mg8t8;mg8t8:if (!($this->pluginRepository->findOneBy(['code' => 'MailMagazine4', 'enabled' => true]) || $this->pluginRepository->findOneBy(['code' => 'PostCarrier4', 'enabled' => true]))) {goto EPGXi;}goto Nf01A;UL13v:$form->get('amazon_login_password_v2')->setData($arrAmazonCustomerParam['amazon_login_password_v2']);goto ORwql;iBO9B:EPGXi:goto Gxw_x;Gxw_x:if (!($this->Config->getLoginRequired() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on'] && !$this->isGranted('IS_AUTHENTICATED_FULLY'))) {goto ZtdKF;}goto ieEPq;TLF_4:$form->get('amazon_login_email_v2')->setData($arrAmazonCustomerParam['amazon_login_email_v2']);goto UL13v;QGwtE:}public function getPendingProcessingOrder($preOrderId = null){goto p0drH;LQ8h9:$OrderStatus = $this->orderStatusRepository->find(OrderStatus::PENDING);goto OGaZL;OGaZL:return $this->orderRepository->findOneBy(['pre_order_id' => $preOrderId, 'OrderStatus' => $OrderStatus]);goto tOQVr;EVevr:return null;goto Mi68D;p0drH:if (!(null === $preOrderId)) {goto EDwkJ;}goto EVevr;Mi68D:EDwkJ:goto LQ8h9;tOQVr:}private function checkShippingDifference($Order, $shippingAddress){goto IGAaU;uDFAA:$shippingDifference = true;goto Q1i8D;GOpaw:$Shippings = $Order->getShippings();goto CMAPi;hvl1k: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 BcnOV;}goto uDFAA;U74ba:return $shippingDifference;goto aVQ27;Q1i8D:BcnOV:goto U74ba;IGAaU:$amazonShipping = new Shipping();goto oDjwg;CMAPi:$shippingDifference = false;goto hvl1k;nxs3Q:$this->amazonOrderHelper->convert($amazonShipping, $shippingAddress);goto GOpaw;oDjwg:$amazonShipping->setOrder($Order);goto nxs3Q;aVQ27:}protected function getAmazonPayDefaultDelivery(Shipping $Shipping){goto tadS1;tadS1:$OrderItems = $Shipping->getProductOrderItems();goto eB73g;T_gDh:$Deliveries = $this->deliveryRepository->getDeliveries($SaleTypes);goto CqXGV;eB73g:$SaleTypes = [];goto PMld2;ZkBKk:return $Delivery;goto dvXIb;CqXGV:foreach ($Deliveries as $key => $Delivery) {goto EahcN;K2tGV:R13A4:goto cJqc6;R35Bh:if ($amazonPayFlg) {goto HNOpb;}goto JmFgR;v6YJz:WOdYb:goto R35Bh;JmFgR:unset($Deliveries[$key]);goto IHn2M;IHn2M:HNOpb:goto K2tGV;paN4h:foreach ($PaymentOptions as $PaymentOption) {goto MSW1G;OWwj6:UyMfn:goto s5sDe;Pqw7H:if (!($Payment->getMethodClass() === AmazonPay::class)) {goto OS4xJ;}goto yP7X1;y2trI:OS4xJ:goto OWwj6;yP7X1:$amazonPayFlg = true;goto O3QUc;MSW1G:$Payment = $PaymentOption->getPayment();goto Pqw7H;O3QUc:goto WOdYb;goto y2trI;s5sDe:}goto v6YJz;EahcN:$PaymentOptions = $Delivery->getPaymentOptions();goto voupw;voupw:$amazonPayFlg = false;goto paN4h;cJqc6:}goto jJzFo;jJzFo:MWv4Q:goto IOWiN;PMld2:foreach ($OrderItems as $OrderItem) {goto TdNXi;TdNXi:$ProductClass = $OrderItem->getProductClass();goto YdbCr;lFd9z:asp_x:goto qgi9L;YdbCr:$SaleType = $ProductClass->getSaleType();goto u5Tpp;u5Tpp:$SaleTypes[$SaleType->getId()] = $SaleType;goto lFd9z;qgi9L:}goto FWcUU;IOWiN:$Delivery = current($Deliveries);goto ZkBKk;FWcUU:vGMHX:goto T_gDh;dvXIb:}} ?>

Did this file decode correctly?

Original Code

<?php
/*   __________________________________________________
    |  Obfuscated by YAK Pro - Php Obfuscator  2.0.3   |
    |              on 2023-06-12 16:46:08              |
    |    GitHub: https://github.com/pk-fr/yakpro-po    |
    |__________________________________________________|
*/
namespace Plugin\AmazonPayV2\Controller;use Eccube\Entity\Delivery;use Eccube\Entity\OrderItem;use Eccube\Repository\DeliveryRepository;use Eccube\Repository\Master\OrderStatusRepository;use Eccube\Repository\OrderRepository;use Plugin\AmazonPayV2\Repository\ConfigRepository;use Plugin\AmazonPayV2\Service\AmazonOrderHelper;use Plugin\AmazonPayV2\Service\AmazonRequestService;use Plugin\AmazonPayV2\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\Exception\AmazonPaymentException;use Plugin\AmazonPayV2\Amazon\Pay\API\Client;use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;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;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){goto ABVtp;ANszI:$this->prefRepository = $prefRepository;goto poddg;R0Hkf:$this->orderStatusRepository = $orderStatusRepository;goto ANszI;RQj5H:$this->validator = $validator;goto Log7n;Gs76t:$this->cartService = $cartService;goto mZj1j;e8JtZ:$this->amazonRequestService = $amazonRequestService;goto RQj5H;VlnqG:$this->deliveryRepository = $deliveryRepository;goto DAZ03;x_avn:$this->Config = $configRepository->get();goto Su8GZ;rsgkg:$this->customerRepository = $customerRepository;goto HA1gX;KHW33:$this->customerPurchaseInfoProcessor = $customerPurchaseInfoProcessor;goto TiRBT;ABVtp:$this->eccubeConfig = $eccubeConfig;goto WkJCf;mZj1j:$this->mailService = $mailService;goto Svfcn;HA1gX:$this->orderRepository = $orderRepository;goto R0Hkf;Log7n:$this->encoderFactory = $encoderFactory;goto o13OH;poddg:$this->productClassRepository = $productClassRepository;goto aBZcn;DAZ03:$this->addPointProcessor = $addPointProcessor;goto KHW33;Svfcn:$this->orderHelper = $orderHelper;goto rsgkg;Su8GZ:$this->amazonOrderHelper = $amazonOrderHelper;goto e8JtZ;o13OH:$this->tokenStorage = $tokenStorage;goto VlnqG;WkJCf:$this->purchaseFlow = $cartPurchaseFlow;goto Gs76t;aBZcn:$this->pluginRepository = $pluginRepository;goto x_avn;TiRBT:}    /**
     * @Route("/shopping/amazon_pay", name="amazon_pay_shopping")
     * @Template("Shopping/index.twig")
     *
     * @param Request $request
     */
public function index(Request $request, PurchaseFlow $cartPurchaseFlow){goto O6oL0;h87IH:S7VKj:goto LP8EG;JJXVH:logs('amazon_pay_v2')->info('[] , .');goto EOMrz;IQVre:$Shipping->setShippingDeliveryName($AmazonDefaultDelivery->getName());goto dXVyS;k8SAZ:viJpW:goto MsW8E;Z0fTQ:if ($Cart && $this->orderHelper->verifyCart($Cart)) {goto C_7e0;}goto JJXVH;iHhfj:$arrAmazonCustomerParam['mail_magazine'] = false;goto k8SAZ;GKq6X:if (!($checkoutSession && $checkoutSession->statusDetails->state !== 'Open')) {goto apXWm;}goto rqXrQ;A9KS0:if (!$this->session->get($this->sessionIsShippingRefresh)) {goto Ah_lX;}goto o4Njs;HhF_H:$Shipping->setDelivery($AmazonDefaultDelivery);goto IQVre;QR1ji:$this->session->set($this->sessionAmazonCustomerErrorKey, null);goto jPoC6;b8G5r:foreach ($arrAmazonCustomerError as $key => $val) {$form[$key]->addError(new FormError($val));pAKMq:}goto DcMAB;CEZn4:QQBYF:goto qpZ3v;lpcgU:$this->session->set(OrderHelper::SESSION_NON_MEMBER, $Customer);goto vr3Rx;fM29h:$Shipping = $Order->getShippings()->first();goto wBWPa;bz3uI:$flowResult = $this->executePurchaseFlow($Order, false);goto UnAue;DcMAB:NdS2a:goto QR1ji;KmgdV:$this->cartService->save();goto W1694;QwoyE:$checkoutSession = $this->amazonRequestService->getCheckoutSession($amazonCheckoutSessionId);goto GKq6X;MxHB2:$this->amazonOrderHelper->convert($Shippings->first(), $checkoutSession->shippingAddress);goto dYjcs;LP8EG:if (!$flowResult->hasWarning()) {goto WSbOa;}goto L_u6w;k7gXI:goto COWui;goto zigoG;kVJkP:logs('amazon_pay_v2')->info('[] .');goto OkwpX;vr3Rx:YyNkC:goto IhAP2;giPAG:$amazonCheckoutSessionId = $this->session->get($this->sessionAmazonCheckoutSessionIdKey);goto QwoyE;fyJGw:$arrAmazonCustomerParam = ['customer_regist_v2' => true, 'mail_magazine' => true, 'login_check_v2' => 'regist', 'amazon_login_email_v2' => null, 'amazon_login_password_v2' => null];goto ICYST;L_u6w:logs('amazon_pay_v2')->info('[] Warning.', [$flowResult->getWarning()]);goto NLdEB;IhAP2:$initOrderFlg = false;goto Y5ZIo;qpZ3v:$Order = $this->amazonOrderHelper->initializeAmazonOrder($Order, $Customer);goto A9KS0;ICYST:goto v_KUI;goto z9Y6J;wx5O8:if (!empty($arrAmazonCustomerParam['mail_magazine'])) {goto viJpW;}goto iHhfj;bpfA0:$arrAmazonCustomerParam['customer_regist_v2'] = false;goto kmzQq;dYjcs:$Shippings->first()->setCompanyName('');goto n9Fcm;ai29h:$arrAmazonCustomerParam = unserialize($amazonCustomerParam);goto EKP9P;oLOgc:if (!($AmazonDefaultDelivery === false)) {goto ozKNH;}goto tvtW7;bpttu:if (!($initOrderFlg && $AmazonDefaultDelivery)) {goto QQBYF;}goto HhF_H;VUYZN:GS4n0:goto eO3Za;MsW8E:v_KUI:goto pWWPx;zmQPB:if (!$Order->isMultiple()) {goto GS4n0;}goto CkVyq;Y6w0Z:$this->session->remove($this->sessionIsShippingRefresh);goto RO00p;n9Fcm:$this->entityManager->flush();goto Y6w0Z;BB0pe:$Cart = $this->cartService->getCart();goto Z0fTQ;mIMBX:$this->session->remove($this->sessionAmazonCheckoutSessionIdKey);goto iyYk0;NLdEB:$cartPurchaseFlow->validate($Cart, new PurchaseContext());goto KmgdV;Buj6C:if ($this->isGranted('ROLE_USER')) {goto YyNkC;}goto lpcgU;jPoC6:CCZO4:goto cJ3Pd;W1694:WSbOa:goto pNF_P;dXVyS:$this->entityManager->flush();goto CEZn4;EOMrz:return $this->redirectToRoute('cart');goto xnl8h;eO3Za:COWui:goto hiNIC;OkwpX:$Customer = $this->getUser() ? $this->getUser() : $this->amazonOrderHelper->getOrderer($checkoutSession->shippingAddress);goto Buj6C;wkzBR:OfkML:goto Wfqju;pWWPx:$form = $this->createForm(OrderType::class, $Order);goto sbaox;pNF_P:if ($amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey)) {goto Dmzgt;}goto fyJGw;qYn92:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto bz3uI;wBWPa:$AmazonDefaultDelivery = $this->getAmazonPayDefaultDelivery($Shipping);goto oLOgc;hO8_v:apXWm:goto kVJkP;YrhXX:return ['form' => $form->createView(), 'Order' => $Order, 'AmazonCustomer' => $arrAmazonCustomerParam, 'AmazonPaymentDescriptor' => $checkoutSession->paymentPreferences[0]->paymentDescriptor, 'AmazonShippingAddress' => $checkoutSession->shippingAddress];goto HLQaa;xnl8h:C_7e0:goto giPAG;kmzQq:Pz5xT:goto wx5O8;o4Njs:$Shippings = $Order->getShippings();goto MxHB2;Wfqju:if (!($amazonCustomerError = $this->session->get($this->sessionAmazonCustomerErrorKey))) {goto CCZO4;}goto hSzx5;sdCSP:$this->setAmazonCustomerData($form, $arrAmazonCustomerParam);goto wkzBR;UnAue:$this->entityManager->flush();goto BQFg7;cjV1f:return $this->redirectToRoute('shopping_error');goto h87IH;tvtW7:$this->addError('Amazon Pay');goto k2v1k;iyYk0:return $this->redirectToRoute('shopping_error');goto hO8_v;rqXrQ:logs('amazon_pay_v2')->info('[] CheckoutSessionOpen.', ['CheckoutSessionId => $amazonCheckoutSessionId']);goto mIMBX;EKP9P:if (!empty($arrAmazonCustomerParam['customer_regist_v2'])) {goto Pz5xT;}goto bpfA0;Tovlh:logs('amazon_pay_v2')->info('AmazonShopping::index end.');goto YrhXX;k2v1k:ozKNH:goto bpttu;RO00p:Ah_lX:goto qYn92;hiNIC:$Order = $this->orderHelper->initializeOrder($Cart, $Customer);goto fM29h;CkVyq:$Cart->setPreOrderId(null);goto VUYZN;O6oL0:logs('amazon_pay_v2')->info('AmazonShopping::index start.');goto BB0pe;z9Y6J:Dmzgt:goto ai29h;sbaox:if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {goto OfkML;}goto sdCSP;Y5ZIo:if ($Order = $this->orderHelper->getPurchaseProcessingOrder($Cart->getPreOrderId())) {goto mqp36;}goto GXimb;BQFg7:if (!$flowResult->hasError()) {goto S7VKj;}goto sO3mB;zigoG:mqp36:goto zmQPB;cJ3Pd:$form->handleRequest($request);goto Tovlh;sO3mB:logs('amazon_pay_v2')->info('[] Error.', [$flowResult->getErrors()]);goto cjV1f;hSzx5:$arrAmazonCustomerError = unserialize($amazonCustomerError);goto b8G5r;GXimb:$initOrderFlg = true;goto k7gXI;HLQaa:}    /**
     * 
     *
     * @Route("/shopping/amazon_pay/confirm", name="amazon_pay_shopping_confirm", methods={"POST"})
     * @Template("Shopping/confirm.twig")
     */
public function confirm(Request $request){goto PeMa_;d5ZuJ:logs('amazon_pay_v2')->info('[] , .');goto tHeia;DeJWV:logs('amazon_pay_v2')->info('[] PaymentMethod::verify.', [$Order->getPayment()->getMethodClass()]);goto wG5Cd;qAfNZ:return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307);goto x3yAQ;L6YhM:return $this->redirectToRoute('shopping_error');goto oIQGk;Nhb6O:$this->entityManager->flush();goto JpdMY;FEZXt:$this->entityManager->flush();goto fSr1o;lhq5A:if (!($response && ($response->isRedirection() || $response->getContent()))) {goto YMhfT;}goto Nhb6O;zh4Gl:ZDvoM:goto FEZXt;ihL4A:oF3vD:goto FT19E;c_Omu:logs('amazon_pay_v2')->info('[] PaymentMethod::verify, .', [$PaymentResult->getErrors()]);goto hEfZp;qOCso:return ['form' => $form->createView(), 'Order' => $Order];goto ihL4A;uLqn8:if (!$PaymentResult) {goto ZDvoM;}goto RPE98;On1jk:$response = $PaymentResult->getResponse();goto lhq5A;Zn5l7:zW0c0:goto DeJWV;e0DOb:$form = $this->createForm(OrderType::class, $Order);goto Ui9yZ;tHeia:return $this->redirectToRoute('cart');goto QHdW3;gQ9K5:return $this->redirectToRoute('amazon_pay_shopping');goto Ip65I;JsAjG:if (!($form->isSubmitted() && $form->isValid())) {goto oF3vD;}goto q6tW6;fSr1o:logs('amazon_pay_v2')->info('[] .');goto qOCso;PeMa_:logs('amazon_pay_v2')->info('AmazonShopping::confirm start.');goto LBPc3;JpdMY:logs('amazon_pay_v2')->info('[] PaymentMethod::verify.');goto reW9b;D8dne:$form->handleRequest($request);goto xL38Z;hEfZp:return $this->redirectToRoute('amazon_pay_shopping');goto vz7m_;uDs5D:if ($Order) {goto l2ILn;}goto wIeEw;xL38Z:if (!($arrAmazonCustomerError = $this->checkAmazonCustomerError($request, $form, $Order))) {goto HemaM;}goto yVgIW;c7f1a:$arrAmazonCustomerParam = $this->getAmazonCustomerParam($request);goto wDcH8;Lx1uv:YMhfT:goto zh4Gl;wDcH8:$this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam));goto e0DOb;i9ah5:$PaymentResult = $paymentMethod->verify();goto uLqn8;reW9b:return $response;goto Lx1uv;qRbX3:$response = $this->executePurchaseFlow($Order);goto wVfTG;wG5Cd:$paymentMethod = $this->createPaymentMethod($Order, $form);goto i9ah5;yU7MA:if ($Cart && $this->orderHelper->verifyCart($Cart)) {goto axEOx;}goto d5ZuJ;wIeEw:logs('amazon_pay_v2')->info('[] .');goto L6YhM;QHdW3:axEOx:goto JLjD9;pemDp:$this->entityManager->rollback();goto yoLoO;Ip65I:HemaM:goto JsAjG;yVgIW:$this->session->set($this->sessionAmazonCustomerErrorKey, serialize($arrAmazonCustomerError));goto gQ9K5;W1j9C:return $this->redirectToRoute('amazon_pay_shopping');goto Zn5l7;Ui9yZ:if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {goto Yh3vl;}goto bV96e;ypZE_:Yh3vl:goto D8dne;FT19E:logs('amazon_pay_v2')->info('[] , ', [$Order->getId()]);goto qAfNZ;LBPc3:$Cart = $this->cartService->getCart();goto yU7MA;mLv4D:if (!$response) {goto zW0c0;}goto W1j9C;q6tW6:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto qRbX3;bV96e:$this->setAmazonCustomerData($form, $arrAmazonCustomerParam);goto ypZE_;RPE98:if ($PaymentResult->isSuccess()) {goto ZM39y;}goto pemDp;z1rqB:$Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);goto uDs5D;wVfTG:$this->entityManager->flush();goto mLv4D;RfYpN:C1JYY:goto c_Omu;oIQGk:l2ILn:goto c7f1a;yoLoO:foreach ($PaymentResult->getErrors() as $error) {$this->addError($error);nl8gh:}goto RfYpN;vz7m_:ZM39y:goto On1jk;JLjD9:$preOrderId = $this->cartService->getPreOrderId();goto z1rqB;x3yAQ:}    /**
     * 
     *
     * @Route("/shopping/amazon_pay/checkout", name="amazon_pay_shopping_checkout", methods={"POST"})
     * @Template("Shopping/index.twig")
     */
public function checkout(Request $request){goto G9oaR;uEAE6:$arrAmazonCustomerParam = unserialize($amazonCustomerParam);goto HdJ7s;H85vZ:LpGG2:goto VHvZJ;zNxzt:logs('amazon_pay_v2')->info('[] , .');goto FYDKa;GufsD:if (!($arrAmazonCustomerError = $this->checkAmazonCustomerError($request, $form, $Order))) {goto Zua_G;}goto W8zif;XiOvn:$form->handleRequest($request);goto mqgHx;H4uaV:return $this->redirectToRoute('amazon_pay_shopping');goto qoLOB;jE2bD:Do4y_:goto jTQDO;n90kD:GEYwc:goto rQZhW;LrjvL:logs('amazon_pay_v2')->info('[] .');goto tDNgb;iMKAP:if (!($checkoutSession && $checkoutSession->statusDetails->state !== 'Open')) {goto sdYLz;}goto Syv7z;bH9Pp:$form = $this->createForm(OrderType::class, $Order);goto k1UWk;CJTKF:if ($Order) {goto Do4y_;}goto LrjvL;U02Sk:$this->entityManager->flush();goto Jf4AI;t_Lj0:brxzt:goto tmRO6;aq9lt:if (!$shippingDifference) {goto GEYwc;}goto Kl0Oi;HyO_i:aHPPR:goto XiOvn;PCD03:Zua_G:goto auXC1;nrX7Z:return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307);goto ePaoL;tmRO6:$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 h2aSA;Jf4AI:if (!$response) {goto azCq5;}goto H4uaV;tDNgb:return $this->redirectToRoute('shopping_error');goto jE2bD;vE26y:uurwL:goto aTgCL;GUnMo:$response = $this->executePurchaseFlow($Order);goto U02Sk;LuxPa:OoZcD:goto DMf9q;cf8Oc:logs('amazon_pay_v2')->info('[] PaymentMethod::apply.');goto tvPha;auXC1:goto sLE1s;goto wx0Il;tAFXm:return $this->redirectToRoute('amazon_pay_shopping');goto LuxPa;aTgCL:logs('amazon_pay_v2')->info('', [$Order->getId()]);goto nrX7Z;HFCmj:return $this->redirectToRoute('shopping_error');goto dbYZ4;w5SfC:$this->addError('');goto tAFXm;LEhwx:if ($Cart && $this->orderHelper->verifyCart($Cart)) {goto jPqhQ;}goto zNxzt;rJnVX:if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {goto aHPPR;}goto usWL9;J7YUf:return $this->redirectToRoute('amazon_pay_shopping');goto n90kD;Qm644:return $this->redirectToRoute('amazon_pay_shopping');goto PCD03;Nj2TO:return $this->redirectToRoute('shopping_error');goto vyYHC;wx0Il:LBU5i:goto yL6fr;KMwdP:logs('amazon_pay_v2')->error('reasonCode: ' . $checkoutSession->reasonCode . ' message: ' . $checkoutSession->message);goto w5SfC;vyYHC:plL55:goto iMKAP;iwT3J:if (!($form->isSubmitted() && $form->isValid())) {goto uurwL;}goto G6y00;twW4L:$shippingDifference = $this->checkShippingDifference($Order, $checkoutSession->shippingAddress);goto aq9lt;usWL9:$this->setAmazonCustomerData($form, $arrAmazonCustomerParam);goto HyO_i;SKkze:if ($this->Config->getUseConfirmPage() == $this->eccubeConfig['amazon_pay_v2']['toggle']['off']) {goto fb4MH;}goto k9_QF;k9_QF:$amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey);goto uEAE6;dbYZ4:sdYLz:goto SKkze;G6y00:if (!($Order->getPaymentTotal() == 0)) {goto LpGG2;}goto Pocb7;mqgHx:if ($this->Config->getUseConfirmPage() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on']) {goto LBU5i;}goto GufsD;XIBb4:$this->entityManager->flush();goto nykHg;Bn_zm:$this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam));goto bH9Pp;Kl0Oi:$this->session->set($this->sessionIsShippingRefresh, true);goto J7YUf;VHvZJ:$checkoutSession = $this->amazonRequestService->updateCheckoutSession($Order, $amazonCheckoutSessionId);goto B8lrE;h2aSA:$Order->setAmazonPayV2SessionTemp(serialize($session_temp));goto XIBb4;G9oaR:logs('amazon_pay_v2')->info('AmazonShopping::order start.');goto wGAWY;WlJwa:$this->session->remove($this->sessionAmazonCheckoutSessionIdKey);goto HFCmj;HR8Iv:$Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);goto CJTKF;PmAqh:return $this->redirectToRoute('amazon_pay_shopping');goto H85vZ;tvPha:if (!($response = $paymentMethod->apply())) {goto brxzt;}goto MzSvg;HdJ7s:$form = $this->createForm(OrderType::class, $Order, ['skip_add_form' => true]);goto aVtUp;Pocb7:$errMessage = AmazonPaymentException::$errorMessages[AmazonPaymentException::ZERO_PAYMENT];goto HtM0r;B8lrE:if (!isset($checkoutSession->reasonCode)) {goto OoZcD;}goto KMwdP;HtM0r:logs('amazon_pay_v2')->error('orderId: ' . $Order->getId() . ' message: ' . $errMessage);goto JyXR2;JyXR2:$this->addError($errMessage);goto PmAqh;Uugh8:$paymentMethod = $this->createPaymentMethod($Order, $form);goto cf8Oc;W8zif:$this->session->set($this->sessionAmazonCustomerErrorKey, serialize($arrAmazonCustomerError));goto Qm644;rQZhW:if ($this->amazonOrderHelper->checkShippingPref($checkoutSession->shippingAddress)) {goto plL55;}goto nAlk5;WXGBJ:fb4MH:goto J8oCX;wGAWY:$Cart = $this->cartService->getCart();goto LEhwx;nAlk5:$this->addError('amazon_pay_v2.front.shopping.undefined_pref_error');goto kZSuR;Syv7z:logs('amazon_pay_v2')->info('[] CheckoutSessionOpen.', ['CheckoutSessionId => $amazonCheckoutSessionId']);goto WlJwa;qoLOB:azCq5:goto Uugh8;MzSvg:return $response;goto t_Lj0;yL6fr:sLE1s:goto iwT3J;DMf9q:logs('amazon_pay_v2')->info('', [$Order->getId()]);goto GUnMo;J8oCX:$arrAmazonCustomerParam = $this->getAmazonCustomerParam($request);goto Bn_zm;k1UWk:CR4nP:goto rJnVX;blEBS:$checkoutSession = $this->amazonRequestService->getCheckoutSession($amazonCheckoutSessionId);goto twW4L;jTQDO:$amazonCheckoutSessionId = $this->session->get($this->sessionAmazonCheckoutSessionIdKey);goto blEBS;FYDKa:return $this->redirectToRoute('cart');goto SRhnT;SRhnT:jPqhQ:goto USP6i;nykHg:return new RedirectResponse($checkoutSession->webCheckoutDetails->amazonPayRedirectUrl);goto vE26y;USP6i:$preOrderId = $this->cartService->getPreOrderId();goto HR8Iv;kZSuR:logs('amazon_pay_v2')->error('[] ', [$Order->getId()]);goto Nj2TO;aVtUp:goto CR4nP;goto WXGBJ;ePaoL:}    /**
     * 
     *
     * @Route("/shopping/amazon_pay/checkout_result", name="amazon_pay_shopping_checkout_result")
     */
public function checkoutResult(Request $request){goto dU7vD;G6595:return $result;goto fkTGg;PEq0B:$this->session->set($this->sessionAmazonCheckoutSessionIdKey, null);goto Pt_P5;Tmnwp:lzC2x:goto wg1JB;VokHK:ym1FZ:goto BuPOy;ZjWbE:$amazonCustomerParam = $this->session->get($this->sessionAmazonCustomerParamKey);goto hgBm2;CLui9:uRfFN:goto lypku;KnDWV:fmHEX:goto I3pTI;oBQug:$this->entityManager->flush();goto NQAoZ;dU7vD:$preOrderId = $this->cartService->getPreOrderId();goto eXOar;lypku:logs('amazon_pay_v2')->info('[] .');goto IOhFq;ZtBlR:$this->entityManager->flush();goto PEq0B;eXOar:$Order = $this->orderRepository->findOneBy(['pre_order_id' => $preOrderId]);goto mhZby;Q_1gf:$Order->setAmazonPayV2SessionTemp(null);goto ZtBlR;nJCVU:logs('amazon_pay_v2')->info('[] . .', [$Order->getId()]);goto EAMJr;Bg17C:logs('amazon_pay_v2')->info('AmazonShopping::complete_order end.');goto DR6Hc;uqgqT:$this->entityManager->flush();goto G6595;uXpWC:return $this->redirectToRoute('shopping_error');goto fEO6N;xG33P:try {goto G0p2u;tEqOm:goto Zfuoe;goto E3ZI5;l74jS:NBeUz:goto eeikP;h2npy:$Customers = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);goto gbSxb;iPYiF:$Customer = $this->getUser();goto froZh;yqx3X:$this->customerPurchaseInfoProcessor->commit($Order, new PurchaseContext());goto JgP_i;Wionn:return $result;goto eh2_Z;DV9iQ:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto iEchu;XJRgh:if (!$this->setLogin($request, $Order, $arrAmazonCustomerParam['amazon_login_email_v2'])) {goto vKqXU;}goto ySlBE;EjOqN:$this->entityManager->flush();goto kEZMb;PTCBG:goto Q0Jkm;goto sVRiX;A3EpL:if (!($response = $this->executeCheckout($paymentMethod, $Order))) {goto XbBVZ;}goto k3Lm0;gbSxb:if (!(!$Customer->getV2AmazonUserId() && empty($Customers[0]))) {goto NBeUz;}goto ZDqUz;ah0tJ:tTAQo:goto ZDXxL;zKRdh:$amazonDtbCustomer = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);goto JTdRU;JTdRU:if ($dtbCustomer || $amazonDtbCustomer) {goto tTAQo;}goto LniYF;EnJqL:$Order->setCustomer($Customer);goto yqx3X;Zof7y:$Customer = $this->getUser();goto EnJqL;PqvkX:logs('amazon_pay_v2')->info('[] PaymentMethod::checkout.');goto A3EpL;SByNj:$LockedOrder = $this->orderRepository->find($Order['id'], LockMode::PESSIMISTIC_WRITE);goto JraTB;JgP_i:$mail = $Customer->getEmail();goto WdBlp;ZcjN9:tGuSp:goto btTYk;WdBlp:            $mail_message = <<<__EOS__
************************************************

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

__EOS__;
goto IV9LD;fChGk:$paymentMethod = $this->createPaymentMethod($Order, $form, $amazonCheckoutSessionId);goto Gqa8P;bLdlq:$result = $this->abortCheckoutResult($Order);goto EjOqN;k3Lm0:return $response;goto P8uRE;UgiEL:            $mail_message = <<<__EOS__
************************************************

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

__EOS__;
goto ZcjN9;o8Hwm:efdG7:goto tEqOm;q1g6S:$this->addPointProcessor->validate($Order, new PurchaseContext());goto OH0v9;hOv7x:$Customer->setV2AmazonUserId($profile->buyerId);goto Y9q_r;CAnOT:$url = $this->generateUrl('mypage_login', [], UrlGeneratorInterface::ABSOLUTE_URL);goto n3iJh;kEZMb:$this->entityManager->commit();goto Wionn;froZh:$Customers = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);goto ixAgU;sVRiX:ddqYB:goto xfOsb;ZoWTG:YMTzv:goto iPYiF;btTYk:$Order->setCompleteMailMessage($mail_message);goto qWZKs;RwxUn:if (!($Order['update_date'] != $LockedOrder['update_date'])) {goto mzRGa;}goto pUNrf;Gqa8P:$this->entityManager->beginTransaction();goto SByNj;qWZKs:PgtnX:goto gA3lV;eeikP:vKqXU:goto o8Hwm;RfbbE:goto OXuYx;goto ZoWTG;ZDqUz:$Customer->setV2AmazonUserId($profile->buyerId);goto l74jS;E3ZI5:lhHvj:goto RY9ly;G0p2u:logs('amazon_pay_v2')->info('', [$Order->getId()]);goto n5LQ0;pUNrf:logs('amazon_pay_v2')->info('[] ');goto bLdlq;IV9LD:goto tGuSp;goto ah0tJ;eh2_Z:mzRGa:goto PqvkX;ZDXxL:if ($amazonDtbCustomer) {goto ddqYB;}goto LltFG;dNxGh:logs('amazon_pay_v2')->info('AddPointProcessor.', [$Order->getId()]);goto q1g6S;n3iJh:$dtbCustomer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $Order->getEmail()]);goto zKRdh;OH0v9:$this->entityManager->flush();goto YBx6U;ySlBE:$Customer = $Order->getCustomer();goto h2npy;LniYF:$password = $this->amazonOrderHelper->registCustomer($Order, $arrAmazonCustomerParam['mail_magazine']);goto Zof7y;LltFG:$mail = $dtbCustomer[0]->getEmail();goto PTCBG;gA3lV:Zfuoe:goto RfbbE;eYiU0:if (empty($arrAmazonCustomerParam['login_check_v2']) || $arrAmazonCustomerParam['login_check_v2'] == 'regist') {goto lhHvj;}goto NGlzM;YBx6U:$this->entityManager->commit();goto DV9iQ;iEchu:logs('amazon_pay_v2')->info('', [$Order->getId()]);goto ru6Y3;NGlzM:if (!($arrAmazonCustomerParam['login_check_v2'] == 'login')) {goto efdG7;}goto XJRgh;RY9ly:if (!$arrAmazonCustomerParam['customer_regist_v2']) {goto PgtnX;}goto CAnOT;psFhZ:$profile = unserialize($this->session->get($this->sessionAmazonProfileKey));goto WqpR8;WqpR8:if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {goto YMTzv;}goto eYiU0;qurfk:Q0Jkm:goto UgiEL;Y9q_r:HGY2k:goto SI2Pj;xfOsb:$mail = $amazonDtbCustomer[0]->getEmail();goto qurfk;ixAgU:if (!(!$Customer->getV2AmazonUserId() && empty($Customers[0]))) {goto HGY2k;}goto hOv7x;P8uRE:XbBVZ:goto psFhZ;JraTB: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 RwxUn;SI2Pj:OXuYx:goto dNxGh;n5LQ0:$form = $this->createForm(OrderType::class, $Order);goto fChGk;ru6Y3:} catch (ShoppingException $e) {goto BFF2M;BFF2M:$this->addError($e->getMessage());goto EzOb5;EzOb5:logs('amazon_pay_v2')->error('', [$e->getMessage()]);goto GdKv3;LG7wP:$this->entityManager->commit();goto CWhtI;CWhtI:return $this->redirectToRoute('shopping_error');goto Ri235;kDrxB:$this->entityManager->flush();goto LG7wP;GdKv3:$this->purchaseFlow->rollback($Order, new PurchaseContext());goto kDrxB;Ri235:} catch (AmazonPaymentException $e) {goto M9ucX;VrelQ:logs('amazon_pay_v2')->error($e->getMessage(), [$Order->getId()]);goto EMSHB;KGyy2:$this->entityManager->flush();goto flRoU;flRoU:$this->entityManager->commit();goto i0sEB;EMSHB:$this->purchaseFlow->rollback($Order, new PurchaseContext());goto KGyy2;M9ucX:$this->addError($e->getMessage());goto VrelQ;i0sEB:return $this->redirectToRoute('shopping_error');goto enPHv;enPHv:} catch (\Exception $e) {goto lHzzK;tWYXG:$this->purchaseFlow->rollback($Order, new PurchaseContext());goto jIbr9;zuTm6:return $this->redirectToRoute('shopping_error');goto CQAZ1;IEIBW:logs('amazon_pay_v2')->error('', [get_class($e), $e->getMessage()]);goto tWYXG;jIbr9:$this->entityManager->flush();goto aUrUf;aUrUf:$this->entityManager->commit();goto zuTm6;lHzzK:$this->addError('front.shopping.system_error');goto IEIBW;CQAZ1:}goto Bg17C;DR6Hc:$this->session->set(OrderHelper::SESSION_ORDER_ID, $Order->getId());goto tkZ60;hRUeI:if ($Order->getOrderStatus() == $this->orderStatusRepository->find(OrderStatus::NEW)) {goto fmHEX;}goto vUOMP;tkZ60:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto wlKA1;wg1JB:$amazonCheckoutSessionId = $request->get('amazonCheckoutSessionId');goto ZjWbE;l2RR6:goto lzC2x;goto KnDWV;EAMJr:return $this->redirectToRoute('shopping_complete');goto EZ1As;Pt_P5:$this->session->set($this->sessionAmazonCustomerParamKey, null);goto Wst5s;Zmzfp:logs('amazon_pay_v2')->info('[] .');goto uXpWC;fH18b:$Order->appendCompleteMailMessage("" . $this->Config->getMailNotices());goto VokHK;vUOMP:if ($Order->getOrderStatus() != $this->orderStatusRepository->find(OrderStatus::PENDING)) {goto uRfFN;}goto l2RR6;BXhU9:$result = $this->abortCheckoutResult($Order);goto uqgqT;wlKA1:if (is_null($this->Config->getMailNotices())) {goto ym1FZ;}goto fH18b;I3pTI:logs('amazon_pay_v2')->info('[] IPN.', [$Order->getId()]);goto BXhU9;fEO6N:EP73r:goto hRUeI;fkTGg:goto lzC2x;goto CLui9;BuPOy:$this->mailService->sendOrderMail($Order);goto oBQug;mhZby:if ($Order) {goto EP73r;}goto Zmzfp;IOhFq:return $this->redirectToRoute('shopping_error');goto Tmnwp;NQAoZ:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto d3yxz;hgBm2:$arrAmazonCustomerParam = unserialize($amazonCustomerParam);goto xG33P;Wst5s:$this->session->set($this->sessionAmazonCustomerErrorKey, null);goto nJCVU;d3yxz:$this->cartService->clear();goto Q_1gf;EZ1As:}function abortCheckoutResult($Order){goto gdoJZ;GobS2:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto Bi4G1;gdoJZ:$this->session->set(OrderHelper::SESSION_ORDER_ID, $Order->getId());goto NiMc9;Bi4G1:return $this->redirectToRoute('shopping_complete');goto CHVeP;ss1un:$this->cartService->clear();goto IjSFI;k_r3X:$this->session->set($this->sessionAmazonCustomerErrorKey, null);goto GobS2;xJ9Tp:$this->session->set($this->sessionAmazonCustomerParamKey, null);goto k_r3X;mQCV7:$this->session->set($this->sessionAmazonCheckoutSessionIdKey, null);goto xJ9Tp;NiMc9:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto ss1un;IjSFI:$Order->setAmazonPayV2SessionTemp(null);goto mQCV7;CHVeP:}    /**
     * , .
     * 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 Bvnpv;Bvnpv:$preOrderId = $this->cartService->getPreOrderId();goto tUUxO;Th1yQ:logs('amazon_pay_v2')->info('Error.', [$flowResult->getErrors()]);goto SxdPT;P2VY_:logs('amazon_pay_v2')->info('[] , .', [$Order->getId()]);goto prJQo;AwFM1:logs('amazon_pay_v2')->info('[] .');goto DiaW1;vfEFF:return $this->redirectToRoute('shopping_error');goto jUX5o;tC099:logs('amazon_pay_v2')->info('[] .', [$Order->getId()]);goto PMQdI;dpYxW:if (!$flowResult->hasError()) {goto GrDvG;}goto Th1yQ;xjwvB:$form = $this->createForm(OrderType::class, $Order);goto Jd8Uj;k02b7:if (!$flowResult->hasWarning()) {goto XfLKe;}goto LzzKc;DiaW1:return $this->redirectToRoute('amazon_pay_shopping');goto tE2Bh;SxdPT:return $this->redirectToRoute('shopping_error');goto PmXD1;fJQXx:qYOZi:goto P2VY_;PMQdI:$flowResult = $this->executePurchaseFlow($Order, false);goto AHSOt;fveew:XfLKe:goto jrPiQ;v5ssh:if (!($form->isSubmitted() && $form->isValid())) {goto qYOZi;}goto tC099;yBskY:try {goto xcIvZ;VzQWq:return $this->forwardToRoute($result['_route']);goto YUHro;k0rhX:$result = $router->match($redirectTo);goto VzQWq;HNW3Z:$redirectTo = preg_replace($pattern, '', $redirectTo);goto k0rhX;xcIvZ:$pattern = '/^' . preg_quote($request->getBasePath(), '/') . '/';goto HNW3Z;YUHro:} catch (\Exception $e) {logs('amazon_pay_v2')->info('[] URL', [$redirectTo, $e->getMessage()]);return $this->redirectToRoute('shopping_error');}goto fJQXx;PmXD1:GrDvG:goto k02b7;xccde:if (!empty($redirectTo)) {goto bD5ao;}goto AwFM1;p6sDF:logs('amazon_pay_v2')->info('[] .');goto vfEFF;jrPiQ:$redirectTo = $form['redirect_to']->getData();goto xccde;tE2Bh:bD5ao:goto yBskY;AHSOt:$this->entityManager->flush();goto dpYxW;prJQo:return $this->redirectToRoute('amazon_pay_shopping', ['request' => $request], 307);goto biP78;Jd8Uj:$form->handleRequest($request);goto v5ssh;CZ42l:return $this->redirectToRoute('amazon_pay_shopping');goto fveew;tUUxO:$Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);goto ULgc6;ULgc6:if ($Order) {goto thb05;}goto p6sDF;jUX5o:thb05:goto xjwvB;LzzKc:logs('amazon_pay_v2')->info('Warning.', [$flowResult->getWarning()]);goto CZ42l;biP78:}    /**
     * APIDB.
     *
     * @Route("/shopping/amazon_pay/order_save", name="amazon_pay_shopping_order_save", methods={"POST", "GET"})
     */
public function orderSave(Request $request){goto HwWLp;dDnq3:pA2qg:goto HKiY1;Mjcyk:if ($Order) {goto G_e3s;}goto EJeUj;JndZQ:iGgbv:goto J3C3b;HwWLp:if ($request->isXmlHttpRequest()) {goto Kf3y8;}goto Wo9Su;HKiY1:logs('amazon_pay_v2')->info('.');goto jH8nP;EJeUj:logs('amazon_pay_v2')->info('.');goto kxmLc;DHCbA:$this->entityManager->flush();goto vF2fT;VWivp:Kf3y8:goto AXxAW;p_IkP:$this->session->set($this->sessionAmazonCustomerParamKey, serialize($arrAmazonCustomerParam));goto qy4PR;QzbgD:if (!$flowResult->hasWarning()) {goto iGgbv;}goto cZz2A;E1u1X:return $this->json(['error' => 'executePurchaseFlow::Warning'], 500);goto JndZQ;kxmLc:return $this->json(['error' => 'OrderNotFound'], 500);goto V4sey;UHLiJ:$Order = $this->orderHelper->getPurchaseProcessingOrder($preOrderId);goto Mjcyk;pkmjf:$form = $this->createForm(OrderType::class, $Order);goto xDwmi;XaUF5:return $this->json(['error' => 'executePurchaseFlow::Error'], 500);goto Vc6_E;J3C3b:return $this->json([]);goto dDnq3;aZ25i:$flowResult = $this->executePurchaseFlow($Order, false);goto DHCbA;jH8nP:return $this->json(['error' => 'validateError'], 500);goto jNsW9;cZz2A:logs('amazon_pay_v2')->info('executePurchaseFlowWarning.', [$flowResult->getWarning()]);goto E1u1X;Wo9Su:throw new BadRequestHttpException();goto VWivp;V4sey:G_e3s:goto pkmjf;xDwmi:$form->handleRequest($request);goto lecQq;C_mdK:logs('amazon_pay_v2')->info('.', [$Order->getId()]);goto aZ25i;vF2fT:if (!$flowResult->hasError()) {goto W5hEZ;}goto Uvfe4;lecQq:$arrAmazonCustomerParam = $this->getAmazonCustomerParam($request);goto p_IkP;qy4PR:if (!($form->isSubmitted() && $form->isValid())) {goto pA2qg;}goto C_mdK;AXxAW:$preOrderId = $this->cartService->getPreOrderId();goto UHLiJ;Vc6_E:W5hEZ:goto QzbgD;Uvfe4:logs('amazon_pay_v2')->info('executePurchaseFlowError.', [$flowResult->getErrors()]);goto XaUF5;jNsW9:}private function createPaymentMethod(Order $Order, FormInterface $form, $amazonCheckoutSessionId = null){goto NIXmh;NIXmh:$PaymentMethod = $this->container->get($Order->getPayment()->getMethodClass());goto QIIcw;QIIcw:$PaymentMethod->setOrder($Order);goto gF0sz;IudB2:$PaymentMethod->setAmazonCheckoutSessionId($amazonCheckoutSessionId);goto JQ61B;JQ61B:NSETP:goto cd11n;eFVnT:if (is_null($amazonCheckoutSessionId)) {goto NSETP;}goto IudB2;cd11n:return $PaymentMethod;goto wLa0g;gF0sz:$PaymentMethod->setFormType($form);goto eFVnT;wLa0g:}protected function executeCheckout(AmazonPay $paymentMethod, Order $Order){goto ELWtD;SLmGp:foreach ($PaymentResult->getErrors() as $error) {$this->addError($error);rN6Ga:}goto S0Y9T;GZw5j:return $response;goto sPW0Q;HqFOa:$response = $PaymentResult->getResponse();goto d1hiz;zr_17:logs('amazon_pay_v2')->info('[] PaymentMethod::checkout, .', [$PaymentResult->getErrors()]);goto WZ65m;WZ65m:return $this->redirectToRoute('shopping_error');goto iKUxy;sPW0Q:ozSjj:goto hWv5W;d1hiz:if (!($response && ($response->isRedirection() || $response->getContent()))) {goto ozSjj;}goto XMaoO;j4rSb:logs('amazon_pay_v2')->info('[] PaymentMethod::checkout.');goto GZw5j;hWv5W:if ($PaymentResult->isSuccess()) {goto e4_h5;}goto PMnNA;XMaoO:$this->entityManager->flush();goto j4rSb;iKUxy:e4_h5:goto dPpnH;S0Y9T:uVOam:goto zr_17;ELWtD:$PaymentResult = $paymentMethod->checkout();goto HqFOa;PMnNA:$this->purchaseFlow->rollback($Order, new PurchaseContext());goto SLmGp;dPpnH:}private function getAmazonCustomerParam($request){goto I1pXS;yrMau:$login_check_v2 = empty($request->get('_shopping_order')['login_check_v2']) ? null : $request->get('_shopping_order')['login_check_v2'];goto zfTdy;IiqgI: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 ALLis;zfTdy:$amazon_login_email_v2 = empty($request->get('_shopping_order')['amazon_login_email_v2']) ? null : $request->get('_shopping_order')['amazon_login_email_v2'];goto fqv1w;I1pXS:$customer_regist_v2 = empty($request->get('_shopping_order')['customer_regist_v2']) ? false : true;goto tA6rP;fqv1w:$amazon_login_password_v2 = empty($request->get('_shopping_order')['amazon_login_password_v2']) ? null : $request->get('_shopping_order')['amazon_login_password_v2'];goto IiqgI;tA6rP:$mail_magazine = empty($request->get('_shopping_order')['mail_magazine']) ? false : true;goto yrMau;ALLis:}private function checkAmazonCustomerError($request, $form, $Order){goto TLI38;RTeoR:$arrError['amazon_login_email_v2'] = ' ' . $amazon_login_email_v2_error;goto rWie7;sl0SY:goto gPraf;goto X019Z;FLzzX:$amazon_login_email_v2_error = '';goto Ity6v;DcLiw:$Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $Order->getEmail()]);goto K71AV;v8VFN:HI4AY:goto wpN2b;wqsqo:cy3Qc:goto DUtS0;f7NNo:PFNo1:goto sl0SY;m2csZ:foreach ($violations as $violation) {$amazon_login_password_v2_error .= $violation->getMessage() . PHP_EOL;mwNk0:}goto RXeaC;V65KZ:$AmazonCustomer = $this->customerRepository->getNonWithdrawingCustomers(['v2_amazon_user_id' => $profile->buyerId]);goto ki4zX;VH9bj:NlfBb:goto XbiTn;FJaH8:$login_check_v2 = $form['login_check_v2']->getData();goto yDAbD;z5igu:$encoder = $this->encoderFactory->getEncoder($Customer[0]);goto c1A31;SO3Fg:$arrError['amazon_login_email_v2'] = ' ';goto v8VFN;A2z7e:$arrError['amazon_login_password_v2'] = ' ' . $amazon_login_password_v2_error;goto sk5IY;A47mW:Bl8v2:goto SO3Fg;WB2w5:$customerPassword = $Customer[0]->getPassword();goto iVXxh;omeoS:gPraf:goto VH9bj;hj6b7:if (empty($AmazonCustomer[0])) {goto cy3Qc;}goto LaGon;h03Vc:$arrError['amazon_login_email_v2'] = ' ';goto cGY0U;t_Lil:$request_uri = $request->getUri();goto mgxYS;DUtS0:goto VpMpD;goto T8pS8;cGY0U:LXy1e:goto xjrp0;c1A31:$salt = $Customer[0]->getSalt();goto WB2w5;ztL4H:VpMpD:goto aaUmx;cOEsD:if (empty($Customer[0])) {goto Bl8v2;}goto z5igu;aaUmx:goto b5ob5;goto dDrSB;iVXxh:if ($encoder->isPasswordValid($customerPassword, $form['amazon_login_password_v2']->getData(), $salt)) {goto LXy1e;}goto h03Vc;tGdXN:if (empty($amazon_login_password_v2_error)) {goto oFsQZ;}goto A2z7e;rWie7:YZOc1:goto FJHs_;XbiTn:nU9qn:goto O5Eyc;VZCr4:$Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $form['amazon_login_email_v2']->getData()]);goto cOEsD;AG9_d:$arrError['customer_regist_v2'] = ' ';goto i3Cy0;JMa2w:$arrError['customer_regist_v2'] = ' ' . $Order->getEmail() . '';goto ztL4H;T8pS8:OJtuo:goto JMa2w;A26xP:if (empty($amazon_login_email_v2_error)) {goto YZOc1;}goto RTeoR;i3Cy0:b5ob5:goto omeoS;yDAbD:if ($login_check_v2 == 'regist') {goto GlVLf;}goto y5V64;MsIkC:if (!(!$this->isGranted('IS_AUTHENTICATED_FULLY') && $this->Config->getLoginRequired() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on'])) {goto nU9qn;}goto t_Lil;RXeaC:B_0S4:goto tGdXN;wpN2b:VLu_9:goto f7NNo;X019Z:GlVLf:goto hJcE5;Ity6v:foreach ($violations as $violation) {$amazon_login_email_v2_error .= $violation->getMessage() . PHP_EOL;DYejv:}goto Trxa5;OB3by:$amazon_login_password_v2_error = '';goto m2csZ;xjrp0:goto HI4AY;goto A47mW;mgxYS:if (!('POST' === $request->getMethod() && strpos($request_uri, 'shopping/amazon_pay/address') === false && strpos($request_uri, 'shopping/amazon_pay/delivery') === false)) {goto NlfBb;}goto FJaH8;mMNAC:$violations = $this->validator->validate($form['amazon_login_email_v2']->getData(), [new Assert\NotBlank(), new Assert\Email()]);goto FLzzX;sk5IY:oFsQZ:goto OXeeS;K71AV:$profile = unserialize($this->session->get($this->sessionAmazonProfileKey));goto V65KZ;FJHs_:$violations = $this->validator->validate($form['amazon_login_password_v2']->getData(), [new Assert\NotBlank()]);goto OB3by;O5Eyc:return $arrError;goto Zlw4C;ki4zX:if (!empty($Customer[0])) {goto OJtuo;}goto hj6b7;TLI38:$arrError = [];goto MsIkC;OXeeS:if (!(empty($login_check_v2_error) && empty($amazon_login_email_v2_error) && empty($amazon_login_password_v2_error))) {goto VLu_9;}goto VZCr4;hJcE5:if (empty($form['customer_regist_v2']->getData())) {goto l11Lm;}goto DcLiw;Trxa5:jz8h0:goto A26xP;y5V64:if (!($login_check_v2 == 'login')) {goto PFNo1;}goto mMNAC;dDrSB:l11Lm:goto AG9_d;LaGon:$arrError['customer_regist_v2'] = ' Amazon' . $AmazonCustomer[0]->getEmail() . '';goto wqsqo;Zlw4C:}private function setLogin($request, $Order, $email){goto mfWV9;dTXPN:return $ret;goto MB96E;DGoZW:try {goto eiQKv;kfXvP:$ret = true;goto A630k;QxHLz:$token = new UsernamePasswordToken($Customer[0], null, 'customer', ['ROLE_USER']);goto oI6MN;oI6MN:$this->tokenStorage->setToken($token);goto B3Bpl;B3Bpl:$this->amazonOrderHelper->copyToOrderFromCustomer($Order, $Customer[0]);goto kfXvP;eiQKv:$Customer = $this->customerRepository->getNonWithdrawingCustomers(['email' => $email]);goto luMfQ;luMfQ:$Order->setCustomer($Customer[0]);goto QxHLz;A630k:} catch (\Exception $e) {logs('amazon_pay_v2')->error($e);}goto dTXPN;mfWV9:$ret = false;goto DGoZW;MB96E:}private function setAmazonCustomerData($form, $arrAmazonCustomerParam){goto MuXH2;ORwql:ZtdKF:goto QGwtE;Nf01A:$form->get('mail_magazine')->setData($arrAmazonCustomerParam['mail_magazine']);goto iBO9B;ieEPq:$form->get('login_check_v2')->setData($arrAmazonCustomerParam['login_check_v2']);goto TLF_4;MuXH2:$form->get('customer_regist_v2')->setData($arrAmazonCustomerParam['customer_regist_v2']);goto mg8t8;mg8t8:if (!($this->pluginRepository->findOneBy(['code' => 'MailMagazine4', 'enabled' => true]) || $this->pluginRepository->findOneBy(['code' => 'PostCarrier4', 'enabled' => true]))) {goto EPGXi;}goto Nf01A;UL13v:$form->get('amazon_login_password_v2')->setData($arrAmazonCustomerParam['amazon_login_password_v2']);goto ORwql;iBO9B:EPGXi:goto Gxw_x;Gxw_x:if (!($this->Config->getLoginRequired() == $this->eccubeConfig['amazon_pay_v2']['toggle']['on'] && !$this->isGranted('IS_AUTHENTICATED_FULLY'))) {goto ZtdKF;}goto ieEPq;TLF_4:$form->get('amazon_login_email_v2')->setData($arrAmazonCustomerParam['amazon_login_email_v2']);goto UL13v;QGwtE:}public function getPendingProcessingOrder($preOrderId = null){goto p0drH;LQ8h9:$OrderStatus = $this->orderStatusRepository->find(OrderStatus::PENDING);goto OGaZL;OGaZL:return $this->orderRepository->findOneBy(['pre_order_id' => $preOrderId, 'OrderStatus' => $OrderStatus]);goto tOQVr;EVevr:return null;goto Mi68D;p0drH:if (!(null === $preOrderId)) {goto EDwkJ;}goto EVevr;Mi68D:EDwkJ:goto LQ8h9;tOQVr:}private function checkShippingDifference($Order, $shippingAddress){goto IGAaU;uDFAA:$shippingDifference = true;goto Q1i8D;GOpaw:$Shippings = $Order->getShippings();goto CMAPi;hvl1k: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 BcnOV;}goto uDFAA;U74ba:return $shippingDifference;goto aVQ27;Q1i8D:BcnOV:goto U74ba;IGAaU:$amazonShipping = new Shipping();goto oDjwg;CMAPi:$shippingDifference = false;goto hvl1k;nxs3Q:$this->amazonOrderHelper->convert($amazonShipping, $shippingAddress);goto GOpaw;oDjwg:$amazonShipping->setOrder($Order);goto nxs3Q;aVQ27:}protected function getAmazonPayDefaultDelivery(Shipping $Shipping){goto tadS1;tadS1:$OrderItems = $Shipping->getProductOrderItems();goto eB73g;T_gDh:$Deliveries = $this->deliveryRepository->getDeliveries($SaleTypes);goto CqXGV;eB73g:$SaleTypes = [];goto PMld2;ZkBKk:return $Delivery;goto dvXIb;CqXGV:foreach ($Deliveries as $key => $Delivery) {goto EahcN;K2tGV:R13A4:goto cJqc6;R35Bh:if ($amazonPayFlg) {goto HNOpb;}goto JmFgR;v6YJz:WOdYb:goto R35Bh;JmFgR:unset($Deliveries[$key]);goto IHn2M;IHn2M:HNOpb:goto K2tGV;paN4h:foreach ($PaymentOptions as $PaymentOption) {goto MSW1G;OWwj6:UyMfn:goto s5sDe;Pqw7H:if (!($Payment->getMethodClass() === AmazonPay::class)) {goto OS4xJ;}goto yP7X1;y2trI:OS4xJ:goto OWwj6;yP7X1:$amazonPayFlg = true;goto O3QUc;MSW1G:$Payment = $PaymentOption->getPayment();goto Pqw7H;O3QUc:goto WOdYb;goto y2trI;s5sDe:}goto v6YJz;EahcN:$PaymentOptions = $Delivery->getPaymentOptions();goto voupw;voupw:$amazonPayFlg = false;goto paN4h;cJqc6:}goto jJzFo;jJzFo:MWv4Q:goto IOWiN;PMld2:foreach ($OrderItems as $OrderItem) {goto TdNXi;TdNXi:$ProductClass = $OrderItem->getProductClass();goto YdbCr;lFd9z:asp_x:goto qgi9L;YdbCr:$SaleType = $ProductClass->getSaleType();goto u5Tpp;u5Tpp:$SaleTypes[$SaleType->getId()] = $SaleType;goto lFd9z;qgi9L:}goto FWcUU;IOWiN:$Delivery = current($Deliveries);goto ZkBKk;FWcUU:vGMHX:goto T_gDh;dvXIb:}}

Function Calls

None

Variables

None

Stats

MD5 478074f5bd665f79da23bf10d343a467
Eval Count 0
Decode Time 81 ms