我收到错误Error Code:PE101
docs这样说;
传入“sid”参数没有值/无效值。
好吧,我正在使用Omnipay for 2Checkout似乎要求AccountNumber
- 而不是sid
。
查看help他们似乎暗示sid
与帐号相同;
sid - 您的2Checkout帐号。 (最多64个字符)
那是哪个?如何设置sid没有setSid()
方法!
目前,我的代码是;
$gateway = Omnipay::create('TwoCheckout');
$gateway->setAccountNumber($accountId);
$gateway->setSecretWord($secretWord);
$response = $gateway->purchase(array(
'returnUrl' => $returnUrl . '?' . http_build_query($arguments),
'cancelUrl' => $cancelUrl,
'amount' => $payment->getAmount(),
'description' => $description,
'transactionId' => $paymentId
))->send();
$result = $response->getRedirectData();
print_r的结果($ response-> getData());
abort: (a)
always: ()
complete: ()
done: ()
error: ()
fail: ()
getAllResponseHeaders: ()
getResponseHeader: (a)
overrideMimeType: (a)
pipe: ()
progress: ()
promise: (a)
readyState: 4
responseText: "Array↵(↵ [sid] => 901294374↵ [cart_order_id] => fmXkqNGlOshGspuxYXhL37eyLikXziuw↵ [merchant_order_id] => fmXkqNGlOshGspuxYXhL37eyLikXziuw↵ [total] => 61.00↵ [tco_currency] => ↵ [fixed] => Y↵ [skip_landing] => 1↵ [x_receipt_link_url] => https://checkout.example.dev/ecommerce/payment/complete?paymentId=fmXkqNGlOshGspuxYXhL37eyLikXziuw&pending=1&twocheckout=1↵)↵{"paymentId":"fmXkqNGlOshGspuxYXhL37eyLikXziuw","url":"\/ecommerce\/checkout\/postredirect?softwareVersion=7.66\u0026checkoutUrl=https%3A%2F%2Fwww.2checkout.com%2Fcheckout%2Fpurchase\u0026paymentId=fmXkqNGlOshGspuxYXhL37eyLikXziuw"}"
setRequestHeader: (a,b)
state: ()
status: 200
statusCode: (a)
statusText: "OK"
success: ()
then: ()
__proto__: Object
答案 0 :(得分:0)
抱歉将此作为回答',我还无法发表评论。
Omnipay-2checkout已经将accountNumber参数传递给2checkout作为' sid' (见here)。尝试在您的请求中调用getData
,以确切了解传递给他们的内容:
$gateway = Omnipay::create('TwoCheckout');
$gateway->setAccountNumber($accountId);
$gateway->setSecretWord($secretWord);
$response = $gateway->purchase(array(
'returnUrl' => $returnUrl . '?' . http_build_query($arguments),
'cancelUrl' => $cancelUrl,
'amount' => $payment->getAmount(),
'description' => $description,
'transactionId' => $paymentId
));
var_dump($response->getData());
还值得检查您使用的是correct帐号。