Documentation

sale.paysystem.settings.update

Scope: pay_system Permissions to execute: administrator

Description and parameters

Method updates payment system settings.


Method parameters

Required parameters are marked with asterisk (*)

Parameter Description
ID*
sale_paysystem.ID
Payment system identifier to get the settings
PERSON_TYPE_ID
sale_person_type.id
Payer type to get the settings
SETTINGS*
object
Settings to be updated. Keys are setting titles, values are objects; their structure is described below

SETTINGS parameter

Parameter Description
TYPE
string
VALUE
string
Parameter source ID or parameter value (for TYPE="VALUE")

Code examples


  • cURL (Webhook)
    curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"ID":11,"PERSON_TYPE_ID":1,"SETTINGS":{"REST_SERVICE_KEY_IFRAME":{"TYPE":"VALUE","VALUE":"NEW_KEY"}}}' \
    https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/sale.paysystem.settings.update
    
  • cURL (OAuth)
    curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"ID":11,"PERSON_TYPE_ID":1,"SETTINGS":{"REST_SERVICE_KEY_IFRAME":{"TYPE":"VALUE","VALUE":"NEW_KEY"}},"auth":"**put_access_token_here**"}' \
    https://**put_your_bitrix24_address**/rest/sale.paysystem.settings.update
    
  • JS
    BX24.callMethod('sale.paysystem.settings.update', {
    	'ID': 11,
    	'PERSON_TYPE_ID': 1,
    	'SETTINGS': {
    		'REST_SERVICE_KEY_IFRAME': {
    			'TYPE': 'VALUE',
    			'VALUE': 'NEW_KEY',
    		}
    	}
    }, 
    function(result) 
    { 
    	if(result.error()) 
    		console.error(result.error()); 
    	else 
    	{ 
    		console.dir(result.data()); 
    	} 
    } 
    );
  • PHP
    require_once('crest.php');
    
    $result = CRest::call(
    	'sale.paysystem.settings.update',
    	[
    		'ID' => 11,
    		'PERSON_TYPE_ID' => 1,
    		'SETTINGS' => [
    			'REST_SERVICE_KEY_IFRAME' => [
    				'TYPE' => 'VALUE',
    				'VALUE' => 'NEW_KEY',
    			]
    		]
    	]
    );
    
    echo '
    ';
    print_r($result);
    echo '
    ';

Error and response processing


Response processing

HTTP-status: 200

{
	"result": true,
	"time": {
		"start": 1712135335.026931,
		"finish": 1712135335.407762,
		"duration": 0.3808310031890869,
		"processing": 0.0336611270904541,
		"date_start": "2024-04-03T11:08:55+02:00",
		"date_finish": "2024-04-03T11:08:55+02:00",
		"operating_reset_at": 1705765533,
		"operating": 3.3076241016387939
	}
}

Returned data

Parameter Description
result
boolean
Update result for payment system settings
time
time
Query execution time details

Error processing

HTTP-status: 400, 403

{
	"error": " ERROR_CHECK_FAILURE",
	"error_description": "Pay system not found"
}
Title Description
error
string
Error string code. Can contain digits, Latin letters and underscore characters
error_description
error_description
Error text description. Description is not intended to be displayed to an end-user in the unprocessed format

Possible error codes

Code Description Status
ACCESS_DENIED Insufficient permissions to read settings 403
ERROR_CHECK_FAILURE One or several required field values are not specified or a specified payment system is not found (find more details in the error description) 400
ERROR_HANDLER_NOT_FOUND Field SETTINGS is not specified or empty object is passed 400

© «Bitrix24», 2001-2024
Up