{"id":3392,"date":"2021-03-08T22:07:34","date_gmt":"2021-03-08T22:07:34","guid":{"rendered":"https:\/\/documents.openpay.mx\/?p=3392"},"modified":"2022-02-18T15:05:26","modified_gmt":"2022-02-18T15:05:26","slug":"three-d-secure","status":"publish","type":"post","link":"https:\/\/documents-mx-dev.opdevhm.com\/en\/docs\/three-d-secure.html","title":{"rendered":"3d Secure"},"content":{"rendered":"
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

Below is the flow of how a charge is made using the 3d Secure process:<\/p>

Below are the fields of the POST form, which must comply with current web standards like url-encoding, headers with user-agent, content-lenght, etc. to ensure maximum compatibility with current browsers.<\/p>

<\/center>

The steps to integrate the flow:<\/p>

  1. Create secure 3D transactions. - You must create in Openpay a transaction indicating that you want to use 3D Secure. See: Charge with token<\/a>.<\/li>
  2. Authentication url sent. - The response from step 1 will be the URL to which the client should be re-directed to perform the 3D Secure process.<\/li>
  3. Re-direction to Authentication URL. - Once the trade has the authentication URL, you must redirect the client to the same.<\/li>
  4. Autenticaci\u00f3n 3D Secure. \u2013 The client performs the authentication process with the issuing bank of the card.<\/li>
  5. Authentication Response. \u2013 The issuing bank sends Openpay the result of client authentication.<\/li>
  6. Re-direction to response URL. - Openpay uses the trade-defined URL in step 1 to redirect the client, at this URL the transaction ID is sent as a parameter.<\/li>
  7. Response page generation. \u2013 The customer's browser asks the merchant for the response page (accepted or rejected)<\/li>
  8. Transaction Confirmation. \u2013 Trading via the ID obtains transaction status and generates the customer response page (Accepted or Rejected). See: Get a position with ID<\/a><\/li><\/ol>

    Create 3D Secure Transaction with Token<\/h2>

    To use this service you must have a Token, which can be obtained in the following ways:<\/p>

    1. Pre-charge token. \u2013 If an attempt was made to collect the card following the guide of Card Charges<\/a> and the result was a error code 3005 (Rejection by risk)<\/a>, you can use the same token created for 3D Secure.<\/li>
    2. Creation of new Token. - If a previous token is not available, the token creation service<\/a> to create one.<\/li><\/ol>

      Once you have a token this should use the source_id property.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t

      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Property<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Type<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Description<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      method<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      String (Required) <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      It must contain the card value to indicate that the charge will be made from a card.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      source_id<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      String (Required, legth = 45) <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      ID of the saved card or token id created from where the funds will be withdrawn.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      amount<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Numeric (Required) <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Amount of charge. Must be an amount greater than zero, with up to two decimal digits.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      currency<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      String (Optional)<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Type of currency of charge. At the moment only two types of currencies are supported: Mexican Pesos (MXN) and American Dollars (USD).<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      description<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      String (Required, legth = 250)<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      A description associated with the position.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      order_id<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      String (Optional, legth = 100)<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Unique identifier of the position. Must be unique among all transactions.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      customer<\/a><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t

      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Objeto (Optional) <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      Information of the client to whom the charge is made. See object Customer<\/a>.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t

      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      payment_plan<\/a><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t

      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Objeto (Optional) <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      Data of the months of interest-free plan that you want to use in the position. See object PaymentPlan<\/a>.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t

      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      metadata<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      List(key, value) (Optional) <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Listing of custom antifraud fields, these fields must adhere to the rules for creating custom antifraud fields.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      use_3d_secure<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Boolean (Required)<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      This parameter must be specified in true handle 3D Secure.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      redirect_url <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      String (Optional) <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      Indicates the URL to which to redirect after the 3D Secure authentication result.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t\t
      \n\t\t\t
      \n\t\t\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\tExample of request:\n
      \n
      {<\/span>\n  \"method\"<\/span>:<\/span> \"card\"<\/span>,<\/span>\n  \"amount\"<\/span>:<\/span> 6000.00<\/span>,<\/span>\n  \"description\"<\/span>:<\/span> \" Cargo 3D Secure \"<\/span>,<\/span>\n  \"order_id\"<\/span>:<\/span> \"000000004\"<\/span>,<\/span>\n  \"source_id\"<\/span>:<\/span> \"token1\"<\/span>,<\/span>\n  \"redirect_url\"<\/span>:<\/span>\"http:\/\/www.openpay.mx\/index.html\"<\/span>,<\/span>\n  \"use_3d_secure\"<\/span>:<\/span> \"true\"<\/span>\n}<\/span><\/code><\/pre>\n<\/figure>\n

      Sending Authentication URLs<\/h2>\nThe response to the charge creation request will be a JSON with the transaction information to be paid by the user. Particular attention should be paid to the following parameters:\n\nId<\/strong>. \u2013 Unique ID of the transaction created must be stored since it will be through this ID that the response is sent once the user performs the 3D Secure authentication.\n\npayment_method.url<\/strong>. \u2013 URL where the user should be redirected to start the process.\n
      \n
      {<\/span>\n  \"id\"<\/span>:<\/span> \"treqwygvw0hrjuvwbsf5\"<\/span>,<\/span>\n  \"authorization\"<\/span>:<\/span> \"treqwygvw0hrjuvwbsf5\"<\/span>,<\/span>\n  \"operation_type\"<\/span>:<\/span> \"in\"<\/span>,<\/span>\n  \"method\"<\/span>:<\/span> \"card\"<\/span>,<\/span>\n  \"transaction_type\"<\/span>:<\/span> \"charge\"<\/span>,<\/span>\n  \"card\"<\/span>:<\/span> {<\/span>\n  \"type\"<\/span>:<\/span> \"credit\"<\/span>,<\/span>\n  \"brand\"<\/span>:<\/span> \"mastercard\"<\/span>,<\/span>\n  \"address\"<\/span>:<\/span> null<\/span><\/strong>,<\/span>\n  \"card_number\"<\/span>:<\/span> \"549138XXXXXX5100\"<\/span>,<\/span>\n  \"holder_name\"<\/span>:<\/span> \"Heber Lazcano\"<\/span>,<\/span>\n  \"expiration_year\"<\/span>:<\/span> \"20\"<\/span>,<\/span>\n  \"expiration_month\"<\/span>:<\/span> \"12\"<\/span>,<\/span>\n  \"allows_charges\"<\/span>:<\/span> true<\/span><\/strong>,<\/span>\n  \"allows_payouts\"<\/span>:<\/span> false<\/span><\/strong>,<\/span>\n  \"bank_name\"<\/span>:<\/span> \"Banamex\"<\/span>,<\/span>\n  \"bank_code\"<\/span>:<\/span> \"002\"<\/span>\n},<\/span>\n  \"status\"<\/span>:<\/span> \"charge_pending\"<\/span>,<\/span>\n  \"conciliated\"<\/span>:<\/span> true<\/span><\/strong>,<\/span>\n  \"creation_date\"<\/span>:<\/span> \"2017-03-17T20:52:47-06:00\"<\/span>,<\/span>\n  \"operation_date\"<\/span>:<\/span> \"2017-03-17T20:52:51-06:00\"<\/span>,<\/span>\n  \"description\"<\/span>:<\/span> \"Cargo 3D Secure\"<\/span>,<\/span>\n  \"error_message\"<\/span>:<\/span> null<\/span><\/strong>,<\/span>\n  \"order_id\"<\/span>:<\/span> \"000000004\"<\/span>,<\/span>\n  \"amount\"<\/span>:<\/span> 6<\/span>,<\/span>\n  \"payment_method\"<\/span>:<\/span> {<\/span>\n  \"type\"<\/span>:<\/span> \"redirect\"<\/span>,<\/span>\n  \"url\"<\/span>:<\/span> \"https:\/\/api.openpay.mx\/v1\/mbgaszoxwqews3geshez\/charges\/treqwygvw0hrjuvwbsf5\/redirect\/\"<\/span>\n},<\/span>\n\"currency\"<\/span>:<\/span> \"MXN\"<\/span> }<\/span><\/code><\/pre>\n<\/figure>\n

      Redirect to Response URL<\/h2>\nUna vez completa la autenticaci\u00f3n del usuario en el sistema 3D Secure y recibida la respuesta en Openpay, se re-direccionar\u00e1 al usuario a la URL definida en el paso 1 (redirect_url) usando el ID de la transacci\u00f3n que se envi\u00f3 en el paso 2.\n\nEjemplo:\n\nhttp:\/\/www.openpay.mx\/index.html?id=treqwygvw0hrjuvwbsf5\n\n
      Notes:<\/strong><\/em><\/span>\n