Example #1
0
         echo "Initial requested amount: " . $response->PaytooRequest->amount . "\n";
         echo "Final processed amount: " . $response->PaytooTransaction->tr_amount_transfered . "\n";
     } else {
         echo $response->status . " " . $response->msg . "\n";
     }
 } else {
     echo $response->status . " " . $response->msg . "\n";
 }
 echo "Processing Wallet Sale\n";
 $response = $soap->SingleTransaction('08587726', '123456', 13, 'ARS', '1234', 'Order 1234');
 if ($response->status == 'PENDING') {
     echo "Step 2a: Transaction accepted but it must be confirmed\n";
     echo "Request ID: " . $response->request_id . "\n";
     $request_id = $response->request_id;
     //"OTP"is"always"888888"on"sandbox
     $response2 = $soap->ConfirmTransaction($request_id, '888888');
     if ($response2->status == 'OK') {
         echo "Finish: transaction has been processed\n";
         echo "Tr. ID: " . $response2->tr_id . "\n";
     } else {
         echo "ConfirmTransaction error: " . $response2->status . " " . $response2->msg . "\n";
     }
 } elseif ($response->status == 'OK') {
     echo "Finish: transaction has been processed\n";
     echo "Tr. ID: " . $response->tr_id . "\n";
 } else {
     echo "SingleTransaction error: " . $response->status . " " . $response->msg . "\n";
 }
 echo "Processing Wallet PreiAuth\n";
 $response = $soap->PreAuth('08587726', '123456', 20, 'ARS', '1234', 'Order 1234');
 if ($response->status == 'PENDING') {
Example #2
0
}
try {
    ini_set('soap.wsdl_cache_enabled', 0);
    $soap = new SoapClient("https://go.paytoo.info/api/merchant/", array("classmap" => array("PaytooAccountType" => "PaytooAccountType", "PaytooCreditCardType" => "PaytooCreditCardType")));
    $merchant_id = 97383913;
    // Your merchant ID
    $api_password = '******';
    // Your API Password
    echo "Processing\tWallet\tSale\n";
    $response = $soap->SingleTransaction('01109123', 123456, 13, 'USD', '1234', 'Order	1234');
    if ($response->status == 'PENDING') {
        echo "Step\t2a:\tTransaction\taccepted\tbut\tit\tmust\tbe\tconfirmed\n";
        echo "Request\tID:\t" . $response->request_id . "\n";
        $request_id = $response->request_id;
        // OTP is always 888888 on sandbox
        $response2 = $soap->ConfirmTransaction($request_id, 888888);
        if ($response2->status == 'OK') {
            echo "Finish:\ttransaction\thas\tbeen\tprocessed\n";
            echo "Tr.\tID:\t" . $response2->tr_id . "\n";
        } else {
            echo "ConfirmTransaction\terror:\t" . $response2->status . "\t-\t" . $response2->msg . "\n";
        }
    } elseif ($response->status == 'OK') {
        echo "Finish:\ttransaction\thas\tbeen\tprocessed\n";
        echo "Tr.\tID:\t" . $response->tr_id . "\n";
    } else {
        echo "SingleTransaction\terror:\t" . $response->status . "\t-\t" . $response->msg . "\n";
    }
} catch (Exception $e) {
    var_export($e);
}