PayPal Sandbox suddenly outputting proxy error for adaptive payments - paypal

Edit: For some reason it's working again. I did not need to log in to developer.paypal.com either. If anyone knows why, that would be useful. Thanks!
For the past few months I have been developing a site using PayPal's adaptive payments, specifically the chained payments method. I am using the embedded payment method from a site that uses SSL. The integration had been working perfectly for months until a day or two ago. It was even still working right after I imported my old sandbox accounts to the new developer.paypal.com sandbox.
After submitting the payment from the site's form, the browser spins for a minute or two. The error generated after a few minutes is the following:
The proxy server could not handle the request GET
/webapps/adaptivepayment/flow/corepay Reason: Error during SSL
Handshake with remote server
$API_UserName = "us business account from developer.paypal.com sandbox";
$API_Password = "password from developer.paypal.com sandbox";
$API_Signature = "singature from developer.paypal.com sandbox";
// AppID is preset for sandbox use
// If your application goes live, you will be assigned a value for the live environment by PayPal as part of the live onboarding process
$API_AppID = "APP-80W284485P519543T";
$API_Endpoint = "";
if ($Env == "sandbox")
{
$API_Endpoint = "https://svcs.sandbox.paypal.com/AdaptivePayments";
}
else
{
$API_Endpoint = "https://svcs.paypal.com/AdaptivePayments";
}
If I am not mistaken, I believe the error is being generated when the redirect happens from this function here:
function RedirectToPayPal ( $cmd )
{
// Redirect to paypal.com here
global $Env;
$payPalURL = "";
if ($Env == "sandbox")
{
$payPalURL = 'https://www.sandbox.paypal.com/webapps/adaptivepayment/flow/pay?expType='.$_POST['expType'].$cmd;
}
else
{
$payPalURL = "https://www.paypal.com/webscr?" . $cmd;
}
header("Location: ".$payPalURL);
exit;
}
Edit: I changed the $payPalURL to "https://developer.paypal.com..." as suggested and got the following:
Service Temporarily Unavailable
The server is temporarily unable to service your request due to
maintenance downtime or capacity problems. Please try again later.

After the recent code change this flow now requires you to log in to https://developer.paypal.com first. I am checking to see if this was intentional or is a code bug.

There appears to have been an issue with the sandbox.paypal.com server that disabled adaptive payments for a couple days. Everything seems to be functioning as it had been previously. Thank you to Dennis for his input.
Edit:
This appears to be ongoing and intermittent

Related

Facebook Webhook Feed not receiving data from live page

I have been working on this stupid app for a week and can not for the life of me figure out where I am going wrong.
I have created the app, Added Webhooks and connected the webhooks to my site. I created a log file to log all incoming connections and nothing is coming in. I can test it using the developer system and it works perfectly but nothing I do will get it work on the live page.
Basic Test Code
$challenge = $_REQUEST['hub_challenge'];
$verify_token = $_REQUEST['hub_verify_token'];
if(isset($_REQUEST['hub_challenge']) && $verify_token == '08231984'){
echo $challenge;
}
$content = file_get_contents('php://input');
$fp = fopen('test.txt', 'a');
fwrite($fp, $content);
Advanced Access Permissions: pages_show_list, public_profile, pages_manage_metadata, email
I am use to seeing a status switch in the address bar that has developer mode and live. This switch is not displayed in the address bar anymore and I have checked in multiple browsers.
I have business verified, business account manager setup and the page is added that I wish to monitor as well as myself as a user.
I am at a complete loss on how to get this thing working. Any help is greatly appreciated.

Paypal login freeze (opencart 2.1.0.2)

I added the option to login with Paypal.
I am using the Paypal standard login.
I am using sandbox for testing but the issue persists even if in real mode.
Everything is ok except after the login with the email of paypal, after I input the credentials of paypal account it goes to load the setting from paypal account that I selected (name, date of birth etc,) it goes ok and after that it freezes in the same login window (a blank window).
In the site it does not do anything and doesn't login.
I noticed that the url in the login window goes to the redirect that I had to configure. I think that maybe it's related with the redirect URL. Can anyone please check if everything is ok with the settings or if it is a known bug with this?
The full url that appears in the login windows after the credencials are submitted is:
https://www.quitandabrasil.com/index.php?route=module/pp_login/login&scope=address+profile+email+phone&code=nhZpJ2YmnH_R3HXkheGFfPErrJluZ-fDhfDFuPgqLzwYX1AmNYNEfbjPiT5D-46YO-LaPWLQU98CVEoWO5ndUMfC1XGWOMg_yAJ6ZYCK_EpC1ns4Crl6A5bDV1DdAbrTbJlRthHtbpM1NAVBJpxskbViJjGhgdczvInmmSg8BCdEupPDJzKCb2j9RLoKZl8EEeD0pVBov2zRjrq2
I have uploaded pics of the opencart config "login with paypal" and from the developer site that have the sandbox account.
DGjlR.jpg
You can refer to https://github.com/opencart/opencart/issues/3640
Change the API URLs
//$endpoint = 'https://api.sandbox.paypal.com/v1/oauth2/token';
$endpoint = 'https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice';
//$endpoint = 'https://api.paypal.com/v1/oauth2/token';
$endpoint = 'https://api.paypal.com/v1/identity/openidconnect/tokenservice';
Comment/remove line:
//CURLOPT_USERPWD => $this->config->get('pp_login_client_id') . ':' . $this->config->get('pp_login_secret'),

PAYPAL RESTful API execute call occasional error

I have fully integrated my website with paypal using paypal RESTful's API PHP SDK. Now my problem is every once in a while on the payment process, once the user approves the payment and it comes back to my website for execution, the API execution request comes back with the following responses from paypal. The HTTP response code's in these scenarios are 400 and 500. Below I have listed the error name and error message which comes as a part of the JSON response I get form paypal on execute action (https://api.paypal.com/v1/payments/payment/PAY-xxxxxxxxxxxxxxxxxxxxxxxxxx/execute):
400 PAYMENT_NOT_APPROVED_FOR_EXECUTION,Payer has not approved payment
500 INTERNAL_SERVICE_ERROR,An internal service error has occurred
In terms of the code I use to make that call I have added the function which executes the payment. I should add that this is working in 98% of times. Below is the code:
public function getExecute()
{
// Payment is cancelled
if (!(Input::get('success') && Input::get('success') == 'true'))
return $this->runPaymentExitProcess();
// No paymentId
if (!Session::has('paymentId'))
return "No payment id to execute";
$paymentId = Session::get('paymentId');
$this->payment = Payment::get($paymentId, $this->apiContext);
// The payer_id is added to the request query parameters when the user is redirected from paypal back to your site
$this->execution->setPayer_id(Input::get('PayerID'));
$response = $this->payment->execute($this->execution, $this->apiContext);
// Check for paypal errors
if (isset($response->name)) {
// When we have a paypal error
if ($this->hasPaypalError($response)) {
$error = array('name' => $response->name, 'message' => $response->message);
Session::put('error', $error);
return (MODE == 'LIVE') ? Redirect::to('/paypalerror') : Redirect::to('/paypalerror'.MODE_PARAM);
die;
}
}
// Unset session
Session::forget('paymentId');
// execution successful
if ($this->addPaymentIdToUser($paymentId))
return (MODE == 'LIVE') ? Redirect::to('/') : Redirect::to('/'.MODE_PARAM);
}
The code is in laravel. Please note that the $this->apiContext is set in the constructor of the class. Also this is the function is the success url which is set in the API under redirect_urls.
Can someone please help me figure out if this issue is coming from my side or Paypal's side?
For the 400 error, this would occur if the user decided not to approve the payment. If you think the payment was actually approved in the web flow then that would be an issue to look into further.
Can you provide the debugId and approximate time (with timezone, or GMT) of a 500 internal server error response, and a 400 if you believe the payment was actually approved by user.

PayPal Chained payments failing

I'm trying to get PayPal's chained payments working in their sandbox env. but whenever I click on "Pay" at the very last stage after signing in I always get redirected to a page with the generic error message "Your payment can't be completed. Please return to the participating website and try again."
I've tried doing both chained and parallel payments with the same results.
I've also followed a few suggestions from around the web which inc tweaking the merchant account settings making sure certain fields were unchecked under the "blocked" options. As well checking currency and country code. Initially country code was en_GB and currency GBP, that didn't work I tried doing en_US with USD but in all cases I get the same message.
I've also tried adding an IPN url on the off chance PayPal would post some error code/message to it but got nadda! If you click "Return to test store" it goes to the cancel URL without any POST/GET parameters.
I'm using their PHP SDK from http://paypal.github.io/#adaptive-payments-tab-php-5-3
So the question, does anyone have any suggestion as to how I can find out what exactly is going wrong or other things I can try to fix it?
I had this problem in the sandbox environment because I was not including an application ID. I used APP-80W284485P519543T which one of examples indicated as the Sandbox Application ID, and then it worked.
Mobile Payments Library Developer Guide and Reference
–
Android OS
Edition
Oct 2016
5
Preface
**Important:
The Mobile Payments Library is based on the PayPal Adaptive Payments API.
As of October 6, 2016, Adaptive Payments is now a limited releas
e product. It is restricted to
select partners for approved use cases and should not be used for new integrations without guidance from PayPal**
=============================================
first implement method
private void initLibrary() {
PayPal pp = PayPal.getInstance();
if(pp == null) {
pp = PayPal.initWithAppID(this, PAYPAL_APP_ID, PayPal.ENV_SANDBOX);
pp.setLanguage("en_US"); // Sets the language for the library.
pp.setFeesPayer(PayPal.FEEPAYER_EACHRECEIVER);
// pp.setShippingEnabled(true);
pp.setDynamicAmountCalculationEnabled(false);
}
}
**paypal button click event code**
double secondary_payment = 0;
double primary_payment = 0;
PayPalAdvancedPayment advPayment = makeChainedPayment(secondary_payment,primary_payment,"primary_email","secondary_email");
Intent checkoutIntent = PayPal.getInstance().checkout(advPayment, your_current_activity);
startActivityForResult(checkoutIntent, 1);
=============================================
private PayPalAdvancedPayment makeChainedPayment(double priceSecondary, double pricePrimary, String primary_email, String secondary_email) {
PayPalAdvancedPayment payment = new PayPalAdvancedPayment();
payment.setCurrencyType("USD");
// payment.setMerchantName("PushND");
BigDecimal bigDecimalPrimary=new BigDecimal(pricePrimary);
PayPalReceiverDetails receiverPrimary = new PayPalReceiverDetails();
receiverPrimary.setRecipient(primary_email);
//receiverPrimary.setRecipient("adaptive_receiver_1#pushnd.com");
receiverPrimary.setSubtotal(bigDecimalPrimary);
receiverPrimary.setIsPrimary(true);
payment.getReceivers().add(receiverPrimary);
PayPalReceiverDetails receiverSecondary= new PayPalReceiverDetails();
receiverSecondary.setRecipient(secondary_email);
BigDecimal bigDecimalSecond=new BigDecimal(priceSecondary);
receiverSecondary.setSubtotal(bigDecimalSecond);
payment.getReceivers().add(receiverSecondary);
return payment;
}

Paypal IPN listener issue

I currently have a problem with my Paypal IPN listener and have been receiving the following email from paypal each day:
"Please check your server that handles PayPal Instant Payment Notifications (IPN). IPNs sent to the following URL(s) are failing:
http://www.mysales.ie/create_promo_listener.php"
I have a demo site which enables users to create ads and works perfectly (no problems with IPN), however the proper site that I am developing has this issue (It is on a different host).
I have contacted the host provider and they have said it is not an issue on their side. I have tried php error logs but cant find any issues. I have the exact same code on both sites so I cant understand what the problem is.
<?php include 'ipn_handler.class.php';
/**
* Logs IPN messages to a file.
*/
class Logging_Ipn_Handler extends IPN_Handler
{
public function process(array $post_data)
{
$data = parent::process($post_data);
if($data === FALSE)
{
header('HTTP/1.0 400 Bad Request', true, 400);
exit;
}
$random_number = $_POST['custom'];
file_put_contents( 'logs/listenerTest.txt', "listener = " . $random_number, FILE_APPEND);
header("location:create_promo_creator.php?random_number=" . $random_number);
}
}
date_default_timezone_set('Europe/Oslo');
$handler = new Logging_Ipn_Handler();
$handler->process($_POST);
I have been trying to find the root of the problem for a long time but cant figure it out.
Seems that your $data = parent::process($post_data);
method is returning FALSE.
Do you have any logging instrumentation in your code to verify this?
The easy workaround is to return a 200 response to keep PayPal's IPN system happy, and to log the error for further review.