# Tarjeta de Crédito

Cómo utilizar tarjeta de crédito para realizar un payin en Brasil.

# Post

https://gateway-test.transfersmile.com/trade/pay

# Payin con tarjeta de crédito

Este endpoint te permite usar tarjeta de crédito para realizar un payin en Brasil.

# Parameters

Content-Type* string application/json; chartset=UTF-8
Authorization* string Basic Base($app_id:$security_key)

# Body

app_id* string Id de app creado en dashboard
- Max. 32 chars -
timestamp* string yyyy-MM-dd HH:mm:ss
- Max. 19 chars -
out_trade_no* string ID dado por el merchant en su sistema
- Max. 64 chars -
method* string Valor fijo: CreditCard
order_currency* string Valor fijo: BRL
order_amount* string Monto de pago
- 0.5~50000 BRL -
subject* string Razón de pago o título
- Max. 128 chars -
content* string Detalle de razón de pago o título. Se mostrará en el recibo del banco.
- Max. 255 chars -
notify_url* string Donde transfersmile enviará la notificación
return_url string Redirigir a la URL del merchant cuando usuario haya terminado el pago
buyer_id* string Usuario id de merchant
user_ip* string Dirección IP de usuario
token* string usa transfersmile Javascript para obtener token
fingerprint* string usa transfersmile Javascript para obtener fingerprint
issuer* string Emisor de tarjeta de crédito
installments string Cuotas por tarjetadecredito
customer.name* string Nombre de usuario
customer.phone* string Teléfono de usuario
customer.email* string Correo de usuario
customer.identify.number* string Número de identificación de usuario;
- 11 digitos por CPF o 14 digitos para CNPJ -
customer.identify.type* string Tipo de identificación de usuario;
- CPF or CNPJ -
address.zip_code* string zip code
address.state string provincia
- Requerido si no hay zip_code -
address.city string ciudad
- Requerido si no hay zip_code -
address.street_number string Número de calle
- Requerido si no hay zip_code -
address.street string calle
- Requerido si no hay zip_code -
website_url string URL de website de merchant
- Max. 128 chars -
<!-- threeds.sli* string Security level indicator
threeds.version* string Version used in the transaction
threeds.caav* string Authentication Value (CAVV / AAV for 3DS1) recieved from authorization/Authentication response
threeds.eci* string ECI value recieved from authorization/authentication response
threeds.server_trans_id* string Universally unique transaction identifier assigned by the 3DS Server to identify a single transaction generated by the Init 3DS API and used to link the init call to the order call
threeds.xid* string A unique Visa or Amex transaction id
threeds.cvv string CVV result
threeds.avs string Procesor response code for AVS. Only required in cases where all AVS results (zipcode, street address, and name when available) arrive as one string
threeds.status string 3DSecure - Status text received from 3D secure vendor
threeds.status_code* string 3DSecure - Status code recieved from authorization/authentication response, (Possible values: U, N, Y, A, C, D, R, I)
threeds.status_reason_code string String EMVCO Indicator of the reason for the 3DS status code provided during the authentication, (Possible values: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16)
threeds.liability_shift string liability shift - indicate whether the chargeback liability shifted to the card issuer

# Responses

200 submit exitoso
{
    "code": "10000",
    "msg": "Success",
    "trade_no": "2022010110293900084",
    "out_trade_no": "202201010354003",
    "web_url": "",
    "trade_status": "PROCESSING"
}
400 duplicar out_trade_no
{
    "code": "40002",
    "msg": "Business Failed",
    "sub_code": "duplicate-out_trade_no",
    "sub_msg": "out_trade_no is duplicate"
}

# Ejemplo

curl --location --request POST 'https://gateway-test.transfersmile.com/trade/pay' \
--header 'Authorization: Basic MTYyNTgyOTIxNDUzMTY2Mzg6UGFnc21pbGVfc2tfZDUwMWQ1ZGNkNTI5OGQ5N2MwNmUzYjI4YjA2OWZjZmY3NDU5ZjY2NzNiMjFjMTFlYTY3NDM5MDgzOTZkOTYxNQ==' \
--header 'Content-Type: application/json' \
--data-raw '{
    * "app_id": "162************38",
    * "out_trade_no": "202201010354003",
    * "method": "CreditCard",
    * "order_amount": "12.01",
    * "order_currency": "BRL",
    * "subject": "trade pay test",
    * "content": "trade pay test conent",
    * "notify_url": "http://merchant/callback/success",
      "return_url": "https://www.merchant.com",
    * "buyer_id": "buyer_0101_0001",
    * "user_ip":"127.0.0.1",
    * "token":"${token}",
    * "fingerprint":"${fingerprint}",
    * "issuer":"visa",
      "installments":"1",
    * "timestamp": "2022-01-01 03:54:01",
      "timeout_express":"1c",
    * "customer" : {
    *     "identify": {
    *         "type": "CPF",
    *         "number": "50284414727"
          },
    *     "name": "Test User Name",
    *     "email": "[email protected]",
    *     "phone": "75991435892"
      },
    * "address" : {
    *     "zip_code": "38082365"
      },
    * "threeds": {
    *     "sli": "",
    *     "version": "",
    *     "cavv": "",
    *     "eci": "",
    *     "server_trans_id": "",
    *     "xid": "",
          "cvv": "",
          "avs": "",
          "status": "",
    *     "status_code": "",
          "status_reason_code": "",
          "liability_shift": true
      }
      }'

TIP

Nota: 162********38 es el test ID de transfersmile para prueba en sandbox, y MTYyNTgyOTIxNDUzMTY2Mzg6UGFnc21pbGVfc2tfZDUwMWQ1ZGNkNTI5OGQ5N2MwNmUzYjI4YjA2OWZjZmY3NDU5ZjY2NzNiMjFjMTFlYTY3NDM5MDgzOTZkOTYxNQ== es el token de autorización asociado con el app ID de prueba.

WARNING

Favor utilizar tu propio app_id y genera tu propio authorization token al realizar pruebas.