gpt4 book ai didi

php - 如何停止使用自适应支付对我的 Paypal 账户进行身份验证?

转载 作者:太空宇宙 更新时间:2023-11-03 16:12:08 24 4
gpt4 key购买 nike

通过 Pay 方法使用自适应支付我设法让脚本工作,用户可以通过 php 将钱从我的帐户存入他们的帐户,但我必须输入我的密码,即使它使用我的 api 凭据。我怎样才能阻止它每次都询问我的密码?这是我的代码:

<?php

require_once '../../../lib/AdaptivePayments.php';
require_once 'web_constants.php';

session_start();

try {


$serverName = $_SERVER['SERVER_NAME'];
$serverPort = $_SERVER['SERVER_PORT'];
$url=dirname('http://'.$serverName.':'.$serverPort.$_SERVER['REQUEST_URI']);

$returnURL = $url."/PaymentDetails.php";
$cancelURL = $url. "/SetPay.php" ;
$currencyCode="USD"; //$_REQUEST['currencyCode'];
$email="qwom_1315508825_biz@btinternet.com";
$preapprovalKey = '';
$requested='';
$receiverEmail='';
$amount='';
$count= count($_POST['receiveremail']);


//pay details//
$payRequest = new PayRequest();
$payRequest->actionType = "PAY";
$payRequest->currencyCode = "USD";

$receiver1 = new receiver();
$receiver1->email = "cam_1315509411_per@btinternet.com";
$receiver1->amount = "5.00";
$payRequest->receiverList = new ReceiverList();
$payRequest->receiverList = array($receiver1);

$payRequest->returnUrl = $returnURL;
$payRequest->senderEmail = "qwom_1315508825_biz@btinternet.com";
$payRequest->feesPayer = "SENDER";
$payRequest->cancelUrl = $cancelURL;

$payRequest->requestEnvelope = new RequestEnvelope();
$payRequest->requestEnvelope->errorLanguage = "en_US";
$payRequest->requestEnvelope->detailLevel = "ReturnAll";
//end pay details//



$ap = new AdaptivePayments();
$response=$ap->Pay($payRequest);

if(strtoupper($ap->isSuccess) == 'FAILURE')
{
$_SESSION['FAULTMSG']=$ap->getLastError();
$location = "APIError.php";
header("Location: $location");

}
else
{
$_SESSION['payKey'] = $response->payKey;
if($response->paymentExecStatus == "COMPLETED")
{
$location = "PaymentDetails.php";
header("Location: $location");
}
else
{
/*$token = $response->payKey;
$payPalURL = PAYPAL_REDIRECT_URL.'_ap-payment&paykey='.$token;
header("Location: ".$payPalURL);*/
echo $response->paymentExecStatus;
}
}
}
catch(Exception $ex) {

$fault = new FaultMessage();
$errorData = new ErrorData();
$errorData->errorId = $ex->getFile() ;
$errorData->message = $ex->getMessage();
$fault->error = $errorData;
$_SESSION['FAULTMSG']=$fault;
$location = "APIError.php";
header("Location: $location");
}

?>

它使用 Adaptive Payments Soap API。凭据在包含的文件中。

最佳答案

这是预期的功能。由于您使用的是 Pay 方法,它自然会假定这是正常交易而不是“存款”。

您需要查看 PayPal MassPay API。
参见 https://www.x.com/developers/paypal/products/mass-pay以及https://www.x.com/developers/paypal/documentation-tools/api/masspay-api-nvp对于 NVP API 文档。

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_code 上还有一些示例代码(php sample here)

关于php - 如何停止使用自适应支付对我的 Paypal 账户进行身份验证?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7548198/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com