Traitement du règlement
Les services de traitement des paiements sont des services entrants qui sont fournis par le composant HCL Commerce Payments. Le premier est le service d'interrogation de l'entité de paiement, qui sert à interroger le statut des crédits, des paiements et des instructions de paiement. Le second est le service de traitement des actions de paiement, qui sert à traiter les actions de paiement suivantes :
- Approuver (autoriser) un paiement
- Approuver et verser (capturer) un paiement
- Vérifier une instruction de paiement
- Clore une instruction de paiement
- Créer un crédit
- Créer un paiement
- Créer une instruction de paiement
- Supprimer une instruction de paiement
- Verser un paiement
- Editer un crédit
- Editer un paiement
- Editer une instruction de paiement
- Inverser un paiement approuvé
- Inverser un crédit
- Inverser un paiement versé
- Valider une instruction de paiement
Les demandes adressées au service d'interrogation de l'entité de paiement prennent la forme de documents BOD (business object documents) GetPaymentEntity.
Les réponses du service d'interrogation de l'entité de paiement ont la forme de documents BOD ShowPaymentEntity ou de défauts SOAP (SOAPFaults) en cas d'émission d'exceptions.
Les demandes adressées au service de traitement des actions de paiement prennent la forme de documents BOD ProcessPaymentAction.
Les réponses du service de traitement des actions de paiement ont la forme de documents BOD AcknowledgePaymentAction ou de défauts SOAP (SOAPFaults) en cas d'émission d'exceptions.
Mappage
Le service d'interrogation de l'entité de paiement est mappé à la commande PaymentEntityGet. Le tableau suivant décrit comment le BOD GetPaymentEntity sera mappé aux paramètres d'entrée de cette commande :
| XPath | Description | Paramètre d'entrée | Obligatoire |
|---|---|---|---|
| DataArea/PaymentEntity/PaymentContext | Cet élément décrit le contexte de paiement. | ||
| DataArea/PaymentEntity/PaymentContext/ChannelId | L'ID de canal. | channelId | y |
| DataArea/PaymentEntity/PaymentContext/Locale | L'environnement local. | locale | y |
| DataArea/PaymentEntity/PaymentContext/PaymentConfigurationGroupId | L'ID du groupe de configuration de paiement. | paymentConfigurationGroupId | y |
| DataArea/PaymentEntity/PaymentContext/StoreId | L'ID du magasin HCL Commerce. | storeId | y |
| DataArea/PaymentEntity/Credit/Id | L'ID de crédit. | creditId | n |
| DataArea/PaymentEntity/Payment/Id | L'ID de paiement. | paymentId | n |
| DataArea/PaymentEntity/PaymentInstruction/Id | L'ID d'instruction de paiement. | paymentInstructionId | n |
Le service de traitement des actions de paiement est mappé à la commande PaymentActionProcess. Le tableau suivant décrit comment le BOD ProcessPaymentAction sera mappé aux paramètres d'entrée de cette commande :
| XPath | Paramètre d'entrée | Obligatoire | Description |
|---|---|---|---|
| DataArea/PaymentAction/PaymentContext | Cet élément décrit le contexte de paiement. | ||
| DataArea/PaymentAction/PaymentContext/ChannelId | channelId | y | L'ID de canal. |
| DataArea/PaymentAction/PaymentContext/Locale | locale | y | L'environnement local. |
| DataArea/PaymentAction/PaymentContext/PaymentConfigurationGroupId | paymentConfigurationGroupId | y | L'ID du groupe de configuration de paiement. |
| DataArea/PaymentAction/PaymentContext/StoreId | storeId | y | L'ID du magasin HCL Commerce. |
| DataArea/PaymentAction/Action | action | o | L'action de paiement. Les choix possibles sont les suivants : createPaymentInstruction
|
| DataArea/PaymentAction/Amount | amount | n | Le montant à approuver et/ou à verser pour un paiement ou à créditer pour un crédit. |
| DataArea/PaymentAction/ReasonCode | reasonCode | n | Le code raison (pour editPayment/editCredit) |
| DataArea/PaymentAction/ReferenceNumber | referenceNumber | n | Le numéro de référence (pour editPayment/editCredit) |
| DataArea/PaymentAction/ResponseCode | responseCode | n | Le code de réponse (pour editPayment/editCredit) |
| DataArea/PaymentAction/ExtendedData | Les données étendues (pour editPayment/editCredit) | ||
| DataArea/PaymentAction/ExtendedData/NameValuePair[i] | n | La i-th paire nom-valeur dans les données étendues. |
|
| DataArea/PaymentAction/ExtendedData/NameValuePair[i]/Name | extendedDataName_i | n | Le nom de la i-th paire nom-valeur. |
| DataArea/PaymentAction/ExtendedData/NameValuePair[i]/Value | extendedDataValue_i | n | La valeur de la i-th paire nom-valeur. |
| DataArea/PaymentAction/PaymentEntity/Credit | Cet élément décrit le crédit (pour createCredit/editCredit/credit). | ||
| DataArea/PaymentAction/PaymentEntity/Credit/Id | creditId | n | L'ID de crédit. |
| DataArea/PaymentAction/PaymentEntity/Credit/State | état | n | L'état du crédit. |
| DataArea/PaymentAction/PaymentEntity/Credit/PaymentInstruction/Id | paymentInstructionId | n | L'ID d'instruction de paiement. |
| DataArea/PaymentAction/PaymentEntity/Payment | Cet élément décrit le paiement (pour createPayment/editPayment/approve/approveAndDeposit). | ||
| DataArea/PaymentAction/PaymentEntity/Payment/Id | paymentId | n | L'ID de paiement. |
| DataArea/PaymentAction/PaymentEntity/Payment/State | état | n | L'état du paiement. |
| DataArea/PaymentAction/PaymentEntity/Payment/PaymentInstruction/Id | paymentInstructionId | n | L'ID d'instruction de paiement. |
| DataArea/PaymentAction/PaymentEntity/PaymentInstruction | Cet élément décrit l'instruction de paiement (pour createPaymentInstruction, etc.). Remarque : Une seule instruction de paiement est acceptable pour chaque action liée à PaymentInstruction. |
||
| DataArea/PaymentAction/PaymentEntity/PaymentInstruction/Id | paymentInstructionId | n | L'ID d'instruction de paiement. |
| DataArea/PaymentAction/PaymentEntity/PaymentInstruction/Amount | amount | n | Le montant de l'instruction de paiement. |
| DataArea/PaymentAction/PaymentEntity/PaymentInstruction/ | monétaire | n | La devise de l'instruction de paiement. |
| DataArea/PaymentAction/PaymentEntity/PaymentInstruction/OrderId | ordered | n | L'ID de commande de l'instruction de paiement. |
| DataArea/PaymentAction/PaymentEntity/PaymentInstruction/PaymentSystemName | paymentSystemName | n | Le nom du système de paiement de l'instruction de paiement. |
| DataArea/PaymentAction/PaymentEntity/PaymentInstruction/ExtendedData | Les données étendues de l'instruction de paiement. | ||
| DataArea/PaymentAction/PaymentEntity/PaymentInstruction/ExtendedData/NameValuePair[i] | La i-th paire nom-valeur dans les données étendues de l'instruction de paiement. |
||
| DataArea/PaymentAction/PaymentEntity/PaymentInstruction/ExtendedData/NameValuePair[i]/Name | extendedDataName_i | n | Le nom de la i-th paire nom-valeur. |
| DataArea/PaymentAction/PaymentEntity/PaymentInstruction/ExtendedData/NameValuePair[i]/Value | extendedDataValue_i | n | La valeur de la i-th paire nom-valeur. |
Exemple
Voici un exemple de demande envoyée au service de traitement des actions de paiement et la réponse correspondante :
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>er>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>wcsadmin</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wssusername-token-profile-1.0#PasswordText">*********</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<wc:ProcessPaymentAction
releaseID="9.0" version="9.1"
versionID="9.1"
xmlns:oa="http://www.openapplications.org/oagis/9"
xmlns:wc="http://www.ibm.com/xmlns/prod/WebSphereCommerce"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ibm.com/xmlns/prod/WebSphereCommerce
../BODs/ProcessPaymentAction.xsd
">
<oa:ApplicationArea>
<oa:CreationDateTime>2001-12-31T12:00:00</oa:CreationDateTime>
<oa:BODID>2001-12-31T12:00:00[wcsadmin]localhost</oa:BODID>
</oa:ApplicationArea>
<wc:DataArea>
<oa:Process/>
<wc:PaymentAction>
<wc:PaymentContext>
<wc:ChannelId>-1</wc:ChannelId>
<wc:Locale>en_US</wc:Locale>
<wc:PaymentConfigurationGroupId>default</wc:PaymentConfigurationGroupId>
<wc:StoreId>10001</wc:StoreId>
</wc:PaymentContext>
<wc:Action>createPaymentInstruction</wc:Action>
<wc:PaymentEntity>
<wc:PaymentInstruction>
<wc:Amount>100.0</wc:Amount>
<wc:Currency>USD</wc:Currency>
<wc:PaymentSystemName>SimpleOffline</wc:PaymentSystemName>
<wc:ExtendedData>
<wc:NameValuePair>
<wc:Name>payment_method</wc:Name>
<wc:Value>VISA</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>cc_brand</wc:Name>
<wc:Value>VISA</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>account</wc:Name>
<wc:Value>4111111111111111</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>expire_month</wc:Name>
<wc:Value>01</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>expire_year</wc:Name>
<wc:Value>2010</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>account</wc:Name>
<wc:Value>4111111111111111</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>billto_address1</wc:Name>
<wc:Value>123 Main
Street</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>billto_city</wc:Name>
<wc:Value>Toronto</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>billto_stateprovince</wc:Name>
<wc:Value>ON</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>billto_country</wc:Name>
<wc:Value>CA</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>billto_zipcode</wc:Name>
<wc:Value>M1M1M1</wc:Value>
</wc:NameValuePair>
</wc:ExtendedData>
</wc:PaymentInstruction>
</wc:PaymentEntity>
</wc:PaymentAction>
</wc:DataArea>
</wc:ProcessPaymentAction>
</soapenv:Body>
</soapenv:Envelope>
Voici un exemple de demande envoyée au service d'interrogation de l'entité de paiement et la réponse correspondante :
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>t;
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>wcsadmin</wsse:Username>t;
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wssusername-token-profile-1.0#PasswordText">wcs1admin</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>t;
<wc:GetPaymentEntity releaseID="9.0" version="9.1"
versionID="9.1"
xmlns:oa="http://www.openapplications.org/oagis/9"
xmlns:wc="http://www.ibm.com/xmlns/prod/WebSphereCommerce"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ibm.com/xmlns/prod/WebSphereCommerce
../BODs/GetPaymentEntity.xsd ">
<oa:ApplicationArea>
<oa:CreationDateTime>2001-12-31T12:00:00</oa:CreationDateTime>
<oa:BODID>2001-12-31T12:00:00[wcsadmin]localhost</oa:BODID>
</oa:ApplicationArea>
<wc:DataArea>
<oa:Get>
<oa:Expression/>
</oa:Get>
<wc:PaymentEntity>
<wc:PaymentContext>
<wc:ChannelId>-1</wc:ChannelId>
<wc:Locale>en_US</wc:Locale>
<wc:PaymentConfigurationGroupId>default</wc:PaymentConfigurationGroupId>
<wc:StoreId>10001</wc:StoreId>
</wc:PaymentContext>
<wc:PaymentInstruction>
<wc:Id>14001</wc:Id>
</wc:PaymentInstruction>
</wc:PaymentEntity>
</wc:DataArea>
</wc:GetPaymentEntity>
</soapenv:Body>
</soapenv:Envelope>
Réponse :
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<wc:ShowPaymentEntity releaseID="9.0" versionID="9.1"
xmlns:oa="http://www.openapplications.org/oagis/9"
xmlns:wc="http://www.ibm.com/xmlns/prod/WebSphereCommerce">
<oa:ApplicationArea>
<oa:CreationDateTime>2006-01-03T12:55:37</oa:CreationDateTime>
<oa:BODID>2006-01-03T12:55:37[wcsadmin]</oa:BODID>
</oa:ApplicationArea>t;
<wc:DataArea>
<oa:Show/>
<wc:PaymentEntity>
<wc:PaymentInstruction>
<wc:Id>14001</wc:Id>
<wc:AccountNumber>***********11111</wc:AccountNumber>
<wc:Amount>100.00000</wc:Amount>
<wc:ApprovedAmount>0.00000</wc:ApprovedAmount>
<wc:ApprovingAmount>0.00000</wc:ApprovingAmount>
<wc:CreditedAmount>0.00000</wc:CreditedAmount>
<wc:CreditingAmount>0.00000</wc:CreditingAmount>
<wc:Currency>USD</wc:Currency>
<wc:DepositedAmount>0.00000</wc:DepositedAmount>
<wc:DepositingAmount>0.00000</wc:DepositingAmount>
<wc:OrderId/>
<wc:PaymentConfigurationId>default</wc:PaymentConfigurationId>
<wc:PaymentSystemName>SimpleOffline</wc:PaymentSystemName>
<wc:Retriable>false</wc:Retriable>
<wc:ReversingApprovedAmount>0.00000</wc:ReversingApprovedAmount>
<wc:ReversingCreditedAmount>0.00000</wc:ReversingCreditedAmount>
<wc:ReversingDepositedAmount>0.00000</wc:ReversingDepositedAmount>
<wc:RmaId/>
<wc:State>1</wc:State>
<wc:StoreId>10001</wc:StoreId>
<wc:TimeCreated>2006-01-03T12:51:55</wc:TimeCreated>
<wc:TimeUpdated>2006-01-03T12:51:56</wc:TimeUpdated>
<wc:ExtendedData>
<wc:NameValuePair>
<wc:Name>billto_country</wc:Name>
<wc:Value>CA</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>billto_stateprovince</wc:Name>
<wc:Value>ON</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>billto_address1</wc:Name>
<wc:Value>123 Main
Street</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>expire_year</wc:Name>
<wc:Value>2010</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>account</wc:Name>
<wc:Value>***********11111</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>billto_city</wc:Name>
<wc:Value>Toronto</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>billto_zipcode</wc:Name>
<wc:Value>M1M1M1</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>expire_month</wc:Name>
<wc:Value>01</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>cc_brand</wc:Name>
<wc:Value>VISA</wc:Value>
</wc:NameValuePair>
<wc:NameValuePair>
<wc:Name>payment_method</wc:Name>
<wc:Value>VISA</wc:Value>
</wc:NameValuePair>
</wc:ExtendedData>
</wc:PaymentInstruction>
</wc:PaymentEntity>
</wc:DataArea>
</wc:ShowPaymentEntity>
</soapenv:Body>
</soapenv:Envelope>
WSDL
Le fichier WSDL de ce service se trouve dans le fichier JAR suivant :
- workspace_dir/WebSphereCommerceWebServices.jar
Sous le chemin suivant :
META-INF/jaxrpc/WebSphereCommerce/WebSphereCommerce-OMS.wsdl