harregoces / moodle-enrol_mercadopago

Enrollment plugin with Mercado Pago
https://buendata.com
GNU General Public License v3.0
24 stars 13 forks source link

Blank ipn.php, no redirect on successful (test) payment #10

Closed akater closed 7 months ago

akater commented 7 months ago

I installed the plugin, set cfg variables for sandbox testing, made a test payment (test public key, test api token) and followed the “Volver al sitio” link on MercadoPago to

$CFG->wwwroot/enrol/mercadopago/ipn.php?instanceid=43&userid=73&courseid=7&status=success&collection_id=1321249281&collection_status=approved&payment_id=1321249281&status=approved&external_reference=7-73-43&payment_type=credit_card&merchant_order_id=15915383523&preference_id=1625814060-bc3d2903-d2c3-4cc4-9382-9733acf74213&site_id=MLU&processing_mode=aggregator&merchant_account_id=null

All the required fields seem to be in place. Nevertheless, I got a blank page, the db table enrol_mercadopago was not updated, and I was not redirected to the course.

Another weird issue: the test payment price was $199.5 even though I specified $5 everywhere.

What could be wrong?

akater commented 7 months ago

The issue was, the transaction currency did not match the course currency. Moodle sends the error report via email; I didn't notice it right away.