403 Forbidden during setExpressCheckout - paypal

I am getting the following error during Expresscheckout in sandbox account using setExpressCheckout method. I am using SOAP library paypal_base.jar, paypal_stubs.jar
PM com.paypal.sdk.exceptions.TransactionException <init>
SEVERE: (403)Forbidden
Anyone help me to resolve this issue?

please refer to to https://www.paypal-notify.com/eventnotification/event_details?eventId=4283.
You can try to use "org.apache.axis.transport.http.CommonsHTTPSender" in axis to support http1.1. You have to use axis 1.3 or more as 1.2 has bug with https connection

add a client-config.wsdd to your classpath to use http1.1. You can set log4j to debug level to see if you are useing http 1.0 now. If not, this will not help you.
Content of file:
<?xml version="1.0" encoding="UTF-8"?>
<deployment name="defaultClientConfig"
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<transport name="http" pivot="java:org.apache.axis.transport.http.CommonsHTTPSender">
<parameter name="PROTOCOL">HTTP/1.1</parameter>
</transport>
<transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/>
<transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>
</deployment>

This is like a summery of all answers above along with additional reference.
As mentioned by user3405529 follow the link and understand your problem.
Merchants using the HTTP 1.0 protocol.
This is common for all who are using old PayPal API with axis 1.4
This is the problem in my project.
I referred this link for more details to understand and solve the problem
http://marc.info/?l=axis-user&m=119144869612056
There are four ways to solve this
1)Modify axis source code to use HTTP 1.1 protocol
String httpver = msgContext.getStrProp(MessageContext.HTTP_TRANSPORT_VERSION);
if (null == httpver) {
httpver = HTTPConstants.HEADER_PROTOCOL_V11;
}
//httpver = httpver.trim();
//if (httpver.equals(HTTPConstants.HEADER_PROTOCOL_V11)) {
// http10 = false;
//}
OR
Set Message Context msgContext.setStrProp(..) as HTTPConstants.HEADER_PROTOCOL_V11
Then rebuild axis and maintain your own source code for reference
2)As per user3405529 use client-config.wsdd in classpath with
java:org.apache.axis.transport.http.CommonsHTTPSender in transport
tag
I tested with this changes and it is working as expected.
But both the approaches use HTTP 1.1 by default. In our project as we are not prepared for this change of HTTP protocol version.
see more details at http://www2.research.att.com/~bala/papers/h0vh1.html
3)Update the PayPal stub and rebuild it for use - I do not try it.
4)Update the PayPal SDK to latest version...
We go with updated PayPal SDK. It will be helpful in future.
I hope it is helpful

Related

Magento2 checkout returns to cart instead of placing order

I want to add a "payonbill" feature for my shop so i am using the checkmo payment method to do so. I added a new module with this configuration:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<payment>
<checkmo>
<active>1</active>
<model>Magento\OfflinePayments\Model\Checkmo</model>
<order_status>processing</order_status>
<title>Check / Money order</title>
<allowspecific>0</allowspecific>
<group>offline</group>
<payment_action>authorize_capture</payment_action>
</checkmo>
</payment>
</default>
</config>
By doing so that payment status will migrate to processing and the payment action will be triggered for authorization. When doing so i am no longer able to even place an order on the shop for this method. The problem actually is there because of the payment_action. When i remove that it works again.
Is there a way to handle this scenario? When someone can pay on bill i would like to trigger the event sales_order_invoice_pay as well and continue the flow.
Best
Pim
I fixed the issue by actually removing the stuff i previously did and by implementing this module:
https://github.com/dominicwatts/autoinvoice
The actual problem was that all was working fine but in the end for the offline payment the invoice is generated when booking it inside admin. Bypassing the status won't generate the invoice for you.

Timber rest api 404

I have installed WP 4.9.5 using nginx and the following plugins: Gravity Forms (v2.3.1) by rocketgenius Advanced Custom Fields PRO (v5.6.10) by Elliot Condon Timber (v1.7.0) by Jared Novack + Upstatement WooCommerce Additional Variation Images (v1.7.12) by WooCommerce WooCommerce (v3.3.5) by Automattic
For some reason i cannot understand REST api calls are not working and return 404 error. Permalinks are enabled! I am trying the simplest GET without requiring authentication
http://domain.test/wp-json/wc/v2/
any help appreciated!
Change link from /wp-json/wc/v2/ to /wp-json/wp/v2/:
For testing purposes you can use: https://demo.wp-api.org/wp-json/wp/v2/
I suggest you to read documentation.
Have a nice day.

Check JIRA REST API version?

How to check, that rest api is enabled in JIRA and it has appropriate version?
I know, that it is possible to request 'api/latest', but if latest installed version isn't compatible with methods, that i call?
To check that it is enabled, (and to disable it if you wish), then you will need to go to the Administration panel of your instance and enable/disable it there. Specifically you need to go to:
Administration > General Configuration > Set Accept remote API calls to either On/Off
To check if REST api is enabled, just go to (change the URL to your own)
https://jira.atlassian.com/rest/api/2/user
and see if the page loads.
I don't think there is a way using the API to get the API version, but you can make the API calls and fallback in case of an error. The coding depends on what you are trying to achieve.
You can find more info about the REST API at:
JIRA REST API Version 2 Tutorial
JIRA REST API documentation
If your stuck on the coding part, search Atlassian answers and SO or ask a question.
Use the /rest/serverInfo endpoint, e.g. /rest/api/2/serverInfo.
This should return a JSON string with JIRA version, e.g.
{
...
"version": "8.x.x",
...
}
View page source of Jira page and search version.
Sample output:
<meta name="application-name" content="JIRA" data-name="jira" data-version="7.9.2"><meta name="ajs-server-scheme" content="http">

Redirect attribute of actionforward does not work in struts portlet bridge based portlet (JSR-168)

I did a lot of researching on the matter but cannot seem to find the answer to my question, so I hope you guys can help me out.
We have a struts 1.2.7 web app that we converted to a JSR-168 portlet using the Apache Struts Portlet Bridge.
This is all working very well except for one thing: the actionforwards that specify a redirect do not actually redirect to the specified action. These redirects DO work when running the app as a normal struts web app. Hence, we have a double submit problem in the portlet variant.
We make use of action chaining that ends with an action forwarding to a tile definition. For example:
<action path="/CreateIdmAccountSubmit" validate="true" input="catalog.createaccount.page" type="com.konakart.actions.login.CreateIdmAccountSubmitAction" name="CreateIdmAccountForm">
<forward name="FillRegistrationData" path="/FillRegistrationData.do" redirect="true"/>
</action>
<action path="/FillRegistrationData" validate="false" type="com.konakart.actions.registration.FillRegistrationDataAction" name="FillRegistrationDataForm">
<forward name="FillRegistrationDataPage" path="/FillRegistrationDataPage.do" redirect="false"/>
</action>
<action path="/FillRegistrationDataPage" forward="order.registrationdata.page"/> (tiles-def)
In this example the action /CreateIdmAccountSubmit processes a submitted form (POST) and creates an account in the db. After successfull creation the user is redirected to another action (/FillRegistrationData) which inits an order object and, on its turn, forwards to the orderregistration page which layout is defined in the tiles-defs.xml.
As I said this all works very well, form a functional perspective, but when a user hits f5 on the rendered order-registration-page the action /CreateIdmAccountSubmit is again invoked causing the account to be created double. As I said also this is not happening when running the app as a normal web app. Here, the mechanism works perfectly :)
I think that the problem is being caused by the fact that the redirect is done in the wrong phase but i am really not sure as why this does not work :)
Based on what I read I tried the fowllowing things to fix the redirect problem:
* specified the action that does the form submit as "actionUrl" in struts-portlet-config.xml (hoping that redirect is done in wrong phase?)
* replaced the normal html tag library by the struts-portlet variant (hoping that a valid url actionUrl was produced by my html:form that in some way made the redirect possible?)
These two steps did not seem to help and I am lost at how to accomplish a simple redirect in the portlet so that we can prevent the double submit problem.
Hope you guys can help me out!
I found the answer: the mechanism is dependent on the portal implementation. We use Liferay which does not work with redirects by default.
However, you can switch this on by declaring an element in liferay-portlet.xml called
<action-url-redirect>true</action-url-redirect>
This fixed the problem for us!

How Do You Get The Store Secure URL in Magento?

I have a form in Magento that is displayed over the insecure URL (http) but I need it to submit to the secure URL (https).
I display the URL I currently use the following code:
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)
I am assuming I need to change the URL_TYPE_WEB to something else. Does anyone know what that something else is?
Have you tried this?
Mage::getUrl('',array('_secure'=>true))
I think that gets you the base secure url, I believe.
Mage::getUrl('customer/account/login',array('_secure'=>true))
Will get you to the login page. In other words,
Mage::getUrl('module/controller/action',array('_secure'=>true))
Will get you to any page you want, just substitute 'module/controller/action' for the appropriate combo.
Edit -- Fixed Typos
http://blog.geekslikeshinythings.com/2014/12/magento-force-secure-urls-https-on-all.html
this works in Mageno 1.9.1
use your app/etc/config.xml file
<?xml version="1.0"?>
<config>
<frontend>
<secure_url>
<all>/</all>
</secure_url>
</frontend>
</config>
If user is using https, this should force all urls to rewrite (created as) to https.
Use:
Mage::getStoreConfig(Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL);
to read the the configuration value inside magento that has been set inside admin.
this worked to me
echo Mage::getUrl('customer/account/loginPost',array('_secure'=>true));
For example:
if you browsing with http then
echo Mage::getUrl('customer/account/loginPost',array('_secure'=>true));
// http://dominio.com/customer/account/loginPost
if you browsing with https then
echo Mage::getUrl('customer/account/loginPost',array('_secure'=>true));
// https://dominio.com/customer/account/loginPost
You can do this in code and also from xml.
For example, if you want to set https for the check out page then you have to add the below code in your custom config.xml:
<code>
<secure_url>
<checkout_onepage>/checkout/onepage</checkout_onepage>
<checkout_multishipping>/checkout/multishipping</checkout_multishipping>
</secure_url>
</code>
Magento has a default feature for https for check out so you can do the same thing for other pages like for the customer page:
<code>
<secure_url>
<customer>/customer/</customer>
</secure_url>
</code>
I hope it'll help you.
Tried this its working for me.
Mage::getUrl('',array('_secure'=>true))
After added this code finally its look like below
IWD.ProductVideoView.urlGetVideo = "<?php echo Mage::getUrl('iwd_productvideo/player/getvideo/',array('_secure'=>true)); ?>?isAjax=true";