-
Notifications
You must be signed in to change notification settings - Fork 7
Fix some issues to work in sylius 1.12 #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,7 +35,7 @@ public function __construct(Environment $templating) | |
| public function __invoke(Request $request): Response | ||
| { | ||
| return new Response( | ||
| $this->templating->render('BitBagSyliusAmazonPayPlugin:AmazonPay:amazonPayStart.html.twig') | ||
| $this->templating->render('@BitBagSyliusAmazonPayPlugin/AmazonPay/amazonPayStart.html.twig') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| ); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| {% include '@SyliusUi/_javascripts.html.twig' with {'path': 'assets/shop/js/app.js'} %} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these lines should not be removed, but replaced with: {{ encore_entry_script_tags('shop-entry', null, 'shop') }}
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But we didn't need the shop javascript here. all the code is plain javascript here without dependencies. |
||
|
|
||
| <script> | ||
| function getURLParameter(name, source) { | ||
| return decodeURIComponent((new RegExp('[?|&|#]' + name + '=' + | ||
|
|
@@ -8,17 +6,21 @@ | |
| ; | ||
| } | ||
|
|
||
| let accessToken = getURLParameter("access_token", location.hash); | ||
| let accessToken = getURLParameter('access_token', location.hash); | ||
|
|
||
| if (typeof accessToken === 'string' && accessToken.match(/^Atza/)) { | ||
| document.cookie = "amazon_Login_accessToken=" + accessToken; | ||
| } | ||
|
|
||
| $.post('{{ path('bitbag_sylius_amazon_pay_initialize') }}', { | ||
| accessToken: accessToken | ||
| }).done(function (data) { | ||
| let formData = new FormData(); | ||
| formData.append('accessToken', accessToken); | ||
|
|
||
| fetch('{{ path('bitbag_sylius_amazon_pay_initialize') }}', { | ||
| method: 'POST', | ||
| body: formData | ||
| }).then(function (data) { | ||
| window.location.replace("{{ path('sylius_shop_checkout_address') }}" + location.hash); | ||
| }).fail(function (data) { | ||
| }).catch(function (data) { | ||
| {#window.location.replace("{{ path('sylius_shop_cart_summary') }}");#} | ||
| }); | ||
| </script> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't needed for me