# PAYMENT SWITCH
### operation_schema
Define en `pg_code` el proveedor de pago
- `pe_pmc`: Mastercard
- `pe_vdp`: Visa
- `pe_vdp_v3`: Visa V3
```json
{
"source_id": "string / alphanum / min 1 / max 26",
"pg_code" : "'pe_pmc' || 'pe_vdp' || 'pe_vdp_v3",
"data" : "obj"
}
```
## PMC
### Autorización
method /POST
```json
{
"marca":"'MC || 'DC'|| 'AE'|| 'BF'|| 'UP'|| 'RP'|| 'T0'|| 'AH'|| 'ME'|| 'BC'",
"comercio": "string",
"referencia":"string / min 5 /max 15 ",
"monto":"number / min 0 / max 999999",
"moneda":"string / PEN || USD",
"diferido":"number / min 0 / max 3",
"cuotas":"string / length 2",
"tipoProceso":"number / PEN || USD",
"autogenerador":"string / alph / min 11 / max 20",
"comercioFacilitador":"string / lenght 7",
"dataEnc":"string",
"firma":"string",
"key":"string"
}
- Response
{
"meta": {
"traceId": "123321",
"timestamp": "2019-08-27T17:46:17.460Z-0500",
"serviceId": "qRstVPpH32qzkW"
},
"data": {
"channel": "pasarela",
"captureType": "manual",
"countable": false,
"order": {
"purchaseNumber": 2,
"amount": "10.5",
"currency": "PEN",
"installment": "02"
},
"card": {
"cardNumber": "4444333322221111",
"expirationMonth": "10",
"expirationYear": "2020",
"cvv": "005"
},
"sponsored": null,
"authentication": null
}
}
```
### Cancel
method /POST
```json
{
"comercio": "number",
"idTxn":"string / lenght 8 ",
"codAutorizacion":" string alphanum / min 6 / max 6",
"numPedido":"string alphanum / min 5 / max 15",
"moneda":"string /'PEN' || 'USD",
"monto":"number / min 0 / max 999999"
}
```
### Deposit
method /POST
```json
{
"comercio": "number",
"idTxn":"string / lenght 8 ",
"codAutorizacion":" string alphanum / min 6 / max 6",
"numPedido":"string alphanum / min 5 / max 15",
"moneda":"string /'PEN' || 'USD",
"monto":"number / min 0 / max 999999"
}
```
### Retrieve
```json
{
"comercio": "number",
"numPedido":"string alphanum / min 5 / max 15"
}
```
## VISA
### Autorización
method /POST
```json
- Request
{
"meta": {
"traceId": "123321",
"timestamp": "2019-09-15T11:13:20.123Z-0500",
"serviceId": "asdasdsad"
},
"data": {
"username": "prueba@mail.com",
"password": "Password@123",
"codTienda": 123456789,
"numOrden": 2,
"mount": "10.5",
"currency": "PEN",
"nombre": "",
"apellido": "",
"direccion": "av canada",
"ciudad": "Lima",
"email": "prueba@mail.com",
"codigoPostal": "001",
"estado": "",
"codPais": "",
"codAsociado": 123456789,
"nombreAsociado": "",
"mcc": 123,
"numCuotas": 00,
}
}
- Response
{
"meta": {
"traceId": "123321",
"timestamp": "2019-08-27T17:46:17.460Z-0500",
"serviceId": "qRstVPpH32qzkW"
},
"data": {
"channel": "pasarela",
"captureType": "manual",
"countable": false,
"order": {
"purchaseNumber": 2,
"amount": "10.5",
"currency": "PEN",
"installment": "02"
},
"card": {
"cardNumber": "4444333322221111",
"expirationMonth": "10",
"expirationYear": "2020",
"cvv": "005"
},
"sponsored": null,
"authentication": null
}
}
```
```json
type date
{
"username": "email",
"password":"string alphanum / lenght 8",
"codTienda": "number / lenght 9",
"numOrden": "number / min 1",
"mount":"number / min 0",
"currency":"string / 'PEN' || 'USD'",
"nombre":"string",
"apellido":"string",
"direccion":"string",
"ciudad":"string",
"email":"email",
"codigoPostal":"string",
"estado":"string",
"codPais":"string",
"codAsociado":"number / lenght 9",
"nombreAsociado":" string",
"mcc":"number",
"numCuotas":"number"
}
```
### Cancel
method /POST
```json
{
"username": "email",
"password":"string alphanum / lenght 8",
"annulationReason":"string",
"merchantId":"number / lenght 9",
"signature":" string / lenght 36"
}
```
### Deposit
method /POST
```json
{
"usuario": "email",
"password":"string alphanum / lenght 8",
"purchaseNumber":"number / min 1",
"amount":"number / min 0",
"authorizedAmount":"number / min 0",
"currency":"string /'PEN'|| 'USD'",
"transactionId":"string / lenght 15",
"merchantId":"number / lenght 9",
"name":"string",
"mcci":"number",
"address":"string",
"phoneNumber":"string"
}
```
### Retrieve
method /POST
```json
{
"usuario": "email",
"password":"string alphanum / lenght 8",
"purchaseNumber":"number / min 1",
"merchantId":"number / lenght 9"
}
```