这是我在这个论坛的第一篇文章。我正在尝试使用 WS 开发对 Adyen 的所有付款,而不是我迄今为止使用的皮肤/发布方法。所以,我从他们的示例中下载了这段代码(我还发布了通过 WS 连接的类方法)
function Adyen($login, $password, $host ="live", $debug=FALSE ) {
$this->DEBUG = $debug;
$this->client = new SoapClient( "https://pal-$host.adyen.com/pal/Payment.wsdl",
array(
"login" => $login,
"password" => $password,
'trace' => 1,
'soap_version' => SOAP_1_1,
'style' => SOAP_DOCUMENT,
'encoding' => SOAP_LITERAL
)
);
}
function authorise( $amount,$currencyCode,$cardHolder,$cardNumber,$expm,$expy,$cvc,$reference) {
global $merchantAccount;
$response = $this->client->authorise( array(
"paymentRequest" => array
(
"amount" => array (
"value" => $amount,
"currency" => $currencyCode),
"card" => array (
"cvc" => $cvc,
"expiryMonth" => $expm,
"expiryYear" => $expy,
"holderName" => $cardHolder,
"number" => $cardNumber,
),
"merchantAccount" => $merchantAccount,
"reference" => $reference,
)
)
);
当我执行此代码时,它会返回此错误
#!/usr/bin/php SOAP Error on test SoapFault Object ( [message:protected] => security 010 Not allowed [string:Exception:private] =>
你有什么建议可以解决吗?
此致。
编辑:太奇怪了,因为使用相同的方法,但参数不同(如果是定期付款,我没有这个错误。这个案例运行
$response = $this->client->authorise(
array(
"paymentRequest" =>
array(
"amount" => array("value" => $amount,
"currency" => $currencyCode),
"merchantAccount" => $merchantAccount,
"reference" => $reference,
"shopperReference" => $reference",
"shopperEmail" => $email,
"recurring" => array("contract" => "RECURRING"),
"selectedRecurringDetailReference" => "LATEST",
"shopperInteraction" => "ContAuth"
)
)
);