title: PAYPAL CORS error
body: <p>I am using adaptivepayments api.The code to get paypal key is,</p>
  
  <pre><code>    PayRequest payRequest = new PayRequest(requestEnvelope, "PAY_PRIMARY",
                  getProperties().getProperty("paypal_failed_url").trim() + bookingId, "SGD", receiverList,
                  getProperties().getProperty("paypal_success_url").trim() + bookingId);
          payRequest.setFeesPayer("PRIMARYRECEIVER");
          payRequest.setTrackingId(transactionKey);
          payRequest.setReceiverList(receiverList);
          AdaptivePaymentsService service = null;
          Map&lt;String, String&gt; sdkConfig = new HashMap&lt;String, String&gt;();
          sdkConfig.put("mode", "sandbox");
          sdkConfig.put("acct1.UserName", "SG_Owner_api1.owner.com");
          sdkConfig.put("acct1.Password", "WY8HAW6WGUNM3R72");
          sdkConfig.put("acct1.Signature", "AFcWxV21C7fd0v3bYYYRCpSSRl31ATxmPR-EfTtPngimumXW80wNhGsQ");
          sdkConfig.put("acct1.AppId", "APP-80W284485P519543T");
  
          service = new AdaptivePaymentsService(sdkConfig);
  
          PayResponse payResponse = null;
  
          // ## Making API call
          // Invoke the appropriate method corresponding to API in service
          // wrapper object
          payResponse = service.pay(payRequest);
          logger.debug("--&gt;" + payResponse.getPayKey());
          logger.debug("--&gt;" + payResponse.getResponseEnvelope().getAck());
  </code></pre>
  
  <p>The paykey is returned successfully, after that for the payment the paypal page should be shown for user's authorization and the sandbox link for that is ,
  (<a href="https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&amp;paykey=paykey" rel="nofollow">https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&amp;paykey=paykey</a>)</p>
  
  <p>Foe this I am doing ,</p>
  
  <pre><code>     httpResponse.addHeader("Access-Control-Allow-Origin", "*");
          httpResponse.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
          httpResponse.addHeader("Access-Control-Allow-Headers",
                  "access-control-allow-origin,content-type, accept");
  
          httpResponse.sendRedirect(url + payKey);
          return Response.status(successResponse.getCode()).entity(successResponse).build();
  </code></pre>
  
  <p>The paypal palpage is not shown and I can see error in browser console,"<a href="https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&amp;paykey=paykey" rel="nofollow">https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&amp;paykey=paykey</a>"<br>
  geeting error, No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost:8080' is therefore not allowed access.</p>
  
  <p>Please let me know what needs to be done to get redirected to paypal page.</p>
  
  <p>Thanks,
  Gayithri</p>