Table des matières
Partner Interface and Cart Import
Local Shop
Description
The cart import interface allows a partner to prepare a purchase on the shop from a third-party site through simple URLs. The shop cart will be loaded with a predefined order that can then be carried through to its resolution.
The partner identity is recorded in the session and the partner transaction identification will be integrated into the invoice information. (The partner indication is optional. The cart import interface works outside the partner concept).
The autodrive function of this interface allows driving the order process as far as possible to minimise the order fulfilment steps. Automatic routing to the order summary (immediately before payment) is possible if:
- The products do not need external parameters to be entered by the buyer (fully pre-configured products)
- The products do not need a beneficiaries configuration (purchase for own account) and the customer is pre-authenticated). If the buyer customer is not pre-authenticated, automatic routing can only go as far as the contact details entry.
Partner identification
The shop accepts a particular request attribute to receive a partner identity. This partner identity will be stored in the invoice data metadata. The partner identifier is produced by registering the partner in the shop backoffice by the shop administrator, and must be an alphanumeric code of 16 characters maximum.
Partner transaction certification
The partner identity will be evaluated up to the first '_' found in the partner attribute. Partners who wish to certify and guarantee the integrity of their identity are advised to generate an additional unique code verifiable by them (a cryptoken) that will be stored in the partner field. The shop must then be able to provide a complete and verifiable listing of the entries coming from the partner. This code must be unique and its generation method MUST NOT be known to the shop. The partner may also store the generated codes for reconciliation with the content of the shop.
Possible buyer identification, pre-authentication
A buyer can be identified on the basis of their email. Email ⇒ unique buyer is a possible match if the email address is present in the LMS database. Identification does not however amount to authentication. However, in the context of an arrival “countersigned” by a valid partner key, identification may be enough for authentication by a trusted third party (the partner). For this to work, transactions will have to be made under the HTTPS protocol, to guarantee the integrity of the partner key. In this scenario, and if the partner key counts as delegated SSO authentication, it must be verifiable by the shop. It must therefore be registered in the backoffice by the shop to be verifiable when submitted in a shopping cart Url. The integrity check adds a “referer” check.
Prerequisites for forging import urls
Forging cart import URLs assumes:
- Knowing the shop id.
- Knowing the “shortname” of the products.
To forge URLs as a partner:
- Having a partner ID provided by the shop.
General form of the Url
<moodlewwwroot>/local/shop/front/view.php?id=<shopid>&what=import
&<shortname1>=<q1>&<shortname2>=<q2>...
[&partner=<partnercode>][&autodrive=1]
Example
This URL call will preload into the cart the product “MyProduct” with a quantity of 2 items of the product.
Partner Code
The Partner Code:
- Identifies the partner
- Identifies the partner transaction
- Provides possible identification data of the buyer
Its general form is:
<partnerkey>[_<partnertag>[_<useremail>]]
- partnerkey: A partner key delivered by the shop
- partnertag: a unique transaction key generated by the partner in the import urls
- useremail: the buyer's email address, if known, for example, in an offer presentation made in logged-in mode on the partner site.
Autodrive
The Autodrive function will ask the shop to progress automatically as far as possible in the purchase process. The progression stops when information must be explicitly requested from the buyer. Without Autodrive, the URL leads to the product presentation with a pre-filled cart.
Back to the technical guide summary - Back to the component summary
