Skip to main content
Skip table of contents

Mostrar Pay-me Flex Débito Automático

Este es el paso final, donde indicamos dentro de que elemento del DOM se debe mostrar el formulario y una función callback para ejecutarse al finalizar el proceso. Como parámetros adicionales se pueden agregar dos funciones callback (no son obligatorios, pero sirven para obtener mayor información del proceso):

  • responseCallback: Se ejecuta cuando se tiene un proceso completado (Autorizado/Denegado)

  • trackingCallback: Se ejecuta por cada evento disparado durante el proceso(Ejemplo: clic en pagar, clic en método de pago, clic en información de pago, etc.)

  • onErrorCallback: Se ejecuta cuando hay un error durante el proceso

Casos de uso

Mostrar Wallet en el formulario - Formulario de Autorización

CODE
{
    "action": "authorize",
    "channel": "ecommerce",
    "merchant_code": "b0deb6f3-e51a-48a7-9268-f1441d46f7bd",
    "merchant_operation_number": "976867",
    "payment_details": {
        "amount": "387000",
        "currency": "604",
        "shipping": {
            "first_name": "Mateo",
            "last_name": "Zayas Meza",
            "email": "Mateo_ZayasMeza85@yahoo.com",
            "phone": {
                "country_code": "51",
                "subscriber": "945831902"
            },
            "location": {
                "line_1": "Poblado Concepción 7",
                "line_2": "Puerta 249",
                "city": "LIMA",
                "state": "LIMA",
                "country": "PE",
                "zip_code": "18"
            }
        },
        "billing": {
            "first_name": "Mateo",
            "last_name": "Zayas Meza",
            "email": "Mateo_ZayasMeza85@yahoo.com",
            "phone": {
                "country_code": "51",
                "subscriber": "945831902"
            },
            "location": {
                "line_1": "Poblado Concepción 7",
                "line_2": "Puerta 249",
                "city": "LIMA",
                "state": "LIMA",
                "country": "PE",
                "zip_code": "18"
            }
        },
        "customer": {
            "first_name": "Mateo",
            "last_name": "Zayas Meza",
            "email": "Mateo_ZayasMeza85@yahoo.com",
            "phone": {
                "country_code": "51",
                "subscriber": "945831902"
            },
            "location": {
                "line_1": "Poblado Concepción 7",
                "line_2": "Puerta 249",
                "city": "LIMA",
                "state": "LIMA",
                "country": "PE",
                "zip_code": "18"
            }
        },
        "wallet": {
            "user_id": "72661927"
        }
    }
}

Ejemplo de “response callback”

CODE
{
    "success": "true",
    "action": "authorize",
    "channel": "ecommerce",
    "merchant_code": "b0deb6f3-e51a-48a7-9268-f1441d46f7bd",
    "merchant_operation_number": "2931514",
    "transaction": {
        "transaction_id": "353k2gyeldeo519xr5n47kw6l",
        "state": "AUTORIZADO",
        "state_reason": "Pago exitoso",
        "amount": "15000",
        "currency": "604",
        "additional_fields": null,
        "payment_method": {
            "method_name": "CARD",
            "method_details": {
                "redirect_url": "https://jjap9ekgee.execute-api.us-east-1.amazonaws.com/development/redirect/prueba/merchant_notification_response",
                "callback_url": null,
                "masked_pan": "405142******1115",
                "brand": "VISA",
                "bin": "405142",
                "last_pan": "1115",
                "card_type": null,
                "card_country": null,
                "issuer": null
            }
        },
        "continue_url": null,
        "expiration_date": null,
        "risk_evaluation": null,
        "authentication_result": null,
        "processor_response": {
            "authorization_code": "070100",
            "brand_transaction_id": "305147588314886",
            "result_message": {
                "code": "00",
                "description": "Aprobación exitosa"
            }
        },
        "lifecycle": [
            {
                "state": "REGISTRADO",
                "date": {
                    "utc_time": "2025-05-27T16:20:11",
                    "unix_time": 1748362811.481
                }
            },
            {
                "state": "PENDIENTE",
                "date": {
                    "utc_time": "2025-05-27T16:20:14",
                    "unix_time": 1748362814.377
                }
            },
            {
                "state": "AUTORIZADO",
                "date": {
                    "utc_time": "2025-05-27T16:20:32",
                    "unix_time": 1748362832.297
                }
            }
        ]
    },
    "meta": {
        "status": {
            "code": "00",
            "message_ilgn": [
                {
                    "locale": "es_PE",
                    "value": "Se procesó correctamente la petición"
                }
            ]
        }
    }
}

Mostrar Formulario de afiliación

CODE
{
    "action": "subscribe",
    "merchant_affiliation_code": "122947_RPS_USER",
    "merchant_code": "b0deb6f3-e51a-48a7-9268-f1441d46f7bd",
    "type": "MANUAL",
    "currency": "604",
    "beneficiary": {
        "first_name": "Pilar",
        "last_name": "Ordóñez Tirado",
        "email": "Pilar.OrdonezTirado61@gmail.com",
        "phone": {
            "country_code": "51",
            "subscriber": "965097539"
        },
        "identity_document": {
            "type": "DNI",
            "identifier": "38216803",
            "country": "PE"
        },
        "location": {
            "line_1": "Colonia Victor Manuel 2498",
            "line_2": "Puerta 728",
            "city": "LIMA",
            "state": "LIMA",
            "country": "PE"
        }
    },
    "additional_fields": {
        "FACTURACION_ID": "133445",
        "PLAN": "POST PAGO 250"
    }
}

Ejemplo de “response callback”

CODE
{
    "success": "true",
    "affiliation": {
        "affiliation_id": "5f554b1a-f2a5-4bfc-a7ad-103ae033ebb9",
        "merchant_affiliation_code": "122947_RPS_USER",
        "merchant_code": "b0deb6f3-e51a-48a7-9268-f1441d46f7bd",
        "state": "ACTIVE",
        "type": "MANUAL",
        "frequency": null,
        "amount": null,
        "max_amount": null,
        "currency": "604",
        "beneficiary": {
            "first_name": "Levis",
            "last_name": "Silvestre",
            "email": "levis.silvestre@alignet.com",
            "phone": {
                "country_code": "51",
                "subscriber": "958435685"
            },
            "identity_document": {
                "type": "DNI",
                "identifier": "72661927",
                "country": "PE"
            },
            "location": {
                "line_1": "Av. San Borja Norte 1743",
                "line_2": null,
                "city": "Lima",
                "state": "Lima",
                "country": "PE"
            }
        },
        "additional_fields": {
            "FACTURACION_ID": "133445",
            "PLAN": "POST PAGO 250"
        },
        "card": 
            "brand": "VISA",
            "bin": "411111",
            "last_pan": "1111",
            "issuer_name": "BCP",
            "card_holder_name": "Levis Silvestre"
        }
    },
    "meta": {
        "status": {
            "code": "00",
            "message_ilgn": [
                {
                    "locale": "es_PE",
                    "value": "Se procesó correctamente la petición"
                }
            ]
        }
    }
}

Mostrar Formulario de afiliación con wallet

CODE
{
    "action": "subscribe",
    "merchant_affiliation_code": "023007_RPS_USER",
    "merchant_code": "b0deb6f3-e51a-48a7-9268-f1441d46f7bd",
    "type": "MANUAL",
    "currency": "604",
    "beneficiary": {
        "first_name": "Mónica",
        "last_name": "Duarte Deleón",
        "email": "Monica.DuarteDeleon89@nearbpo.com",
        "phone": {
            "country_code": "51",
            "subscriber": "944169494"
        },
        "identity_document": {
            "type": "DNI",
            "identifier": "41134394",
            "country": "PE"
        },
        "location": {
            "line_1": "Ferrocarril Pilar Quintairos 45",
            "line_2": "Edificio 4",
            "city": "LIMA",
            "state": "LIMA",
            "country": "PE"
        }
    },
    "additional_fields": {
        "FACTURACION_ID": "133445",
        "PLAN": "POST PAGO 250"
    },
    "wallet": {
        "user_id": "72661927"
    }
}

Ejemplo de “response callback”

CODE
{
    "success": "true",
    "affiliation": {
        "affiliation_id": "5f554b1a-f2a5-4bfc-a7ad-103ae033ebb9",
        "merchant_affiliation_code": "023007_RPS_USER",
        "merchant_code": "b0deb6f3-e51a-48a7-9268-f1441d46f7bd",
        "state": "ACTIVE",
        "type": "MANUAL",
        "frequency": null,
        "amount": null,
        "max_amount": null,
        "currency": "604",
        "beneficiary": {
            "first_name": "Levis",
            "last_name": "Silvestre",
            "email": "levis.silvestre@alignet.com",
            "phone": {
                "country_code": "51",
                "subscriber": "958435685"
            },
            "identity_document": {
                "type": "DNI",
                "identifier": "72661927",
                "country": "PE"
            },
            "location": {
                "line_1": "Av. San Borja Norte 1743",
                "line_2": null,
                "city": "Lima",
                "state": "Lima",
                "country": "PE"
            }
        },
        "additional_fields": {
            "FACTURACION_ID": "133445",
            "PLAN": "POST PAGO 250"
        },
        "card": 
            "brand": "VISA",
            "bin": "411111",
            "last_pan": "1111",
            "issuer_name": "BCP",
            "card_holder_name": "Levis Silvestre"
        }
    },
    "meta": {
        "status": {
            "code": "00",
            "message_ilgn": [
                {
                    "locale": "es_PE",
                    "value": "Se procesó correctamente la petición"
                }
            ]
        }
    }
}

Mostrar Formulario para actualizar afiliación

CODE
{
    "action": "update_subscription",
    "merchant_affiliation_code": "10011_LEVIS",
    "merchant_code": "b0deb6f3-e51a-48a7-9268-f1441d46f7bd"
}

Ejemplo de “response callback”

CODE
{
    "success": "true",
    "affiliation": {
        "affiliation_id": "e4b45bdd-9b09-47c5-854f-b7b276fafcd1",
        "merchant_affiliation_code": "10011_LEVIS",
        "merchant_code": "b0deb6f3-e51a-48a7-9268-f1441d46f7bd",
        "state": "ACTIVE",
        "type": "MANUAL",
        "frequency": null,
        "amount": null,
        "max_amount": null,
        "currency": "604",
        "beneficiary": {
            "first_name": "Levis",
            "last_name": "Silvestre",
            "email": "levis.silvestre@alignet.com",
            "phone": {
                "country_code": "51",
                "subscriber": "958435685"
            },
            "identity_document": {
                "type": "DNI",
                "identifier": "72661927",
                "country": "PE"
            },
            "location": {
                "line_1": "Av. San Borja Norte 1743",
                "line_2": null,
                "city": "Lima",
                "state": "Lima",
                "country": "PE"
            }
        },
        "additional_fields": {
            "FACTURACION_ID": "133445",
            "PLAN": "POST PAGO 250"
        },
        "card": {
            "brand": "VISA",
            "bin": "411111",
            "last_pan": "1111",
            "issuer_name": "BCP",
            "card_holder_name": "Lev Sil"
        }
    },
    "meta": {
        "status": {
            "code": "00",
            "message_ilgn": [
                {
                    "locale": "es_PE",
                    "value": "Se procesó correctamente la petición"
                }
            ]
        }
    }
}

Mostrar Formulario para actualizar afiliación con wallet

CODE
{
    "action": "update_subscription",
    "merchant_affiliation_code": "10011_LEVIS",
    "merchant_code": "b0deb6f3-e51a-48a7-9268-f1441d46f7bd",
    "wallet": {
        "user_id": "72661927"
    }
}

Ejemplo de “response callback”

CODE
{
    "success": "true",
    "affiliation": {
        "affiliation_id": "e4b45bdd-9b09-47c5-854f-b7b276fafcd1",
        "merchant_affiliation_code": "10011_LEVIS",
        "merchant_code": "b0deb6f3-e51a-48a7-9268-f1441d46f7bd",
        "state": "ACTIVE",
        "type": "MANUAL",
        "frequency": null,
        "amount": null,
        "max_amount": null,
        "currency": "604",
        "beneficiary": {
            "first_name": "Levis",
            "last_name": "Silvestre",
            "email": "levis.silvestre@alignet.com",
            "phone": {
                "country_code": "51",
                "subscriber": "958435685"
            },
            "identity_document": {
                "type": "DNI",
                "identifier": "72661927",
                "country": "PE"
            },
            "location": {
                "line_1": "Av. San Borja Norte 1743",
                "line_2": null,
                "city": "Lima",
                "state": "Lima",
                "country": "PE"
            }
        },
        "additional_fields": {
            "FACTURACION_ID": "133445",
            "PLAN": "POST PAGO 250"
        },
        "card": {
            "brand": "VISA",
            "bin": "411111",
            "last_pan": "1111",
            "issuer_name": "BCP",
            "card_holder_name": "Lev Sil"
        }
    },
    "meta": {
        "status": {
            "code": "00",
            "message_ilgn": [
                {
                    "locale": "es_PE",
                    "value": "Se procesó correctamente la petición"
                }
            ]
        }
    }
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.