В общем вот готовый процессор для принятия к себе на кошелек пластика, яндекс денег и платежи с телефонов
В строке 77 выбирается тип платежа
paymentType — способ оплаты. Возможные значения:
-
PC — оплата из кошелька в Яндекс.Деньгах;
-
AC — с банковской карты;
-
MC — с баланса мобильного.
<?php /*************************************************************************** * * * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/if (defined(‘PAYMENT_NOTIFICATION’)) {
if ($mode == 'ok') { $order_id = $_POST['label']; $payment_id = db_get_field("SELECT payment_id FROM ?:orders WHERE order_id = ?i", $order_id); $processor_data = fn_get_processor_data($payment_id); $notification_type = $_POST["notification_type"]; $operation_id = $_POST["operation_id"]; $amount = $_POST["amount"]; $currency = $_POST["currency"]; $datetime = $_POST["datetime"]; $sender = $_POST["sender"]; $codepro = $_POST["codepro"]; $notification_secret = $processor_data['processor_params']['password']; $label = $_POST["label"]; $sha1_hash = $_POST["sha1_hash"]; $hash = $notification_type . '&' . $operation_id . '&' . $amount . '&' . $currency . '&' . $datetime . '&' . $sender . '&' . $codepro . '&' . $notification_secret . '&' . $label; $sha1 = hash("sha1", $hash); if ( $sha1 == $sha1_hash ) { if (fn_check_payment_script('yandex_card.php', $order_id)) { $_order_id = db_get_field("SELECT order_id FROM ?:order_data WHERE order_id = ?i AND type = 'S'", $order_id); if (empty($_order_id)) { break; } $order_status = db_get_field("SELECT status FROM ?:orders WHERE order_id = ?i", $order_id); if ($order_status == STATUS_INCOMPLETED_ORDER) { fn_change_order_status($order_id, 'O'); } fn_order_placement_routines('route', $order_id, false); } } } exit;
} else {
if (!defined(‘BOOTSTRAP’)) { die(‘Access denied’); }
$post_address = "https://money.yandex.ru/quickpay/confirm.xml"; $post_data = array( 'receiver' => $processor_data['processor_params']['number'], 'quickpay-form' => 'shop', 'targets' => $processor_data['processor_params']['name'] . ' - ' . $order_info[order_id], 'label' => $order_id, 'sum' => $order_info[total], 'need-fio' => 'false', 'need-email' => 'false', 'need-phone' => 'false', 'need-address' => 'false', 'successURL' => fn_url("index.php?dispatch=checkout.complete&order_id=" . $order_info[order_id]), 'paymentType' => 'AC', ); fn_create_payment_form($post_address, $post_data, 'YandexCard', false);
}