PHP code example of decidir2 / php-sdk

1. Go to this page and download the library: Download decidir2/php-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

decidir2 / php-sdk example snippets


  
composer 

	
$ambient = "test";//valores posibles: "test" , "prod" o "qa"
$connector = new \Decidir\Connector($keys_data, $ambient);		



$keys_data = array('public_key' => 'e9cdb99fff374b5f91da4480c8dca741',
           'private_key' => '92b71cf711ca41f78362a7134f87ff65');

$ambient = "test";//valores posibles: "test" , "prod" o "qa"
$connector = new \Decidir\Connector($keys_data, $ambient);


$connector = new \Decidir\Connector($keys_data, $ambient);
$response = $connector->healthcheck()->getStatus();
$response->getName();
$response->getVersion();
$response->getBuildTime();

$connector = new \Decidir\Connector($keys_data, $ambient, "", "", "SDK-PHP");
$data = array(
      "card_number" => "4509790112684851",
      "card_expiration_month" => "12",
      "card_expiration_year" => "30", 
      "card_holder_name" => "Barb",
      "card_holder_birthday" => "24071990",
      "card_holder_door_number" => 505,
      "security_code" => "123",
      "card_holder_identification" => array(
          "type" => "dni",
          "number" => "29123456"));
       
$response = $connector->token()->token($data);
$respuesta = new TokenResponse();

$respuesta->setId($response->get('id',null));
$respuesta->setStatus($response->get('status',null));
$respuesta->setCardNumberLength($response->get('card_number_length', null));
$respuesta->setDateCreated($response->get('date_created', null));
$respuesta->setBin($response->get('bin', null));
$respuesta->setLastFourDigits($response->get('last_four_digits', null));
$respuesta->setSecurityCodeLength($response->get('security_code_length', null));
$respuesta->setExpirationMonth($response->get('expiration_month', null));
$respuesta->setExpirationYear($response->get('expiration_year', null));
$respuesta->setDateDue($response->get('date_due', null));
$cardHolder = $response->get('cardholder', null);
$respuesta->setType($cardHolder['identification']['type']);
$respuesta->setNumber($cardHolder['identification']['number']);
$respuesta->setName($cardHolder['name']);

$connector = new \Decidir\Connector($keys_data, $ambient, "", "", "SDK-PHP");
$data = array(
      "card_number" => "4509790112684851",
      "card_expiration_month" => "12",
      "card_expiration_year" => "30", 
      "card_holder_name" => "Barb",
      "card_holder_birthday" => "24071990",
      "card_holder_door_number" => 505,
      "security_code" => "123",
      "card_holder_identification" => array(
        "type" => "dni",
        "number" => "29123456"
      ),
      "fraud_detection"=> array(
          "device_unique_identifier"=> "12345"
      ),
      "ip_address"=> "192.168.100.1");
       
$response = $connector->token()->tokenCs($data);
$respuesta = new TokenResponse();

$respuesta->setId($response->get('id',null));
$respuesta->setStatus($response->get('status',null));
$respuesta->setCardNumberLength($response->get('card_number_length', null));
$respuesta->setDateCreated($response->get('date_created', null));
$respuesta->setBin($response->get('bin', null));
$respuesta->setLastFourDigits($response->get('last_four_digits', null));
$respuesta->setSecurityCodeLength($response->get('security_code_length', null));
$respuesta->setExpirationMonth($response->get('expiration_month', null));
$respuesta->setExpirationYear($response->get('expiration_year', null));
$respuesta->setDateDue($response->get('date_due', null));
$cardHolder = $response->get('cardholder', null);
$respuesta->setType($cardHolder['identification']['type']);
$respuesta->setNumber($cardHolder['identification']['number']);
$respuesta->setName($cardHolder['name']);


$connector = new \Decidir\Connector($keys_data, $ambient);

$data = array(
      "site_transaction_id" => "12042017_20",
      "token" => "be211413-757b-487e-bb0c-283d21c0fb6f",
      "customer" => array(
                        "id" => "customer", 
                        "email" => "[email protected]"
                        "ip_address" => "192.168.100.2"
                        ),
      "payment_method_id" => 1,
      "bin" => "450799",
      "amount" => 500,
      "currency" => "ARS",
      "installments" => 1,
      "description" => "",
      "establishment_name" => "Nombre establecimiento",
      "payment_type" => "single",
      "sub_payments" => array()
    );

try {
	$response = $connector->payment()->ExecutePayment($data);
	$response->getId();
	$response->getToken();
	$response->getUser_id();
	$response->getPayment_method_id();
	$response->getBin();
	$response->getAmount();
	$response->getCurrency();
	$response->getInstallments();
	$response->getPayment_type();
	$response->getDate_due();
	$response->getSub_payments();
	$response->getStatus();
	$response->getStatus_details()->ticket
	$response->getStatus_details()->card_authorization_code
	$response->getStatus_details()->address_validation_code
	$response->getStatus_details()->error
	$response->getDate();
	$response->getEstablishment_name();
	$response->getFraud_detection();
	$response->getAggregate_data();
	$response->getSite_id();
} catch( \Exception $e ) {
	var_dump($e->getData());
}

$connector = new \Decidir\Connector($keys_data, $ambient);

$data = array(
      "site_transaction_id" => "12042017_20",
      "token" => "be211413-757b-487e-bb0c-283d21c0fb6f",
      "customer" => array(
                        "id" => "customer", 
                        "email" => "[email protected]"
                        "ip_address" => "192.168.100.2"
                        ),
      "payment_method_id" => 1,
      "bin" => "450799",
      "amount" => 500,
      "currency" => "ARS",
      "installments" => 1,
      "description" => "",
      "establishment_name" => "Nombre establecimiento",
      "payment_type" => "single",
      "sub_payments" => array(),
      "card_data" => array(
	"card_number" => "4509790112684851",
        "card_expiration_month" => "12",
        "card_expiration_year" => "30", 
        "card_holder_name" => "Barb",
        "security_code" => "123",
        "card_holder_identification" => array(
	        "type" => "dni",
	        "number" => "29123456"
        ),
      ),
      "aggregate_data" => array(
	"name" => ""
      ),
    );

try {
	$response = $connector->payment()->ExecutePayment($data);
	$response->getId();
	$response->getToken();
	$response->getUser_id();
	$response->getPayment_method_id();
	$response->getBin();
	$response->getAmount();
	$response->getCurrency();
	$response->getInstallments();
	$response->getPayment_type();
	$response->getDate_due();
	$response->getSub_payments();
	$response->getStatus();
	$response->getStatus_details()->ticket
	$response->getStatus_details()->card_authorization_code
	$response->getStatus_details()->address_validation_code
	$response->getStatus_details()->error
	$response->getDate();
	$response->getEstablishment_name();
	$response->getFraud_detection();
	$response->getAggregate_data();
	$response->getSite_id();
} catch( \Exception $e ) {
	var_dump($e->getData());
}

$connector = new \Decidir\Connector($keys_data, $ambient, "", "", "SDK-PHP");

$data = array(
    "site_transaction_id" => "tokeniz" . rand(),
    "establishment_name" => "Store",
    "spv" => null,
    "bin" => "4507990",
    "payment_method_id" => 1,
    "amount" => 50000,
    "currency" => "ARS",
    "installments" => 1,
    "description" => "PCI pago tokenizado",
    "payment_type" => "single",
    "sub_payments" => [],
    "fraud_detection" => array(
        "send_to_cs" => false
    ),
    "card_data" => array(
        "card_holder_name" => "Luis Perez",
        "last_four_digits" => "1112",
        "card_holder_birthday" => "01012000",
        "card_holder_door_number" => 666,
        "card_holder_identification" => array(
            "type" => "dni",
            "number" => "41371431"
        ),
        "security_code" => "666",
        "card_expiration_month" => "03",
        "card_expiration_year" => "30"
    ),
    "cardholder_auth_$e ) {
	var_dump($e->getData());
}

$connector = new \Decidir\Connector($keys_data, $ambient, "", "", "SDK-PHP");

$data = array(
    "site_transaction_id" => "{{site_transaction_id}}",
    "token" => "{{token}}",
    "payment_method_id" => 1,
    "bin" => 450799,
    "amount" => 100,
    "currency" => "ARS",
    "installments" => 1,
    "payment_type" => "single",
    "sub_payments" => [],
    "cardholder_auth_h" => 4,
        "time_zone_offset" => 570
    )
);

try {
	$response = $connector->payment()->ExecutePayment($data);
} catch( \Exception $e ) {
	var_dump($e->getData());
}


$data = array(
    "id" => "{{id}}",
    "instruction_value" => "{{instruction_value}}",
);
$connector = new \Decidir\Connector($keys_data, $ambient, "", "", "SDK-PHP");

try{
	$response = $connector->threedsChallenge()->threedsChallenge($data);
} catch( \Exception $e ) {
	var_dump($e->getData());
}

$connector = new \Decidir\Connector($keys_data, $ambient);

$data = array(
      "amount" => 500,
    );

try {
	$response = $connector->payment()->CapturePayment($data);
} catch( \Exception $e ) {
	var_dump($e->getData());
}


$data = array(
  "site_transaction_id" => "230518_41",
  "token" => "92a95793-3321-447c-8795-8aeb8a8ac067",
  "payment_method_id" => 25,
  "amount" => 1000,
  "currency" => "ARS",
  "payment_type" => "single",
  "email" => "[email protected]",
  "invoice_expiration" => "191123",
  "cod_p3" => "12",
  "cod_p4" => "134",
  "client" => "12345678",
  "surcharge" => 10.01,
  "payment_mode" => "offline"
);

$response = $connector->payment()->ExecutePaymentOffline($data);



$data = array(
  "site_transaction_id" => "230518_38",
  "token" => "8e190c82-6a63-467e-8a09-9e8fa2ab6215",
  "payment_method_id" => 26,
  "amount" => 1000,
  "currency" => "ARS",
  "payment_type" => "single",
  "email" => "[email protected]",
  "invoice_expiration" => "191123",
  "cod_p3" => "12",
  "cod_p4" => "134",
  "client" => "12345678",
  "surcharge" => 10.01,
  "payment_mode" => "offline"
);

$response = $connector->payment()->ExecutePaymentOffline($data);



$data = array(
  "site_transaction_id" => "220518_39",
  "token" => "9ae1d130-8c89-4c3b-a267-0e97b88fedd0",
  "payment_method_id" => 41,
  "amount" => 1000,
  "currency" => "ARS",
  "payment_type" => "single",
  "email" => "[email protected]",
  "bank_id" => 1,
  "sub_payments" => 100,
  "invoice_expiration" => "191123"
);

$response = $connector->payment()->ExecutePaymentOffline($data);



$data = array(
  "site_transaction_id" => "160518_42",
  "token" => "3df26771-67ab-4a8e-91e2-f1e0b0c559f7",
  "payment_method_id" => 51,
  "amount" => 1000,
  "currency" => "ARS",
  "payment_type" => "single",
  "email" => "[email protected]",
  "invoice_expiration" => "191123",
  "second_invoice_expiration" => "191123",
  "cod_p3" => "1",
  "cod_p4" => "134",
  "client" => "12345678",
  "surcharge" => 10.01,
  "payment_mode" => "offline"
);

$response = $connector->payment()->ExecutePaymentOffline($data);



$data = array(
  "site_transaction_id" => "160518_42",
  "token" => "3df26771-67ab-4a8e-91e2-f1e0b0c559f7",
  "payment_method_id" => 51,
  "amount" => 1000,
  "currency" => "ARS",
  "payment_type" => "single",
  "email" => "[email protected]",
  "invoice_expiration" => "191123",
  "second_invoice_expiration" => "191123",
  "cod_p3" => "1",
  "cod_p4" => "134",
  "client" => "12345678",
  "surcharge" => 10.01,
  "payment_mode" => "offline"
);

$response = $connector->payment()->ExecutePaymentOffline($data);



//Para este servicio es necesario enviar junto al public y private key el "form_apikey" y "form_site".
$keys_data = array(
              'form_apikey' => '5cde7e72ea1e430db94d4312346a3744 ',
              'form_site' => '00021625'
          );

$connector = new \Decidir\Connector($keys_data, $ambient);

$data = array(
  "site" => array(
        "id" => "03101980", //opcional, si no se tiene Merchant no se envía este atributo
        "transaction_id" => "Swatch op",
        "template" => array(
            "id" => 5 
        ),
  ),
  "customer" => array(
        "id" => "001",
        "email" => "[email protected]",
  ),
  "payment" => array(
        "amount" => 1203,
        "currency" => "ARS",
        "payment_method_id" => 1,
        "bin" => "45979",
        "installments" => 4,
        "payment_type" => "single",
        "sub_payments" => array()
  ),
  "success_url" => "https://shop.swatch.com/es_ar/", //si no se informa el "redirect_url" es requerido
  "cancel_url" => "https://swatch.com/api/result",
  "redirect_url" => "", //si no se informa el "success_url" es requerido
  "fraud_detection" => array() //si no esta activado cybersource no enviar este atributo
);

$response = $connector->payment()->Validate($data);



$response = $connector->payment()->Validate($data);

$response->getHash(); //respuesta: 46711cd8-81f8-4228-96cc-ac3e90c75622"


$connector = new \Decidir\Connector($keys_data, $ambient);

$data = array("pageSize" => 5);
$response = $connector->payment()->PaymentList($data);
$response->getLimit();
$response->getOffset();
$response->getResults();
$response->getHas_more();

$connector = new \Decidir\Connector($keys_data, $ambient);

$data = array();

$response = $connector->payment()->PaymentInfo($data, '574421');
$response->getId();
$response->getSiteTransaction_id();
$response->getToken();
$response->getUser_id();
$response->getPayment_method_id();
$response->getCard_brand();
$response->getBin();
$response->getAmount();
$response->getCurrency();
$response->getInstallments();
$response->getPayment_type();
$response->getSub_payments();
$response->getStatus();
$response->getStatus_details();
$response->getDate();
$response->getEstablishment_name();
$response->getFraud_detection();
$response->getAggregate_data();
$response->getSite_id();


$data = array();
$query = array("expand"=>"card_data");

$response = $connector->payment()->PaymentInfo($data, '873836', $query);
$response->getCard_data()



Array (
	[card_number] => 450799XXXXXX4905
	[card_holder] => Array (
		[identification] => Array (
		[type] => dni
		[number] => 27859328
	)
	[name] => Tarjeta Visa
	)
)



$data = array();
$response = $connector->payment()->Refund($data, '574671'); //574671 es el id de la operacion de compra
$response->getId();
$response->getAmount();
$response->getSub_payments();
$response->getStatus();



$data = array();
$response = $connector->payment()->deleteRefund($data, '574671', '164'); //574671 id de la operacion de compra, 164 id de la devolucion
$response->getResponse();
$response->getStatus();



$data = array(
	"amount" => 100
	);
$response = $connector->payment()->partialRefund($data,'574673'); //574671 id de la operacion de compra
$response->getId();
$response->getAmount();
$response->getSub_payments();
$response->getStatus();




$data = array();
$response = $connector->payment()->deleteRefund($data, '574671', '164'); //574671 id de la operacion de compra, 164 id de la devolucion parcial
$response->getResponse());
$response->getStatus());




$data = array();
$response = $connector->token()->tokensList($data, 'prueba'); //prueba, es el usuario dueño de la tarjeta de credito
var_dump($response);
var_dump($response->getTokens());




$connector = new \Decidir\Connector($keys_data, $ambient);

$data = array(
      "site_transaction_id" => "12042017_20",
      "token" => "be211413-757b-487e-bb0c-283d21c0fb6f",
      "user_id" => "pepe",
      "payment_method_id" => 1,
      "bin" => "450799",
      "amount" => 1000,
      "currency" => "ARS",
      "installments" => 1,
      "description" => "",
      "payment_type" => "single",
      "sub_payments" => array()
    );

$response = $connector->payment()->ExecutePayment($data);
$response->getId();
$response->getToken();
$response->getUser_id();
$response->getPayment_method_id();
$response->getBin();
$response->getAmount();
$response->getCurrency();
$response->getInstallments();
$response->getPayment_type();
$response->getDate_due();
$response->getSub_payments();
$response->getStatus();
$response->getStatus_details();
$response->getDate();
$response->getEstablishment_name();
$response->getFraud_detection();
$response->getAggregate_data();
$response->getSite_id();


$data = array();
$response = $connector->token()->tokenDelete($data, 'af49025a-f1b7-4363-a1cb-1ed38c3d4d75');



  $cs_data = array(
        "send_to_cs" => true,
        "channel" => "Web",
        "bill_to" => array(
          "city" => "Buenos Aires",
          "country" => "AR",
          "customer_id" => "martinid",
          "email" => "[email protected]",
          "first_name" => "martin",
          "last_name" => "perez",
          "phone_number" => "1547766111",
          "postal_code" => "1768",
          "state" => "BA",
          "street1" => "GARCIA DEL RIO 3333",
          "street2" => "GARCIA DEL RIO 3333",
        ),
        "ship_to" => array(
          "city" => "Buenos Aires",
          "country" => "AR",
          "customer_id" => "martinid",
          "email" => "[email protected]",
          "first_name" => "martin",
          "last_name" => "perez",
          "phone_number" => "1547766111",
          "postal_code" => "1768",
          "state" => "BA",
          "street1" => "GARCIA DEL RIO 3333",
          "street2" => "GARCIA DEL RIO 3333",
        ),
        "currency" => "ARS",
        "amount" => 1200,
        "days_in_site" => 243,
        "is_guest" => false,
        "password" => "password",
        "num_of_transactions" => 1,
        "cellphone_number" => "12121",
        "date_of_birth" => "129412",
        "street" => "RIO 4041",
        "days_to_delivery" => "55",
        "dispatch_method" => "storepickup",
        "tax_voucher_ANDATORIO 
        )
      );   

      



$cybersource = new Decidir\Cybersource\Retail(
                    $datos_cs,  // Datos de la operación
                    $cs_productos, // Datos de los productos
  );

$connector->payment()->setCybersource($cybersource->getData());

$data = array(
      "site_transaction_id" => "12042017_20",
      "token" => "be211413-757b-487e-bb0c-283d21c0fb6f",
      "user_id" => "usuario",
      "payment_method_id" => 1,
      "bin" => "450799",
      "amount" => 1200,
      "currency" => "ARS",
      "installments" => 1,
      "description" => "",
      "payment_type" => "single",
      "sub_payments" => array()
    );

    $response = $connector->payment()->ExecutePayment($data);


    
  $cs_data = array(
        "send_to_cs" => true,
        "channel" => "Web",
        "bill_to" => array(
          "city" => "Buenos Aires",
          "country" => "AR",
          "customer_id" => "martinid",
          "email" => "[email protected]",
          "first_name" => "martin",
          "last_name" => "perez",
          "phone_number" => "1547766111",
          "postal_code" => "1427",
          "state" => "BA",
          "street1" => "GARCIA DEL RIO 4000",
          "street2" => "GARCIA DEL RIO 4000",
        ),
        "currency" => "ARS",
        "amount" => 1200,
        "days_in_site" => 243,
        "is_guest" => false,
        "password" => "abracadabra",
        "num_of_transactions" => 1,
        "cellphone_number" => "12121",
        "date_of_birth" => "129412",
        "street" => "RIO 4041",
        "delivery_type"=> "Pick up",
        "days_to_event"=> 55,
        "csmdd17" => "17"
      );

  //Datos de productos, array con los diferentes productos involucrados.
  $cs_products = array(
        array(
          "csitproductcode" => "concierto2016",
                  "csitproductdescription" => "Popular Concierto 2016",
                  "csitproductname" => "concierto2016",
                  "csitproductsku" => "BS01",
                  "csittotalamount" => 600,
                  "csitquantity" => 1,
                  "csitunitprice" => 6.00
          ),
        array(
          "csitproductcode" => "concierto2017",
                  "csitproductdescription" => "Popular Concierto 2017",
                  "csitproductname" => "concierto2017",
                  "csitproductsku" => "BS01",
                  "csittotalamount" => 600,
                  "csitquantity" => 1,
                  "csitunitprice" => 600
        )
      );  
     


$cybersource = new Decidir\Cybersource\Ticketing(
                    $datos_cs,  // Datos de la operación
                    $cs_productos, // Datos de los productos
  );

$connector->payment()->setCybersource($cybersource->getData());

$data = array(
      "site_transaction_id" => "12042017_20",
      "token" => "be211413-757b-487e-bb0c-283d21c0fb6f",
      "user_id" => "usuario",
      "payment_method_id" => 1,
      "bin" => "450799",
      "amount" => 1200,
      "currency" => "ARS",
      "installments" => 1,
      "description" => "",
      "payment_type" => "single",
      "sub_payments" => array()
    );

$response = $connector->payment()->ExecutePayment($data);



$cs_data = array(
      "send_to_cs" => true,
      "channel" => "Web",
      "bill_to" => array(
        "city" => "Buenos Aires",
        "country" => "AR",
        "customer_id" => "martinid",
        "email" => "[email protected]",
        "first_name" => "martin",
        "last_name" => "perez",
        "phone_number" => "1547766111",
        "postal_code" => "1427",
        "state" => "BA",
        "street1" => "GARCIA DEL RIO 4000",
        "street2" => "GARCIA DEL RIO 4000",
      ),
      "currency" => "ARS",
      "amount" => 1200,
      "days_in_site" => 243,
      "is_guest" => false,
      "password" => "abracadabra",
      "num_of_transactions" => 1,
      "cellphone_number" => "12121",
      "date_of_birth" => "129412",
      "street" => "RIO 4041",
      "delivery_type"=> "Pick up",
      "csmdd17" => "17"
    );

//lista de productos cybersource
$cs_products = array(
      array(
        "csitproductcode" => "software2016",
                "csitproductdescription" => "Software 2016",
                "csitproductname" => "soft2016",
                "csitproductsku" => "ST01",
                "csittotalamount" => 600,
                "csitquantity" => 1,
                "csitunitprice" => 6.00
      ),
      array(
        "csitproductcode" => "software2017",
                "csitproductdescription" => "Software 2017",
                "csitproductname" => "soft2017",
                "csitproductsku" => "ST01",
                "csittotalamount" => 600,
                "csitquantity" => 1,
                "csitunitprice" => 6.00
      )
    );
  


$cybersource = new Decidir\Cybersource\DigitalGoods(
                    $datos_cs,  // Datos de la operación
                    $cs_productos, // Datos de los productos
  );

$connector->payment()->setCybersource($cybersource->getData());

$data = array(
      "site_transaction_id" => "12042017_20",
      "token" => "be211413-757b-487e-bb0c-283d21c0fb6f",
      "user_id" => "usuario",
      "payment_method_id" => 1,
      "bin" => "450799",
      "amount" => 1200,
      "currency" => "ARS",
      "installments" => 1,
      "description" => "",
      "payment_type" => "single",
      "sub_payments" => array()
    );

$response = $connector->payment()->ExecutePayment($data);



$cs_data = array(
    "send_to_cs" => true,
    "channel" => "Web",
    "bill_to" => array(
        "city" => "Buenos Aires",
        "country" => "AR",
        "customer_id" => "martinid",
        "email" => "[email protected]",
        "first_name" => "martin",
        "last_name" => "perez",
        "phone_number" => "1547766111",
        "postal_code" => "1768",
        "state" => "BA",
        "street1" => "GARCIA DEL RIO 3333",
        "street2" => "GARCIA DEL RIO 3333",
    ),
    "currency" => "ARS",
    "amount" => 1200,
    "days_in_site" => 243,
    "is_guest" => false,
    "password" => "password",
    "num_of_transactions" => 1,
    "cellphone_number" => "12121",
    "date_of_birth" => "129412",
    "street" => "RIO 4041",
    "service_type" => "tiposervicio",
    "reference_payment_service1" => "reference1",
    "reference_payment_service2" => "reference2",
    "reference_payment_service3" => "reference3",
    "csmdd17" => "17"
);

//lista de productos cybersource
$cs_products = array(
    array(
        "csitproductcode" => "popblacksabbat2016",
        "csitproductdescription" => "Popular Black Sabbath 2016",
        "csitproductname" => "popblacksabbat2016ss",
        "csitproductsku" => "asas",
        "csittotalamount" => 600,
        "csitquantity" => 1,
        "csitunitprice" => 600
    ),
    array(
        "csitproductcode" => "popblacksabbat2017",
        "csitproductdescription" => "Popular Black Sabbath 2017",
        "csitproductname" => "popblacksabbat2017ss",
        "csitproductsku" => "asas",
        "csittotalamount" => 600,
        "csitquantity" => 1,
        "csitunitprice" => 600
    )
);



$cybersource = new Decidir\Cybersource\Service(
                    $datos_cs,  // Datos de la operación
                    $cs_productos, // Datos de los productos
  );

$connector->payment()->setCybersource($cybersource->getData());

$data = array(
      "site_transaction_id" => "12042017_20",
      "token" => "be211413-757b-487e-bb0c-283d21c0fb6f",
      "user_id" => "usuario",
      "payment_method_id" => 1,
      "bin" => "450799",
      "amount" => 1200,
      "currency" => "ARS",
      "installments" => 1,
      "description" => "",
      "payment_type" => "single",
      "sub_payments" => array()
    );

$response = $connector->payment()->ExecutePayment($data);



$cs_data = array(
    "send_to_cs" => true,
    "channel" => "Web",
    "bill_to" => array(
        "city" => "Buenos Aires",
        "country" => "AR",
        "customer_id" => "martinid",
        "email" => "[email protected]",
        "first_name" => "martin",
        "last_name" => "perez",
        "phone_number" => "1547766111",
        "postal_code" => "1768",
        "state" => "BA",
        "street1" => "GARCIA DEL RIO 3333",
        "street2" => "GARCIA DEL RIO 3333",
    ),
    "currency" => "ARS",
    "amount" => 1200,
    "days_in_site" => 243,
    "is_guest" => false,
    "password" => "password",
    "num_of_transactions" => 1,
    "cellphone_number" => "12121",
    "date_of_birth" => "129412",
    "street" => "RIO 4041",
    "reservation_code" => "GJH784",
    "third_party_booking" => false,
    "departure_city" => "EZE",
    "final_destination_city" => "HND",
    "international_flight" => true,
    "frequent_flier_number" => "00000123",
    "class_of_service" => "class",
    "day_of_week_of_flight" => 2,
    "week_of_year_of_flight" => 5,
    "airline_code" => "AA",
    "code_share" => "SKYTEAM",
    "decision_manager_travel" => array(
            "complete_route" => "EZE-LAX:LAX-HND",
            "journey_type" => "one way",
            "departure_date" => array(
                    "departure_time" =>  "2017-05-30T09:00Z",
                    "departure_zone "=> "GMT-0300"
            )
    ),
    "airline_number_of_passengers" => 1
);

$cs_passenger = array(
    array(
        "email" => "[email protected]",
        "first_name" => "Juan",
        "last_name" => "Perez",
        "passport_id" => "412314851231",
        "phone" => "541134356768",
        "passenger_status" => "gol",
        "passenger_type" => "ADT"
    )
);



$cybersource = new Decidir\Cybersource\Travel(
                    $datos_cs,  // Datos de la operación
                    $cs_passenger, // Datos de los pasajeros
  );

$connector->payment()->setCybersource($cybersource->getData());

$data = array(
      "site_transaction_id" => "12042017_20",
      "token" => "be211413-757b-487e-bb0c-283d21c0fb6f",
      "user_id" => "usuario",
      "payment_method_id" => 1,
      "bin" => "450799",
      "amount" => 1200,
      "currency" => "ARS",
      "installments" => 1,
      "description" => "",
      "payment_type" => "single",
      "sub_payments" => array()
    );

$response = $connector->payment()->ExecutePayment($data);