Payment method not displaying on front end in magento 2 - magento-2.0

I have created a custom payment module using this link but when I update the Model class(extending Cc class instead of AbstractMethod)
\Magento\Payment\Model\Method\AbstractMethod to \Magento\Payment\Model\Method\Cc)
Payment method does not display on front end. When I check the error log, I found following error
report.CRITICAL: Broken reference: No element found with ID 'checkout.header.wrapper'.
Does one have any idea about how we can show credit card with custom payment method (Magento version is 2.1.1)

check method "isAvailable" on your payment model , i think it is return false in your case.

Make sure you have overridden the checkout_index_index.xml in the this folder
app/design/frontend/YourTheme/ThemeName/Magento_Checkout/layout/override/base/
This will help

Related

Check condition before changing post status in wordpress

I have a form in the front end which enables users to submit posts. These posts are by default saved as pending. It can only set to publish by the admin. Before publishing certain conditions are to be checked before its set as published.
If the condition is true set post status as publish. If not set it as pending. What is the appropriate action hook to achieve this?
look here, there is 6 hooks than you can use for that :
https://core.trac.wordpress.org/browser/tags/5.3/src/wp-includes/post.php#L4058
just take care that the values that you use in your condition can also be change on this hooks then you have to test where you have the values you need.

How to open a record on a subgrid using easyrepro?

https://github.com/Microsoft/EasyRepro/issues/178
Hi all,
I am using dynamics365 version 9.x
Using EasyRepro I can navigate into an account via the global search and then also use the xrmBrowser.Entity.ClickSubgridAddButton("foobar"); function to create a new record of that 'foobar' type. By doing this I know I am accessing the correct subgrid on the account record.
My question is....which function would I use to simply open up the record I have created. I have tried SelectSubgridLookup but I don't think that is the function I am looking for.
From the image you can see I have created the 'bonno bonno' contact but I cannot open the record using EasyRepro. any help would be greatly appreciated! :)
https://github.com/Microsoft/EasyRepro/issues/178
Hello #darthtang - sorry for the delayed reply to your post here. From reviewing, it appears this is a feature gap and needs to be enhanced.
While not ideal, if you wanted to open the record, you could try the following instead:
xrmBrowser.Entity.ClickSubgridGridViewButton(subgridName)
This should take you to the 'Associated View' via Related Navigation. From here, you could call:
optional:
xrmbrowser.Related.Search(contactrecordname);
xrmBrowser.Related.OpenGridRow(#)
At this point, you could then switch back to perform actions on the opened Contact entity record:
xrmBrowser.Entity.SomeMethod();
Please let me know if this set of steps help you with your scenario. I've added a feature enhancement to the backlog to allow opening of a record from a subgrid on a form.

WooCommerce Rest API - Product category filter not working

I have created an app which is displaying some products using the WooCommerce Rest API.
I have applied a few filters and everything was looking good until I tried to apply a filter for the category
http://foo/wc-api/v3/products?filter[limit]=15&filter[category]=some-category&oauth_consumer_key=ck_xx&oauth_nonce=xx&oauth_signature_method=HMAC-SHA1&oauth_timestamp=xx&oauth_version=1.0&filter%5Blimit%5D=15&filter%5Bcategory%5D=antioxidants&oauth_signature=xx%3D
Now I get the message
DENIED - The requested resource requires user authentication. (XHR): GET ...
Any ideas why that is?
Found the answer (at least it's working for me)
You need to make the filter[category] the first parameter in your query string.
I'll let the guys know about this too.

Drupal Ubercart 2checkout, what DIRECT RETURN option to choose?

About "Direct Return" it is written here to choose "Header Redirect"
(3. Under Direct Return select Header Redirect.)
https://www.2checkout.com/shopping-cart/ubercart/
But it is written here to choose "Given links back to my website"
(3. Under Direct Return select Given links back to my website.)
http://www.ubercart.org/forum/support/31330/configure_2checkout_payment_ubercart_drupal_6
Do you know if given links back to my website is definitively the option to select?
More info about "How Does The Return Process Work?"
2checkout.com/blog/knowledge-base/merchants/tech-support/passbacks-and-returns/how-does-the-return-process-work/?plain
The return method depends on the version of the extension you are using. If you are using the version found at https://github.com/craigchristenson/ubercart-3-2checkout you use Header Redirect. The 2Checkout extension that is included in the Ubercart core uses Given Links back to my Website. Unfortunately the return function in the 2Checkout module that is included with UberCart has a bug and will not be fixed until the next release. In the mean time I suggest using the extension referenced at the URL above. If you have any trouble with your integration, you can contact 2Checkout directly for integration assistance.
Ok I think that I have found the solution here:
http://www.ubercart.org/project_issue/access_denied_2checkout_order_completion
1
The problem does not appear to be related to SSL. Their is an error in the ubercart 2Checkout return script that is causing this return issue. Ubercart is trying to verify the MD5 hash that is being passed back using a hash of secret word, vendor number, merchant_order_id, total which is incorrect and causing the validation to fail. To correct the issue please open the following file "drupal/modules/ubercart/payment/uc_2checkout/uc_2checkout.pages.inc" and edit line 20 so that it matches the following:
$valid = md5(variable_get('uc_2checkout_secret_word', 'tango') . $_POST['sid'] . $_POST['order_number'] . $_POST['total']);
So it really mean that there is no good 2checkout module for Ubercart and that the only solution is to hack line #20 ?
Ubercart has these issues addressed in the dev branches of UberCart 2 and 3. You can also get just the fixed 2Checkout modules at the URLs below:
UberCart-2 Drupal-6
https://github.com/craigchristenson/ubercart-2-2checkout
UberCart3 Drupal-7
https://github.com/craigchristenson/ubercart-3-2checkout

How to throw 404 error in Drupal module?

I need to throw 404 error in module. Or may be there are any possibility to set required option for menu hook?
It is easy. These should take care of watchdog, HTTP 404 response code and other related things.
For Drupal 6 & 7
In your module's page callback, do: return drupal_not_found();
For Drupal 8
In the class::method() referred to in the _controller definition (i.e. the page callback or the method responsible for generating output for the request), do:
throw new \Symfony\Component\HttpKernel\Exception\NotFoundHttpException();
References
drupal_not_found() documentation for Drupal 6.
drupal_not_found() documentation for Drupal 7.
NotFoundHttpException documentation for Drupal 8.
For Drupal 8+
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
// then
throw new NotFoundHttpException();
MENU_NOT_FOUND should be returned in page callback functions.
Page callback functions wanting to report a "page not found" message should return MENU_NOT_FOUND instead of calling drupal_not_found().
— http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_not_found/7
Look into the drupal_add_http_header() function to play with the HTTP header attributes. Also make sure you stick this at the top of your module's code to make sure it executes first. Also, you might find this helpful. https://www.drupal.org/project/generate_errors

Resources