SSO in cart
Use the getSingleSignOnInCart method. 2Checkout attaches a unique token to links, designed to identify the returning shoppers and support the automatic extraction of payment data and billing information from the 2Checkout system. For example, you can generate single sign on in cart links for existing customers logged into your website based on their external or 2Checkout customer IDs.
Request parameters
sessionID
Required (string)
Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. The sessionID expires in 10 minutes.
Customer
Required (string)
Unique customer identifiers. Can be either the ExternalCustomerReference you control or the system-generated AvangateCustomerReference.
customerType
Required (string) Possible values:
ExternalCustomerReferenceAvangateCustomerReference
url
Required (string) The shopping cart URL. 2Checkout redirects shoppers to this URL. Possible values: Any buy link you generate from the cPanel or using the API. Note: For the time being, payment tokenization does not support Express Payments Checkout or the 2Checkout mobile shopping cart.
validityTime
Optional (int) The time, in seconds, before the single sign-on URL expires. By default, the URL expires after 10 seconds. (optional)
validationIp
Optional (string) The IP address of the shopper, necessary for security purposes. Can be an empty string or a valid IP, or null.
Request sample
<?php
require ('PATH_TO_AUTH');
$idCustomer = '352365983';
$customerType = 'AvangateCustomerReference';
$url = 'https://store.avancart.com/order/checkout.php?PRODS=4639321&QTY=1&CART=1&CARD=2';
$validityTime = 50;
$validationIp = null;
try {
$ssoLINK = $client->getSingleSignOnInCart($sessionID, $idCustomer, $customerType, $url, $validityTime, $validationIp);
}
catch (SoapFault $e) {
echo "ssoLINK: " . $e->getMessage();
exit;
}
var_dump("ssoLINK", $ssoLINK);Response parameters
Single sign-on URL
String The generated string is the tokenized time-limited single sign-on URL pointing to 2Checkout shopping cart.
If shoppers add multiple products to cart via SSO buy links and then use a non-SSO link, they’ll purchase all items using the same order. When you use single sign on in cart for customers without card on files in the 2Checkout system, the generated tokenized link prefills the billing information but the purchase process requires that shoppers provide payment information, such as a credit or debit card. Example: https://store.YourCustomDomain.com/order/checkout.php?PRODS=1112233&logintoken=8b74ac97f8277654563c44da6915b054ba0d21be
You can use the value of the logintoken to retrieve customer information by SSO token.
Last updated
Was this helpful?