Difference between revisions of "ManageCreditCard"

From Gvp-public
Jump to navigation Jump to search
 
(8 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
## If user has an active token in GVP_USERS_SIA_CARDS: returns SiaRegisterParams with oldtoken and generates signature for '''modToken''' SIA request.
 
## If user has an active token in GVP_USERS_SIA_CARDS: returns SiaRegisterParams with oldtoken and generates signature for '''modToken''' SIA request.
 
## Else, returns SiaRegisterParams without oldtoken and generates signature for '''authorise''' SIA request.
 
## Else, returns SiaRegisterParams without oldtoken and generates signature for '''authorise''' SIA request.
 +
# If user has a pending micropayment, returns error (statusCode = 271, statusMessage = WaitingForPendingMicropayment). User will be able to try again when pending micropayment is resumed.
  
 
This method only can be used by logged user.
 
This method only can be used by logged user.
Line 23: Line 24:
 
|ParamType=String
 
|ParamType=String
 
|ParamRequired=required
 
|ParamRequired=required
|ParamDescription= It is the URL to redirect end user browser at the end of a successful credit card registration/replacement. It will be used together with clientUrlKo to generate URLOK in this way: Params.URLOK = [BLOCK1]?clientUrlOK=[BLOCK2]&clientUrlK=[BLOCK3] where:
+
|ParamDescription= It is the URL to redirect end user browser at the end of a successful credit card registration/replacement. <br/>
BLOCK1 = SERVICE_PARAMS > SIA_URL_OK. Example: http://sianotification.mca.tid.es/api/creditcard/confirm
+
:It will be used together with clientUrlKo to generate URLOK in this way: Params.URLOK = [BLOCK1]?clientUrlOK=[BLOCK2]&clientUrlKO=[BLOCK3] where:<br/>
BLOCK2 =  ''escaped'' clientUrlOk input parameter value. Example: http%3A%2F%2Fvivoplay.mca.tid.es%2FCreditCardOk
+
::BLOCK1 is gvp.sia.api endpoint offering CreditCardController Confirm service which processes SIA successful transactions. This endpoint is configured by operator at instance parameter SIA_URL_OK. Example: http://sianotification.mca.tid.es/api/creditcard/confirm<br/>
BLOCK3 = ''escaped'' clientUrlKo input parameter value . Example: http%3A%2F%2Fvivoplay.mca.tid.es%2FCreditCardFailed
+
::BLOCK2 is URL to redirect end user browser at the end of a successful credit card registration/replacement. This URL is sent by PCClient to gvp.api as input parameter clientUrlOk to manageCreditCard service. Example: http://vivoplay.mca.tid.es/CreditCardOk<br/>
resulting URLOK with these examples:  http://sianotification.mca.tid.es/api/creditcard/confirm?clientUrlOK= http%3A%2F%2Fvivoplay.mca.tid.es%2FCreditCardOk&clientUrlKO= http%3A%2F%2Fvivoplay.mca.tid.es%2FCreditCardFailed
+
::BLOCK3 is URL to redirect end user browser at the end of a credit card registration/replacement which seems to be OK at SIA side but fails at GVP (e.g. because signature validation fails). This URL is sent by PCClient to gvp.api as input parameter clientUrlKo to manageCreditCard service. Example: http://vivoplay.mca.tid.es/CreditCardFailed
 
}}
 
}}
 
{{Api_Parameter|
 
{{Api_Parameter|
Line 33: Line 34:
 
|ParamType=String
 
|ParamType=String
 
|ParamRequired=required
 
|ParamRequired=required
|ParamDescription=It will be used to generate the real URLKO in this way: URLOK = Instance parameter SIA_URL_KO + clientUrlKo
+
|ParamDescription=It is the URL to redirect end user browser at the end of a failed credit card registration/replacement. <br/>
 +
:It will be used to generate URLKO in this way: Params.URLKO = [BLOCK1]?clientUrlKO=[BLOCK2] where:<br/>
 +
::BLOCK1  is gvp.sia.api endpoint offering CreditCardController Refuse service which processes SIA successful transactions. This endpoint is configured by operator at instance parameter SIA_URL_OK. Example: http://sianotification.mca.tid.es/api/creditcard/refuse<br/>
 +
::BLOCK2  is URL to redirect end user browser at the end of a failed credit card registration. This URL is sent by PCClient to gvp.api as input parameter clientUrlKo to manageCreditCard service. Example: http://vivoplay.mca.tid.es/CreditCardFailed
 
}}
 
}}
  
Line 45: Line 49:
 
{
 
{
 
   "formUrl": "http://216.177.213.245:6980/servlet/ServletDirector",
 
   "formUrl": "http://216.177.213.245:6980/servlet/ServletDirector",
   "params": {
+
   "Params": {
 
     "IDVERSION": "0001",
 
     "IDVERSION": "0001",
 
     "IDENTIDAD": "TVID",
 
     "IDENTIDAD": "TVID",
Line 62: Line 66:
 
     "SUSTKNSUSCRIP":"",
 
     "SUSTKNSUSCRIP":"",
 
     "BJATKNANT":"",
 
     "BJATKNANT":"",
     "URLOK": "http://sia.notifications-ottcert.labs.gvp.telefonica.com/confirm?ok&urlPC=http://go.tv.movistar.es/creditCard/ok",
+
     "URLOK": "http://sianotification.mca.tid.es/api/creditcard/confirm?clientUrlOK= http://vivoplay.mca.tid.es/CreditCardOk&clientUrlKO=http://vivoplay.mca.tid.es/CreditCardFailed",
     "URLKO": "http://sia.notifications-ottcert.labs.gvp.telefonica.com/confirm?error&urlPC=http://go.tv.movistar.es/creditCard/error",
+
     "URLKO": "http://sianotification.mca.tid.es/api/creditcard/refuse?clientUrlKO=http://vivoplay.mca.tid.es/CreditCardFailed",
 
     "sNombreEvento": "1200",
 
     "sNombreEvento": "1200",
 
     "sIdWindow": "Interface"
 
     "sIdWindow": "Interface"
Line 73: Line 77:
 
|Exceptions=
 
|Exceptions=
 
* [[AuthenticationRequiredException]]
 
* [[AuthenticationRequiredException]]
* ...
+
* [[WaitingForPendingMicropayment]]
  
  
Line 95: Line 99:
 
! 1.1
 
! 1.1
 
{{!}} New input parameters and new SiaRegisterParams object definition
 
{{!}} New input parameters and new SiaRegisterParams object definition
 +
{{!}}
 +
{{!}}- valign="top"
 +
! 1.2
 +
{{!}} updated definition for Params.URLOK and Params.URLKO
 
{{!}}  
 
{{!}}  
 
{{!}}}
 
{{!}}}

Latest revision as of 10:05, 14 April 2016

Description

Triggers the process of registering a credit card in external system SIA.
When UNIAPI receives this request:

  1. Creates new transaction in GVP_SIA_MICROPAYMENTS (status 0: Pending).
  2. Returns SIA data, micropayment data and signature.
    1.  If user has an active token in GVP_USERS_SIA_CARDS: returns SiaRegisterParams with oldtoken and generates signature for modToken SIA request.
    2.  Else, returns SiaRegisterParams without oldtoken and generates signature for authorise SIA request.
  3. If user has a pending micropayment, returns error (statusCode = 271, statusMessage = WaitingForPendingMicropayment). User will be able to try again when pending micropayment is resumed.

This method only can be used by logged user.

Parameters

  • token (String, required)
A valid token for identifying the API session context and logged user.
  • clientUrlOk (String, required)
It is the URL to redirect end user browser at the end of a successful credit card registration/replacement.
It will be used together with clientUrlKo to generate URLOK in this way: Params.URLOK = [BLOCK1]?clientUrlOK=[BLOCK2]&clientUrlKO=[BLOCK3] where:
BLOCK1 is gvp.sia.api endpoint offering CreditCardController Confirm service which processes SIA successful transactions. This endpoint is configured by operator at instance parameter SIA_URL_OK. Example: http://sianotification.mca.tid.es/api/creditcard/confirm
BLOCK2 is URL to redirect end user browser at the end of a successful credit card registration/replacement. This URL is sent by PCClient to gvp.api as input parameter clientUrlOk to manageCreditCard service. Example: http://vivoplay.mca.tid.es/CreditCardOk
BLOCK3 is URL to redirect end user browser at the end of a credit card registration/replacement which seems to be OK at SIA side but fails at GVP (e.g. because signature validation fails). This URL is sent by PCClient to gvp.api as input parameter clientUrlKo to manageCreditCard service. Example: http://vivoplay.mca.tid.es/CreditCardFailed
  • clientUrlKo (String, required)
It is the URL to redirect end user browser at the end of a failed credit card registration/replacement.
It will be used to generate URLKO in this way: Params.URLKO = [BLOCK1]?clientUrlKO=[BLOCK2] where:
BLOCK1 is gvp.sia.api endpoint offering CreditCardController Refuse service which processes SIA successful transactions. This endpoint is configured by operator at instance parameter SIA_URL_OK. Example: http://sianotification.mca.tid.es/api/creditcard/refuse
BLOCK2 is URL to redirect end user browser at the end of a failed credit card registration. This URL is sent by PCClient to gvp.api as input parameter clientUrlKo to manageCreditCard service. Example: http://vivoplay.mca.tid.es/CreditCardFailed


Returns

Returns a JSON object containing a SiaRegisterParams object which represents the list of parameters that must be sent to SIA to call registration card form.

Example:
Example for authorise method (it doesn't require the modtoken params).

{

 "formUrl": "http://216.177.213.245:6980/servlet/ServletDirector",
 "Params": {
   "IDVERSION": "0001",
   "IDENTIDAD": "TVID",
   "IDCOMERCIO": "055720353",
   "IDUSUARIO": "12313",
   "IDTM": "1200",
   "OPCTTOKEN": "01",
   "IDPEDIDO": "MIC1231313",
   "IMPTRANS": "50",
   "CODMON": "978",
   "TIMETRANS": "2016-01-13T01:55:11.515 Etc/UTC",
   "IPORIGEN": "195.235.092.025",
   "FIRMTOKEN": "MkdqtXsJHXZ1ZbWM2N8xVwNGvHMTAcuvFEOTYxtjCkL9i9wSkMeoj5tP2TsRNvVi7GMSTZFifIYGRtkgDAXFiQfypIPVL5ExjBD71Dbm6qRKCJaT3wg+ZG3M3x85k0kcg0o8w/4MreKGXC2QJZSs3WpScftMC3wJFEDlnGPXBmS55HWaMlYDE8iF75wFsdDGrZpju2TlsmCCospM4sB2izv2iSYTU6atqjOnW0X1FAwc7lBfzR1BJY4Uiqt20P+5E6vYv04H+BIUcW8OvT1pnYbp1dCo+wRajO4gk9ZuDGfnb8Yhv231EzH9P7aar2V+UUrripFw93jlXTyR9ll+AA==",
   "TOKEN":"", 
   "DESTOKEN": "Default",
   "SUSTKNSUSCRIP":"",
   "BJATKNANT":"",
   "URLOK": "http://sianotification.mca.tid.es/api/creditcard/confirm?clientUrlOK= http://vivoplay.mca.tid.es/CreditCardOk&clientUrlKO=http://vivoplay.mca.tid.es/CreditCardFailed",
   "URLKO": "http://sianotification.mca.tid.es/api/creditcard/refuse?clientUrlKO=http://vivoplay.mca.tid.es/CreditCardFailed",
   "sNombreEvento": "1200",
   "sIdWindow": "Interface"
 }

}


Exceptions


Caching

This method is not cached.


Known issues

None


Version history

API Version Number Change description Changes author
1.0 Initial method design
1.1 New input parameters and new SiaRegisterParams object definition
1.2 updated definition for Params.URLOK and Params.URLKO


See also

SIGNATURE GENERATION FOR MANAGE CREDIT CARD OPERATIONS (authorise and modToken)

The signature generation for any operation must be performed in two steps:

  1. To create a char string containing only the values of the fields to be sent in the request for the operation and with the same order. Only fields values must be taken in account, without any separator and without field names. The data to be concatenated must be encoded as a UTF-8 string. Keep in mind that it should have the same character encoding as input to the algorithm for calculating the signature and to validate it.
  2. Once the string is created the firm is generated calling the corresponding C# method using the keystore that contains the public key.

For authorise operation: Previous table shows the list of fields to be used to create a string in the generation of the TokenSignature to register the first credit card and AUTHORISE a micropayment in SIA, taking only the rows which has a N in Only for modtoken column and Y in used for RSA calculation. Check that for example, URLOK and URLKO are not used for the signature.

Take into account that table rows ordering must be kept.

Example of a string to be signed: 0001TVID05572035312313120001MIC1231313509782015-12-09T14:19:28.373 Etc/UTC195.235.092.025Default

For modToken operation: As in previous situation, in order to calculate the signature, the table must be taken into account, considering all the rows which has an Y for used for RSA calculation column (so taking all the N/Y rows in Only for modtoken column). Table rows ordering must be kept to concatenate the values and then proceed with the RSA algorithm.