当我尝试创建一个Paypal支付每次我得到这个错误"Failed to connect to api.sandbox.paypal.com端口443:Connection refused"
$payer = new Payer();
$payer->setPaymentMethod('paypal');
$itemSignup = new Item();
$itemSignup->setName('Test');
$itemSignup->setCurrency('EUR');
$itemSignup->setQuantity(1);
$itemSignup->setPrice(self::SIGNUP_PRICE);
$itemList =new ItemList();
$itemList->setItems([$itemSignup]);
$amount = new Amount();
$amount->setCurrency('EUR');
$amount->setTotal(self::SIGNUP_PRICE);
$transaction = new Transaction();
$transaction->setAmount($amount);
$transaction->setItemList($itemList);
$transaction->setDescription('Test');
$redirectUrls = new RedirectUrls();
$redirectUrls->setReturnUrl('http://localhost/test/');
$redirectUrls->setCancelUrl('http://localhost/test/');
$payment = new Payment();
$payment->setIntent('Sale');
$payment->setPayer($payer);
$payment->setRedirectUrls($redirectUrls);
$payment->setTransactions(array($transaction));
try {
$payment->create($this->_apiContext);
} catch(Exception $e){
dd($e->getMessage());
要创建支付,url应该是:
https://api.sandbox.paypal.com/v1/payments/payment
问题出在防火墙