Skip to main content
Skip table of contents

Display Pay-me Flex Automatic Debit

This is the final step, where you specify the DOM element in which the form should be displayed and define a callback function to be executed once the process is completed. As additional parameters, two extra callback functions can be added (they are not mandatory, but they help obtain more detailed information about the process):

  • responseCallback: Executed when the process is completed (Authorized/Declined).

  • trackingCallback: Executed for each event triggered during the process (e.g., click on pay, click on payment method, click on payment information, etc.).

  • onErrorCallback: Executed when an error occurs during the process.

Use Cases

Display Wallet in the form – Authorization Form

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"
                }
            ]
        }
    }
}

Display Subscription Form with 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"
                }
            ]
        }
    }
}

Display Form to Update Subscription with 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.