На странице возврата в случае успешной оплаты используйте
CSaleOrder::StatusOrder
NULL
[ReflectionException]
Cannot access non-public member Sale\Handlers\PaySystem\sberbank_ecom2Handler::extraParams (0)
$result = $service->initiatePay($paymentItem, $context->getRequest());
$gateResponse = $RBS_Gateway->registerOrder();
$params = array(
'sberbank_result' => $gateResponse, //ДАННЫЕ ОТ ШЛЮЗА СБ
'payment_link' => $RBS_Gateway->getPaymentLink(),
'currency' => $payment->getField('CURRENCY')
);
$this->setExtraParams($params);
//где-то в файле
createPaySystemItem: function(item)
{
var checked = item.CHECKED == 'Y',
// logotype, logoNode,
paySystemId = parseInt(item.ID),
title, label, itemNode;
label = BX.create('DIV', {
props: {className: 'bx-soa-pp-company-graf-container'},
children: [
BX.create('INPUT', {
props: {
id: 'ID_PAY_SYSTEM_ID_' + paySystemId,
name: 'PAY_SYSTEM_ID',
type: 'checkbox',
className: 'bx-soa-pp-company-checkbox',
value: paySystemId,
//checked: checked //Снимаю галочки с чекбоксов
}
}),
// logoNode
]
});
if (typeof wc_checkout_params !== 'undefined' ) {
var woo_checkout = wc_checkout_params;
}else if (typeof wc_cart_params !== 'undefined' ){
var woo_checkout = wc_cart_params;
}else {
return false;
}
var data = {
action: 'woocommerce_update_order_review',
security: woo_checkout.update_order_review_nonce,
post_data: $('form.checkout').serialize()
};
//console.log(data);
var xhr = $.ajax({
type: 'POST',
url: woo_checkout.ajax_url,
data: data,
success: function(response) {
console.log(response);
jQuery( 'form.checkout' ).trigger( 'update' );
},
error: function(code){
console.log('ERROR');
}
});
}
function update_order_shipping(yd_params){
var data = {
action: 'woocommerce_update_order_review',
security: wc_checkout_params.update_order_review_nonce,
delivery: yd_params,
post_data: $('form.checkout').serialize()
};
var xhr = $.ajax({
type: 'POST',
url: wc_checkout_params.ajax_url,
data: data,
success: function(response) {
console.log(response);
$('body').trigger('update_checkout');
},
error: function(code){
console.log('ERROR');
}
});
}
$(document).on('change','#shipping_method input[type="radio"]',function(){
console.log('update_checkout');
update_order_shipping('CDEK 100rub');
});
add_action( 'woocommerce_update_order_review', 'yandex_delivery_add' );
function yandex_delivery_add(){
var_dump($_REQUEST["post_data"]);
}
name='shop_delivery_method[]' value='{"yd_id":"1495","yd_unique_name":"Boxberry","yd_name":"\u0411\u043e\u043a\u0441\u0431\u0435\u0440\u0440\u0438","yd_cost":"299"}'