File tree Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -529,7 +529,7 @@ public function confirmOrder()
529529 array (
530530 'paymentMethod ' => $ paymentMethod ,
531531 'total ' => floatval ($ total ),
532- 'callback ' => '' // $this->url->link('extension/d_vuefront/store/checkout/ callback', ' order_id=' .$orderId, true)
532+ 'callback ' => $ this ->storeManager -> getStore ()-> getBaseUrl (). " rest/V1/vuefront/ callback? order_id=" .$ orderId
533533 )
534534 );
535535
@@ -541,6 +541,10 @@ public function confirmOrder()
541541 ];
542542 }
543543
544+ public function callback () {
545+
546+ }
547+
544548 public function totals ()
545549 {
546550 $ totals = $ this ->checkoutSession ->getQuote ()->getTotals ();
Original file line number Diff line number Diff line change @@ -38,4 +38,15 @@ public function start($body, $driver)
3838
3939 return $ this ->registry ->get ('response ' )->getOutput ();
4040 }
41+
42+ /**
43+ * @param $body
44+ * @param $driver \Magento\Framework\Filesystem\Driver\File
45+ */
46+ public function callback ($ body , $ driver )
47+ {
48+ $ this ->loader ->resolver ('store/checkout/callback ' , $ body );
49+
50+ return $ this ->registry ->get ('response ' )->getOutput ();
51+ }
4152}
Original file line number Diff line number Diff line change @@ -79,4 +79,22 @@ public function graphql()
7979 return ;
8080 }
8181 }
82+
83+ public function callback ()
84+ {
85+ $ this ->checkCors ();
86+
87+ $ enable = $ this ->scopeConfig
88+ ->getValue ('vuefront/general/enable ' , \Magento \Store \Model \ScopeInterface::SCOPE_STORE );
89+
90+ if ($ enable ) {
91+ $ output = $ this ->startup ->start ($ this ->request ->getBodyParams (), $ this ->driver );
92+
93+ return $ output ;
94+ } else {
95+ $ norouteUrl = $ this ->url ->getUrl ('noroute ' );
96+ $ this ->response ->setRedirect ($ norouteUrl );
97+ return ;
98+ }
99+ }
82100}
Original file line number Diff line number Diff line change 77 <resource ref =" anonymous" />
88 </resources >
99 </route >
10+ <route url =" /V1/vuefront/callback" method =" POST" >
11+ <service class =" Vuefront\Vuefront\Api\GraphqlInterface" method =" callback" />
12+ <resources >
13+ <resource ref =" anonymous" />
14+ </resources >
15+ </route >
1016 <route url =" /V1/vuefront/information/:id" method =" POST" >
1117 <service class =" Vuefront\Vuefront\Api\InformationInterface" method =" info" />
1218 <resources >
You can’t perform that action at this time.
0 commit comments