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()
529
529
array (
530
530
'paymentMethod ' => $ paymentMethod ,
531
531
'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
533
533
)
534
534
);
535
535
@@ -541,6 +541,10 @@ public function confirmOrder()
541
541
];
542
542
}
543
543
544
+ public function callback () {
545
+
546
+ }
547
+
544
548
public function totals ()
545
549
{
546
550
$ totals = $ this ->checkoutSession ->getQuote ()->getTotals ();
Original file line number Diff line number Diff line change @@ -38,4 +38,15 @@ public function start($body, $driver)
38
38
39
39
return $ this ->registry ->get ('response ' )->getOutput ();
40
40
}
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
+ }
41
52
}
Original file line number Diff line number Diff line change @@ -79,4 +79,22 @@ public function graphql()
79
79
return ;
80
80
}
81
81
}
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
+ }
82
100
}
Original file line number Diff line number Diff line change 7
7
<resource ref =" anonymous" />
8
8
</resources >
9
9
</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 >
10
16
<route url =" /V1/vuefront/information/:id" method =" POST" >
11
17
<service class =" Vuefront\Vuefront\Api\InformationInterface" method =" info" />
12
18
<resources >
You can’t perform that action at this time.
0 commit comments