Table "Payment Service Setup"
Configures external payment service providers for online payment processing. Manages integration settings for services like PayPal, Microsoft Wallet, and WorldPay.
Remarks
Supports multiple payment providers with individual configuration and enable/disable control. Integrates with sales documents to offer payment options to customers. Extensible through OnCanChangePaymentService and related integration events.
Properties
| Name | Value |
|---|---|
| Caption | Payment Service Setup |
| Permissions | TableData "Sales Invoice Header" = rimd, TableData "Payment Reporting Argument" = rimd |
| DataClassification | CustomerContent |
Fields
| Name | Type | Description |
|---|---|---|
| "No." | Text[250] | Unique identifier for the payment service configuration. |
| Name | Text[250] | Display name of the payment service provider. Shown to users in payment selection interfaces. |
| Description | Text[250] | Detailed description of the payment service and its capabilities. Provides additional information about the payment provider to users. |
| Enabled | Boolean | Controls whether this payment service is active and available for use. When disabled, the service will not appear in payment options. |
| "Always Include on Documents" | Boolean | Determines if this payment service should be included on all sales documents by default. When enabled, automatically adds this service to new and existing invoices. |
| "Setup Record ID" | RecordId | Record ID pointing to the specific setup record for this payment service. Links to provider-specific configuration tables. |
| "Setup Page ID" | Integer | Page ID for the payment service setup configuration page. Allows users to access provider-specific setup options. |
| "Terms of Service" | Text[250] | URL link to the payment service provider's terms of service. Provides legal and usage information for the payment service. |
| Available | Boolean | Indicates whether the payment service is currently available for use. May be controlled by system conditions or external service status. |
| "Management Codeunit ID" | Integer | Codeunit ID that handles the business logic for this payment service. Contains provider-specific implementation for payment processing. |
| SystemId | Guid | |
| SystemCreatedAt | DateTime | |
| SystemCreatedBy | Guid | |
| SystemModifiedAt | DateTime | |
| SystemModifiedBy | Guid | |
| SystemRowVersion | BigInteger |
Methods
OpenSetupCard
Opens the setup card page for this payment service configuration. Allows users to modify provider-specific settings and parameters.
procedure OpenSetupCard()
CreateReportingArgs
Creates payment reporting arguments for a specific document and its associated payment services. Generates the data needed for payment provider integration and customer communication.
procedure CreateReportingArgs(var PaymentReportingArgument: Record "Payment Reporting Argument" temporary, DocumentRecordVariant: Variant)
Parameters
| Name | Type | Description |
|---|---|---|
| PaymentReportingArgument | Table Microsoft.Bank.Setup."Payment Reporting Argument" |
Temporary table to populate with payment service arguments |
| DocumentRecordVariant | Variant |
Source document record (typically Sales Header or Invoice) |
GetDefaultPaymentServices
procedure GetDefaultPaymentServices(var SetID: Integer): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| SetID | Integer |
Returns
| Type | Description |
|---|---|
| Boolean |
SelectPaymentService
procedure SelectPaymentService(var SetID: Integer): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| SetID | Integer |
Returns
| Type | Description |
|---|---|
| Boolean |
SaveSet
procedure SaveSet(var TempPaymentServiceSetup: Record "Payment Service Setup" temporary): Integer
Parameters
| Name | Type | Description |
|---|---|---|
| TempPaymentServiceSetup | Table Microsoft.Bank.Setup."Payment Service Setup" |
Returns
| Type | Description |
|---|---|
| Integer |
LoadSet
procedure LoadSet(var TempPaymentServiceSetup: Record "Payment Service Setup" temporary, SetID: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| TempPaymentServiceSetup | Table Microsoft.Bank.Setup."Payment Service Setup" | |
| SetID | Integer |
GetSelectedPaymentsText
procedure GetSelectedPaymentsText(SetID: Integer): Text
Parameters
| Name | Type | Description |
|---|---|---|
| SetID | Integer |
Returns
| Type | Description |
|---|---|
| Text |
CanChangePaymentService
procedure CanChangePaymentService(DocumentVariant: Variant): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| DocumentVariant | Variant |
Returns
| Type | Description |
|---|---|
| Boolean |
ChangePaymentServicePostedInvoice
procedure ChangePaymentServicePostedInvoice(var SalesInvoiceHeader: Record "Sales Invoice Header")
Parameters
| Name | Type | Description |
|---|---|---|
| SalesInvoiceHeader | Table Microsoft.Sales.History."Sales Invoice Header" |
IsPaymentServiceVisible
procedure IsPaymentServiceVisible(): Boolean
Returns
| Type | Description |
|---|---|
| Boolean |
NewPaymentService
procedure NewPaymentService(): Boolean
Returns
| Type | Description |
|---|---|
| Boolean |
AssignPrimaryKey
procedure AssignPrimaryKey(var PaymentServiceSetup: Record "Payment Service Setup")
Parameters
| Name | Type | Description |
|---|---|---|
| PaymentServiceSetup | Table Microsoft.Bank.Setup."Payment Service Setup" |
DeletePaymentServiceSetup
procedure DeletePaymentServiceSetup(RunTrigger: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| RunTrigger | Boolean |
TermsOfServiceDrillDown
procedure TermsOfServiceDrillDown()
Events
OnRegisterPaymentServices
Integration event for registering available payment services in the system. Enables extensions to add custom payment service configurations.
[IntegrationEvent(False,False)]
procedure OnRegisterPaymentServices(var PaymentServiceSetup: Record "Payment Service Setup")
Parameters
| Name | Type | Description |
|---|---|---|
| PaymentServiceSetup | Table Microsoft.Bank.Setup."Payment Service Setup" |
Temporary record for collecting payment service registrations |
Remarks
Raised during payment service discovery to allow extensions to register their services.
OnRegisterPaymentServiceProviders
Integration event for registering payment service providers and their capabilities. Allows extensions to define new payment provider types and configurations.
[IntegrationEvent(False,False)]
procedure OnRegisterPaymentServiceProviders(var PaymentServiceSetup: Record "Payment Service Setup")
Parameters
| Name | Type | Description |
|---|---|---|
| PaymentServiceSetup | Table Microsoft.Bank.Setup."Payment Service Setup" |
Record for provider registration and setup |
Remarks
Raised when building the list of available payment service providers.
OnBeforeCanUsePaymentMethod
Integration event raised before checking if a payment method can be used. Enables custom validation logic for payment method availability.
[IntegrationEvent(False,False)]
local procedure OnBeforeCanUsePaymentMethod(PaymentMethodCode: Code[10], var Result: Boolean, var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| PaymentMethodCode | Code[10] |
Payment method code being validated |
| Result | Boolean |
Whether the payment method can be used (can be modified by subscribers) |
| IsHandled | Boolean |
Set to true to skip standard validation logic |
Remarks
Raised from CanUsePaymentMethod function before standard payment method validation.
OnCreatePaymentService
Integration event for custom payment service creation logic. Allows extensions to perform additional setup when creating payment services.
[IntegrationEvent(False,False)]
procedure OnCreatePaymentService(var PaymentServiceSetup: Record "Payment Service Setup")
Parameters
| Name | Type | Description |
|---|---|---|
| PaymentServiceSetup | Table Microsoft.Bank.Setup."Payment Service Setup" |
Payment service setup record being created |
Remarks
Raised when a new payment service is being created through the setup process.
OnDoNotIncludeAnyPaymentServicesOnAllDocuments
Integration event raised when removing payment services from all documents. Enables custom cleanup logic when disabling payment service integration.
[IntegrationEvent(False,False)]
procedure OnDoNotIncludeAnyPaymentServicesOnAllDocuments()
Remarks
Raised when globally disabling payment service inclusion on documents.
OnCanChangePaymentServiceOnAfterGetRecordRef
Integration event raised after determining document context for payment service changes. Enables custom validation logic for payment service modification permissions.
[IntegrationEvent(False,False)]
local procedure OnCanChangePaymentServiceOnAfterGetRecordRef(DocumentVariant: Variant, DocumentRecordRef: RecordRef, var Result: Boolean, var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| DocumentVariant | Variant |
Document record being evaluated |
| DocumentRecordRef | RecordRef |
Record reference for the document |
| Result | Boolean |
Whether payment service can be changed (can be modified by subscribers) |
| IsHandled | Boolean |
Set to true to skip standard validation logic |
Remarks
Raised from CanChangePaymentService function after getting document record reference.