Documentation

sale.paysystem.handler.add

sale.paysystem.handler.add(
 fiedls
)

This method adds REST-handler.

Parameters

Parameter Description Available from version
fiedls Set of fields (array type array("field":"value"[, ...])), containing values, describing the handler. Available fields:
  • NAME - Name of handler
  • CODE - Unique handler code in the system.
  • SETTINGS - Handler settings
  • SORT - Sorting

Example

BX24.callMethod(
	"sale.paysystem.handler.add",
	{
		'NAME' : 'REST handler', 							// Name of handler
		'SORT' : 100, 											// Sorting
		'CODE' : 'resthandlercode', 							// Unique code of handler in the system
		'SETTINGS' : { 											// Handler settings
			'CURRENCY' : {'RUB'}, 								// List of currencies, supported by the handler
			'FORM_DATA' : { 									// Form settings
				'ACTION_URI' : 'https://payment_service_url', 	// URL, where the form will be sent
				'METHOD' : 'POST', 								// Method for sending form
				'PARAMS' : { 									// Chart with links between form fields and handler parameters: array of "array" type (code_field => code_handler_parameter)
					'serviceid' : 'REST_SERVICE_ID',
					'invoiceNumber' : 'PAYMENT_ID',
					'Sum' : 'PAYMENT_SHOULD_PAY',
					'customer' : 'PAYMENT_BUYER_ID',
				}
			},
			'CODES' : {											// LIst of handler parameters
				"REST_SERVICE_ID" : {							// Parameter code
					"NAME" : 'Payment system number',					// Parameter name
					"DESCRIPTION" : 'Payment system number',			// Parameter description
					'SORT' : 100,								// Sortintg
				},
				"REST_SERVICE_KEY" : {
					"NAME" : 'Secret key',
					"DESCRIPTION" : 'Secret key',
					'SORT' : 300,
				},
				"PAYMENT_ID" : {
					"NAME" : 'Payment number',
					'SORT' : 400,
					'GROUP' : 'PAYMENT',
					'DEFAULT' : {
						'PROVIDER_KEY' : 'PAYMENT',
						'PROVIDER_VALUE' : 'ACCOUNT_NUMBER'
					}
				},
				"PAYMENT_SHOULD_PAY" : {
					"NAME" : 'Payment amount',
					'SORT' : 600,
					'GROUP' : 'PAYMENT',
					'DEFAULT' : {
						'PROVIDER_KEY' : 'PAYMENT',
						'PROVIDER_VALUE' : 'SUM'
					}
				},
				"PS_CHANGE_STATUS_PAY" : {
					"NAME" : 'Payment status automatic change',
					'SORT' : 700,
					"INPUT" : {
						'TYPE' : 'Y/N'
					},
				},
				"PAYMENT_BUYER_ID" : {
					"NAME" : 'Buyer code',
					'SORT' : 1000,
					'GROUP' : 'PAYMENT',						// type of string value, checkbox and etc.
					'DEFAULT' : {								// By default value
						'PROVIDER_KEY' : 'ORDER',				// Value type (see. available list below)
						'PROVIDER_VALUE' : 'USER_ID'			// Value (see. available list below)
					}
				}
			}
		}
	},
	function(result)
	{
		if(result.error())
			console.error(result.error());
		else
			console.info("Handler is added with ID" + result.data());
	}
);

Possible values

{Possible values for PROVIDER_KEY
ORDER Parameters
PROPERTY Invoice properties
PAYMENT Payment
USER User
VALUE String type value
Y\N Checkbox
Possible values for PROVIDER_VALUE
ORDER ID: ID,
ACCOUNT_NUMBER: Order number,
ORDER_TOPIC: Topic,
DATE_INSERT: Date of order,
DATE_INSERT_DATE: Date of order (without time),
DATE_BILL: Data and time when issued,
DATE_BILL_DATE: Date when issued,
DATE_PAY_BEFORE: Due date,
SHOULD_PAY: Invoice amount,
CURRENCY: Currency,
PRICE: Order price,
PRICE_DELIVERY: Delivery price,
DISCOUNT_VALUE: Discount amount,
USER_ID: Buyer code,
PAY_SYSTEM_ID: Payment system code,
DELIVERY_ID: Delivery service code,
TAX_VALUE: Tax,
USER_DESCRIPTION: Comment
PAYMENT ID: ID
ACCOUNT_NUMBER: Payment number,
DATE_BILL: Data and time when issued,
DATE_BILL_DATE: Data when issued (without time),
SUM: Invoice amount,
CURRENCY: Currency,
USER ID: Buyer code,
LOGIN: Login,
NAME: Name,
SECOND_NAME: Middle name,
LAST_NAME: Last name,
EMAIL: EMail,
PERSONAL_PROFESSION: professional occupation,
PERSONAL_WWW: Personal website,
PERSONAL_ICQ: ICQ number,
PERSONAL_GENDER: Gender,
PERSONAL_FAX: Fax number,
PERSONAL_MOBILE: Telephone number,
PERSONAL_STREET: Address,
PERSONAL_MAILBOX: Mailbox,
PERSONAL_CITY: City,
PERSONAL_STATE: State,
PERSONAL_ZIP: Zip code,
PERSONAL_COUNTRY: Country,
WORK_COMPANY: Company,
WORK_DEPARTMENT: Department,
WORK_POSITION: Position,
WORK_WWW: Company website,
WORK_PHONE: Work telephone,
WORK_FAX: Work fax,
WORK_STREET: Company address,
WORK_MAILBOX: Work mailbox,
WORK_CITY: Company city,
WORK_STATE: Company state,
WORK_ZIP: Company index,
WORK_COUNTRY: Company country


© «Bitrix24», 2001-2022
Up