Skip to content

Instantly share code, notes, and snippets.

@leofischer
Last active April 25, 2018 22:20
Show Gist options
  • Save leofischer/0199e8b68e19a67da3c09145c5f3bf8e to your computer and use it in GitHub Desktop.
Save leofischer/0199e8b68e19a67da3c09145c5f3bf8e to your computer and use it in GitHub Desktop.
Failed Payment Sandbox

#Already paid failure Notification

Order: ord_2iTrT2LV5iV1K9pgy Charge: 5adfdb12edbb6e2570bb5c90

curl -H "Accept: application/vnd.conekta-v2.0.0+json" \
       -H "Content-type: application/json" \
       -u PRIVATE_KEY: \
-X POST -k -d '{
  "currency": "MXN",
  "customer_info": {
    "name": "prueba de orden",
    "email": "[email protected]",
    "phone": "+1-202-555-0156",
    "corporate": true
  },
  "line_items": [{
    "name": "Box of Cohiba S1s",
    "unit_price": 1600,
    "quantity": 1
  }],
  "charges": [{
    "payment_method": {
      "type": "spei"
    }
  }]
}' https://api.conekta.io/orders


 curl -H "Accept: application/vnd.conekta-v2.0.0+json" \
     -H "Content-type: application/json" \
     -u PRIVATE_KEY: \
     -X POST -d '{
  "event_type": "charge.payment_attempt.failed",
  "failure_code": "charge_is_already_paid"
}' https://api.conekta.io/orders/ord_2iTrT2LV5iV1K9pgy/charges/5adfdb12edbb6e2570bb5c90/test

#Expired

Order: ord_2iTrYzdnnDdqu6UVc Charge: 5adfdce7ffecf96a58c62755

curl -H "Accept: application/vnd.conekta-v2.0.0+json" \
       -H "Content-type: application/json" \
       -u PRIVATE_KEY: \
-X POST -k -d '{
  "currency": "MXN",
  "customer_info": {
    "name": "prueba de orden",
    "email": "[email protected]",
    "phone": "+1-202-555-0156",
    "corporate": true
  },
  "line_items": [{
    "name": "Box of Cohiba S1s",
    "unit_price": 1600,
    "quantity": 1
  }],
  "charges": [{
    "payment_method": {
      "type": "spei"
    }
  }]
}' https://api.conekta.io/orders


 curl -H "Accept: application/vnd.conekta-v2.0.0+json" \
     -H "Content-type: application/json" \
     -u PRIVATE_KEY: \
     -X POST -d '{
  "event_type": "charge.payment_attempt.failed",
  "failure_code": "charge_is_expired"
}' https://api.conekta.io/orders/ord_2iTrYzdnnDdqu6UVc/charges/5adfdce7ffecf96a58c62755/test

#Canceled

Order: ord_2iTrazYRXX1hYBSWX Charge: 5adfdd84ffecf96a6ac627ba

curl -H "Accept: application/vnd.conekta-v2.0.0+json" \
       -H "Content-type: application/json" \
       -u PRIVATE_KEY: \
-X POST -k -d '{
  "currency": "MXN",
  "customer_info": {
    "name": "prueba de orden",
    "email": "[email protected]",
    "phone": "+1-202-555-0156",
    "corporate": true
  },
  "line_items": [{
    "name": "Box of Cohiba S1s",
    "unit_price": 1600,
    "quantity": 1
  }],
  "charges": [{
    "payment_method": {
      "type": "spei"
    }
  }]
}' https://api.conekta.io/orders


 curl -H "Accept: application/vnd.conekta-v2.0.0+json" \
     -H "Content-type: application/json" \
     -u PRIVATE_KEY: \
     -X POST -d '{
  "event_type": "charge.payment_attempt.failed",
  "failure_code": "charge_is_canceled"
}' https://api.conekta.io/orders/ord_2iTrazYRXX1hYBSWX/charges/5adfdd84ffecf96a6ac627ba/test

#Invalid Amount

Order: ord_2iTrdXQReBtC9WM7Y Charge: 5adfde4bedbb6e256dbb5df9

curl -H "Accept: application/vnd.conekta-v2.0.0+json" \
       -H "Content-type: application/json" \
       -u PRIVATE_KEY: \
-X POST -k -d '{
  "currency": "MXN",
  "customer_info": {
    "name": "prueba de orden",
    "email": "[email protected]",
    "phone": "+1-202-555-0156",
    "corporate": true
  },
  "line_items": [{
    "name": "Box of Cohiba S1s",
    "unit_price": 1600,
    "quantity": 1
  }],
  "charges": [{
    "payment_method": {
      "type": "spei"
    }
  }]
}' https://api.conekta.io/orders


 curl -H "Accept: application/vnd.conekta-v2.0.0+json" \
     -H "Content-type: application/json" \
     -u PRIVATE_KEY: \
     -X POST -d '{
  "event_type": "charge.payment_attempt.failed",
  "failure_code": "invalid_amount",
  "amount": "323"
}' https://api.conekta.io/orders/ord_2iTrdXQReBtC9WM7Y/charges/5adfde4bedbb6e256dbb5df9/test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment