Realizar pagos (Sandbox)

Desde conekta ofrecemos una manera de simular pagos en modo sandbox, simplemente ingresando el monto y la referencia.
Necesitarás tu llave privada de pruebas. Si aún no cuentas con ella, puedes obtenerla en tu panel Conekta.

curl --request POST \
     --url 'https://api.stg.conekta.io/sandbox/spei/payment_notifications' \
     --header 'Accept-Language: en' \
     --header 'accept: application/vnd.conekta-v2.1.0+json' \
     --header 'Authorization: Bearer key_xxxxxxxxxxxxxx' \
     --header 'content-type: application/json' \
     --data '
      {
        "amount": "4200",
        "reference": "734180000008337741"
      }'
using System.Collections.Generic;
using System.Diagnostics;
using Conekta.net.Api;
using Conekta.net.Client;
using Conekta.net.Model;

namespace Example
{
    public class CreateCustomerExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.AccessToken = "key_xxxxxxx";

            var apiInstance = new CustomersApi(config);
            var paymentSources = new List<CustomerPaymentMethodsRequest>()
            {
                new CustomerPaymentMethodsRequest(
                    new PaymentMethodSpeiRequest("spei_recurrent")
                )
            };
            var customer = new(
                name: "test dot",
                phone: "+573143159063",
                email: "[email protected]",
                paymentSources: paymentSources,
            );
            try
            {
                // Create customer
                CustomerResponse result = apiInstance.CreateCustomer(customer);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomersApi.CreateCustomer: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
try{
    $customer = \Conekta\Customer::create(
      array(
          'name'  => "fulanito",
          'email' => "[email protected]",
          'phone' => "+5218181818181",
          'payment_sources' => array(
                array(
                'type' => "spei_recurrent"
                )
            )
      )
    );
    var_dump(json_encode($customer));
  } catch (\Conekta\ProcessingError $error){
    echo $error->getMessage();
  } catch (\Conekta\ParameterValidationError $error){
    echo $error->getMessage();
  } catch (\Conekta\Handler $error){
    echo $error->getMessage();
  }

#Respuesta de API
{
   "livemode":false,
   "name":"Fulanito",
   "email":"[email protected]",
   "phone":"+5215555555555",
   "id":"cus_2nNW3ZFwnaeicFygP",
   "object":"customer",
   "created_at":1587510139,
   "corporate":false,
   "custom_reference":"",
   "payment_sources":{
      "object":"list",
      "has_more":false,
      "total":1,
      "data":[{
         "id":"off_ref_2nZpKdaweaacDUz6W",
         "object":"payment_source",
         "type":"spei_recurrent",
         "reference":"646180111812345678",
         "created_at":1587510139,
         "parent_id":"cus_2nNW3ZFwnaeicFygP"
      }]
   }
}
# N/A
# N/A
# N/A
# N/A
# N/A