function dinero_mail()
 {
     $APIPassword = "******";
     $APIUserName = "******";
     $Crypt = false;
     $MerchantTransactionId = "1";
     $UniqueMessageId = "1";
     $Provider = "oxxo";
     $Currency = "MXN";
     $Amount = "50.00";
     $Hash = "";
     $ns = "https://sandboxapi.dineromail.com/";
     $wsdlPath = "https://sandboxapi.dineromail.com/DMAPI.asmx?WSDL";
     try {
         $Hash = $MerchantTransactionId . $UniqueMessageId . $Currency . $Amount . $Provider . $APIPassword;
         $Hash = md5($Hash);
         $MerchantTransactionId = md5($APIPassword, $MerchantTransactionId);
         $UniqueMessageId = md5($APIPassword, $UniqueMessageId);
         $Provider = md5($APIPassword, $Provider);
         $Currency = md5($APIPassword, $Currency);
         $Amount = md5($APIPassword, $Amount);
         $soap_options = array('trace' => 1, 'exceptions' => 1);
         $client = new SoapClient($wsdlPath, $soap_options);
         $credential = new SOAPVar(array('APIUserName' => $APIUserName, 'APIPassword' => $APIPassword), SOAP_ENC_OBJECT, 'APICredential', $ns);
         $request = array('Credential' => $credential, 'Crypt' => $Crypt, 'MerchantTransactionId' => $MerchantTransactionId, 'UniqueMessageId' => $UniqueMessageId, 'Provider' => $Provider, 'Amount' => $Amount, 'Currency' => $Currency, 'Hash' => $Hash);
         $result = $client->GetPaymentTicket(utf8_encode($request));
         echo "<br/>";
         echo "MerchantTransactionId: " . $result->GetPaymentTicketResult->MerchantTransactionId . "<br/>";
         echo "Status: " . $result->GetPaymentTicketResult->TransactionId . "<br/>";
         echo "Message: " . $result->GetPaymentTicketResult->Message . "<br/>";
         echo "Status: " . $result->GetPaymentTicketResult->Status . "<br/>";
         echo "TransactionId: " . $result->GetPaymentTicketResult->TransactionId . "<br/>";
         echo "BarcodeDigits: " . $result->GetPaymentTicketResult->BarcodeDigits . "<br/>";
         echo "BarcodeImageUrl: " . $result->GetPaymentTicketResult->BarcodeImageUrl . "<br/>";
         echo "VoucherUrl: " . $result->GetPaymentTicketResult->VoucherUrl . "<br/>";
     } catch (SoapFault $sf) {
         echo "faultstring:" . $sf->faultstring;
     }
 }
Example #2
0
$wsdlPath = "https://sandboxapi.dineromail.com/DMAPI.asmx?WSDL";
try {
    $Hash = $MerchantTransactionId . $UniqueMessageId . $Currency . $Amount . $Provider . $APIPassword;
    $Hash = MD5($Hash);
    if ($Crypt == true) {
        $MerchantTransactionId = encryptTripleDES($APIPassword, $MerchantTransactionId);
        $UniqueMessageId = encryptTripleDES($APIPassword, $UniqueMessageId);
        $Provider = encryptTripleDES($APIPassword, $Provider);
        $Currency = encryptTripleDES($APIPassword, $Currency);
        $Amount = encryptTripleDES($APIPassword, $Amount);
    }
    $soap_options = array('trace' => 1, 'exceptions' => 1);
    $client = new SoapClient($wsdlPath, $soap_options);
    $credential = new SOAPVar(array('APIUserName' => $APIUserName, 'APIPassword' => $APIPassword), SOAP_ENC_OBJECT, 'APICredential', $ns);
    $request = array('Credential' => $credential, 'Crypt' => $Crypt, 'MerchantTransactionId' => $MerchantTransactionId, 'UniqueMessageId' => $UniqueMessageId, 'Provider' => $Provider, 'Amount' => $Amount, 'Currency' => $Currency, 'Hash' => $Hash);
    $result = $client->GetPaymentTicket($request);
    echo "<br/>";
    echo "MerchantTransactionId: " . $result->GetPaymentTicketResult->MerchantTransactionId . "<br/>";
    echo "Status: " . $result->GetPaymentTicketResult->TransactionId . "<br/>";
    echo "Message: " . $result->GetPaymentTicketResult->Message . "<br/>";
    echo "Status: " . $result->GetPaymentTicketResult->Status . "<br/>";
    echo "TransactionId: " . $result->GetPaymentTicketResult->TransactionId . "<br/>";
    echo "BarcodeDigits: " . $result->GetPaymentTicketResult->BarcodeDigits . "<br/>";
    echo "BarcodeImageUrl: " . $result->GetPaymentTicketResult->BarcodeImageUrl . "<br/>";
    echo "VoucherUrl: " . $result->GetPaymentTicketResult->VoucherUrl . "<br/>";
} catch (SoapFault $sf) {
    echo "faultstring:" . $sf->faultstring;
}
function encryptTripleDES($key, $text)
{
    $vector = "uL%&(#(f";