Reputation: 4152
I'm getting an error Error Code:PE101
The docs say this;
No value/invalid value for the "sid" parameter was passed in.
Well, I am using Omnipay for 2Checkout that seems to be asking for the AccountNumber
- not sid
.
Looking at the help they seem to be implying that sid
is the same as the account number;
sid – Your 2Checkout account number. (64 characters max)
So which is it? How do I set the sid there is no setSid()
method!
At the moment, my code is;
$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();
Result of a 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
Upvotes: 0
Views: 276
Reputation: 1875
Apologies for leaving this as an 'answer', I'm unable to leave comments yet.
Omnipay-2checkout already passes the accountNumber parameter through to to 2checkout as 'sid' (See here). Try calling getData
on your request to see exactly what is being passed through to them:
$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());
It's also worth checking you are using the correct account number.
Upvotes: 0