Overview
The Payment Module in the Exsited SDK provides a robust set of tools to handle payment-related operations within your application. It allows developers to streamline payment processing, apply payments to invoices, and retrieve detailed payment histories for auditing or reconciliation purposes. Designed for versatility, this module supports a wide range of payment processors and ensures accurate financial tracking.
Common Import Requirements
The following imports are required when working with any payment-related functions in both Python and PHP.
from exsited.exsited.exsited_sdk import ExsitedSDK
from exsited.common.ab_exception import ABException
from exsited.common.sdk_conf import SDKConfig
from config import CommonData
use Api\Component\ApiConfig;
use Api\AppService\Payment\PaymentData;
use Api\ApiHelper\Config\ConfigManager;
Creating a Basic Payment
Function: createBasicPayment()
Purpose
The function creates a payment for a specified invoice by submitting payment details, including the payment processor, amount, and reference. It also includes additional details such as the payment date and associated notes. The function validates the payment and returns the payment details upon success.
Parameters
Parameter | Type | Description |
---|---|---|
INVOICE_ID | String | The unique identifier for the invoice associated with the payment. |
PAYMENT_DATE | String (Date) | The date when the payment was made (format: YYYY-MM-DD). |
PAYMENT_NOTE | String | A note or description related to the payment. |
PROCESSOR | String | The processor or method of payment (e.g., "Cash", "Credit"). |
AMOUNT | String (Decimal) | The amount of money applied in the payment (e.g., "20.00"). |
REFERENCE | String | A reference or identifier for the payment transaction. |
Use Case
This function can be used to process payments and apply them to invoices. It is useful when creating payments for outstanding invoices in the system, ensuring the correct amount is applied and reconciling the payment with the invoice.
def create_basic_payment():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
payment_applied = PaymentAppliedDTO(processor="PROCESSOR", amount="AMOUNT", reference="REFERENCE")
payment_data = PaymentDataDTO(date="PAYMENT_DATE", paymentApplied=[payment_applied], note="PAYMENT_NOTE")
request_data = PaymentCreateDTO(payment=payment_data)
response = exsited_sdk.payment.create(invoice_id="INVOICE_ID", request_data=request_data)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function createBasicPayment()
{
$invoiceId = "INVOICE_ID";
$params = [
"payment" => [
"date" => "PAYMENT_DATE",
"note" => "PAYMENT_NOTE",
"payment_applied" => [
[
"processor" => "PROCESSOR",
"amount" => "AMOUNT",
"reference" => "REFERENCE"
]
]
]
];
try {
$response = $this->paymentService->createSinglePayment($invoiceId, $params);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response contains the details of the created payment, including the payment status, ID, applied amount, payment processor, reference, and invoice details. It also includes reconciliation status, total applied, and timestamps for creation and updates. The response can be used to verify the successful application of the payment to the specified invoice.
ItemResponseDTO(
item=ItemDataDTO(
status='STATUS',
id='ITEM_ID',
name='ITEM_NAME',
displayName='DISPLAY_NAME',
description='DESCRIPTION',
type='TYPE',
baseUom='BASE_UOM',
parentItemId=None,
origin='ORIGIN',
createdBy='CREATED_BY',
createdOn='CREATED_ON',
lastUpdatedBy='LAST_UPDATED_BY',
lastUpdatedOn='LAST_UPDATED_ON',
uuid='UUID',
version='VERSION',
imageUri='IMAGE_URI',
group=None,
manager=None,
customForm=CustomFormDTO(
name='CUSTOM_FORM_NAME',
uuid='CUSTOM_FORM_UUID'
),
customAttributes=[],
customObjects=[],
codes=[
CodesDTO(name='CODE_NAME_1', value='CODE_VALUE_1'),
CodesDTO(name='CODE_NAME_2', value='CODE_VALUE_2')
],
uoms=[],
currencies=[
CurrenciesDTO(
name='CURRENCY_NAME_1',
usedForSale='USED_FOR_SALE',
defaultForSale='DEFAULT_FOR_SALE',
usedForPurchase='USED_FOR_PURCHASE',
defaultForPurchase='DEFAULT_FOR_PURCHASE'
),
CurrenciesDTO(
name='CURRENCY_NAME_2',
usedForSale='USED_FOR_SALE',
defaultForSale='DEFAULT_FOR_SALE',
usedForPurchase='USED_FOR_PURCHASE',
defaultForPurchase='DEFAULT_FOR_PURCHASE'
)
],
sale=SaleDTO(
enabled='SALE_ENABLED',
invoiceNote='INVOICE_NOTE',
accountingCode=AccountingCodeDTO(salesRevenue=None),
defaultSalePrice='DEFAULT_SALE_PRICE',
shippingProfile='SHIPPING_PROFILE',
taxExemptWhenSold='TAX_EXEMPT_WHEN_SOLD',
pricingMethod='PRICING_METHOD',
taxConfiguration=SaleTaxConfigurationDTO(
salePriceEnteredIsInclusiveOfTax='TAX_INCLUDED',
salePriceIsBasedOn=None,
taxCode=None
),
pricingProfile=None,
pricingSchedules=None,
pricingLevels=[],
charge=SaleChargeDTO(
type='CHARGE_TYPE',
pricePeriod=None,
properties=[
SaleChargePropertiesDTO(name='PROPERTY_NAME_1', value='PROPERTY_VALUE_1'),
SaleChargePropertiesDTO(name='PROPERTY_NAME_2', value='PROPERTY_VALUE_2')
]
),
paymentProperties=[
SaleChargePropertiesDTO(name='PROPERTY_NAME_1', value='PROPERTY_VALUE_1'),
SaleChargePropertiesDTO(name='PROPERTY_NAME_2', value='PROPERTY_VALUE_2')
],
discountProfile={},
pricing=PricingDTO(
type='PRICING_TYPE',
version='VERSION',
latestUsedPricingVersion='LATEST_PRICING_VERSION',
pricingModule=[]
),
width=None,
height=None,
length=None,
weight=None,
useOnSalePrice=None,
salePriceVariant=None,
salePrice=None,
startDate=None,
endDate=None
),
purchase=PurchaseDTO(
enabled='PURCHASE_ENABLED',
enableSupplierManagement='SUPPLIER_MANAGEMENT_ENABLED',
accountingCode=AccountingCodeDTO(salesRevenue=None),
purchaseOrderNote='PURCHASE_NOTE',
defaultPurchasePrice='DEFAULT_PURCHASE_PRICE',
taxExemptWhenPurchase='TAX_EXEMPT_WHEN_PURCHASED',
taxConfiguration=PurchaseTaxConfigurationDTO(
purchasePriceEnteredIsInclusiveOfTax='TAX_INCLUDED'
),
pricingProfile=None,
purchaseProperties=[
PurchasePropertiesDTO(name='PROPERTY_NAME_1', value='PROPERTY_VALUE_1'),
PurchasePropertiesDTO(name='PROPERTY_NAME_2', value='PROPERTY_VALUE_2')
],
pricing=PricingDTO(
type='PRICING_TYPE',
version='VERSION',
latestUsedPricingVersion='LATEST_PRICING_VERSION',
pricingModule=[]
),
suppliers=None
),
inventories=InventoriesDTO(
isEnabled='INVENTORY_ENABLED',
preorderPeriod=None,
warehouseIsEnabled='WAREHOUSE_ENABLED',
warehouses=[
InventoryWarehouseDTO(
name='WAREHOUSE_NAME',
uuid='WAREHOUSE_UUID',
link='WAREHOUSE_LINK',
quantityOnHand='QUANTITY_ON_HAND',
quantityOnHandValue='QUANTITY_ON_HAND_VALUE',
quantityPromised='QUANTITY_PROMISED',
quantityOnOrder='QUANTITY_ON_ORDER',
quantityOnReturn='QUANTITY_ON_RETURN',
quantityOnPurchaseReturn='QUANTITY_ON_PURCHASE_RETURN',
quantityAvailable='QUANTITY_AVAILABLE',
quantityAvailableValue='QUANTITY_AVAILABLE_VALUE',
uom='UOM'
)
],
inventoryProperties=InventoryPropertiesDTO(
quantityAvailableForSaleDetermination=['DETERMINATION_METHOD'],
quantityAvailableForSale='QUANTITY_AVAILABLE_FOR_SALE',
enableLowStockNotification='ENABLE_LOW_STOCK_NOTIFICATION',
lowStockThresholdIsBasedOn='LOW_STOCK_THRESHOLD',
enableReordering='ENABLE_REORDERING',
reorderingThresholdIsBasedOn='REORDERING_THRESHOLD'
)
),
kpis=KpisDTO(
totalRevenue='TOTAL_REVENUE',
totalCollected='TOTAL_COLLECTED',
totalOutstanding='TOTAL_OUTSTANDING',
totalOverdue='TOTAL_OVERDUE'
)
)
)
{
"item": {
"status": "STATUS",
"id": "ITEM_ID",
"name": "ITEM_NAME",
"display_name": "DISPLAY_NAME",
"description": "DESCRIPTION",
"type": "ITEM_TYPE",
"base_uom": "BASE_UOM",
"origin": "ORIGIN",
"created_by": "CREATED_BY",
"created_on": "CREATED_ON",
"last_updated_by": "LAST_UPDATED_BY",
"last_updated_on": "LAST_UPDATED_ON",
"uuid": "UUID",
"version": "VERSION",
"image_uri": "IMAGE_URI",
"custom_form": {
"name": "CUSTOM_FORM_NAME",
"uuid": "CUSTOM_FORM_UUID"
},
"custom_attributes": [],
"custom_objects": [],
"codes": [
{
"name": "CODE_NAME_1",
"value": "CODE_VALUE_1"
},
{
"name": "CODE_NAME_2",
"value": "CODE_VALUE_2"
}
],
"uoms": [],
"currencies": [
{
"name": "CURRENCY_NAME",
"isUsedForSale": "IS_USED_FOR_SALE",
"isDefaultForSale": "IS_DEFAULT_FOR_SALE",
"isUsedForPurchase": "IS_USED_FOR_PURCHASE",
"isDefaultForPurchase": "IS_DEFAULT_FOR_PURCHASE"
}
],
"sale": {
"isEnabled": "SALE_ENABLED",
"invoice_note": "INVOICE_NOTE",
"accounting_code": [],
"default_sale_price": "DEFAULT_SALE_PRICE",
"shipping_profile": "SHIPPING_PROFILE",
"isTaxExemptWhenSold": "IS_TAX_EXEMPT_WHEN_SOLD",
"pricing_method": "PRICING_METHOD",
"tax_configuration": {
"sale_price_entered_is_inclusive_of_tax": "SALE_PRICE_INCLUSIVE_TAX"
},
"pricing_levels": [],
"charge": {
"type": "CHARGE_TYPE",
"properties": [
{
"name": "PROPERTY_NAME_1",
"value": "PROPERTY_VALUE_1"
},
{
"name": "PROPERTY_NAME_2",
"value": "PROPERTY_VALUE_2"
}
]
},
"payment_properties": [
{
"name": "PROPERTY_NAME_1",
"value": "PROPERTY_VALUE_1"
},
{
"name": "PROPERTY_NAME_2",
"value": "PROPERTY_VALUE_2"
},
{
"name": "PROPERTY_NAME_3",
"value": "PROPERTY_VALUE_3"
},
{
"name": "PROPERTY_NAME_4",
"value": "PROPERTY_VALUE_4"
}
],
"discount_profile": [],
"pricing": {
"type": "PRICING_TYPE",
"version": "VERSION",
"latest_used_pricing_version": "LATEST_USED_PRICING_VERSION",
"pricing_module": []
},
"use_on_sale_price": "USE_ON_SALE_PRICE",
"sale_price_variant": "SALE_PRICE_VARIANT",
"sale_price": "SALE_PRICE",
"start_date": "START_DATE",
"end_date": "END_DATE"
},
"purchase": {
"isEnabled": "PURCHASE_ENABLED",
"supplier_management_isEnabled": "SUPPLIER_MANAGEMENT_ENABLED",
"purchase_properties": [
{
"name": "PROPERTY_NAME_1",
"value": "PROPERTY_VALUE_1"
},
{
"name": "PROPERTY_NAME_2",
"value": "PROPERTY_VALUE_2"
}
]
},
"inventories": {
"isEnabled": "INVENTORIES_ENABLED",
"warehouse_isEnabled": "WAREHOUSE_ENABLED",
"warehouses": [
{
"name": "WAREHOUSE_NAME",
"uuid": "WAREHOUSE_UUID",
"link": "WAREHOUSE_LINK",
"quantity_on_hand": "QUANTITY_ON_HAND",
"quantity_promised": "QUANTITY_PROMISED",
"quantity_on_order": "QUANTITY_ON_ORDER",
"quantity_on_return": "QUANTITY_ON_RETURN",
"quantity_on_purchase_return": "QUANTITY_ON_PURCHASE_RETURN",
"quantity_available": "QUANTITY_AVAILABLE",
"uom": "UOM"
}
],
"inventory_properties": {
"quantity_available_for_sale_determination": [
"DETERMINATION_METHOD"
],
"quantity_available_for_sale": "QUANTITY_AVAILABLE_FOR_SALE",
"enable_low_stock_notification": "LOW_STOCK_NOTIFICATION_ENABLED",
"low_stock_threshold_is_based_on": "LOW_STOCK_THRESHOLD",
"enable_reordering": "ENABLE_REORDERING",
"reordering_threshold_is_based_on": "REORDERING_THRESHOLD"
}
}
}
}
Getting Payment Details of a Specific Invoice
Function: getInvoicePaymentDetails()
Purpose
The function retrieves detailed payment information for a specified invoice. This function is useful for reviewing payment transactions, reconciling records, and ensuring the correct application of payments to the invoice.
Parameters
Parameter | Type | Description |
---|---|---|
INVOICE_ID | String | The unique identifier of the invoice for which payment details are being retrieved. |
Use Case
This function can be used when detailed payment information is required for auditing, customer queries, or verifying payment records against a specific invoice. For example, it can be applied in financial systems to review applied payments and their statuses.
def get_invoice_payment_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.invoice_details(id='INVOICE_ID')
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getInvoicePaymentDetails()
{
$invoiceId = 'INVOICE_ID';
try {
$response = $this->paymentService->readInvoicePaymentDetails($invoiceId);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns detailed information about the payments associated with the specified invoice. This includes the unique payment ID, the amount applied to the invoice, the payment processor used (e.g., card or direct debit), a reference for the transaction, and the current status of the payment, such as successful, pending, or failed.
PaymentInvoiceResponseDTO(
invoice=PaymentListDTO(
payments=[
PaymentDataDTO(
id='PAYMENT_ID_1',
date='PAYMENT_DATE_1',
status='PAYMENT_STATUS_1',
reconcileStatus='RECONCILE_STATUS_1',
totalApplied='TOTAL_APPLIED_1',
paymentApplied=[
PaymentAppliedDTO(
processor='PROCESSOR_1',
amount=AMOUNT_1,
reference='REFERENCE_1',
method='METHOD_1'
)
],
note='NOTE_1',
creditApplied=[],
invoices=[
InvoiceDTO(
applied='APPLIED_AMOUNT_1',
code='INVOICE_CODE_1',
dueDate='DUE_DATE_1',
issueDate='ISSUE_DATE_1',
outstanding='OUTSTANDING_AMOUNT_1',
total='TOTAL_AMOUNT_1'
)
],
createdBy='CREATED_BY_1',
createdOn='CREATED_ON_1',
lastUpdatedBy='LAST_UPDATED_BY_1',
lastUpdatedOn='LAST_UPDATED_ON_1',
uuid='UUID_1',
version='VERSION_1',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID_2',
date='PAYMENT_DATE_2',
status='PAYMENT_STATUS_2',
reconcileStatus='RECONCILE_STATUS_2',
totalApplied='TOTAL_APPLIED_2',
paymentApplied=[
PaymentAppliedDTO(
processor='PROCESSOR_2',
amount=AMOUNT_2,
reference='REFERENCE_2',
method='METHOD_2'
)
],
note='NOTE_2',
creditApplied=[],
invoices=[
InvoiceDTO(
applied='APPLIED_AMOUNT_2',
code='INVOICE_CODE_2',
dueDate='DUE_DATE_2',
issueDate='ISSUE_DATE_2',
outstanding='OUTSTANDING_AMOUNT_2',
total='TOTAL_AMOUNT_2'
)
],
createdBy='CREATED_BY_2',
createdOn='CREATED_ON_2',
lastUpdatedBy='LAST_UPDATED_BY_2',
lastUpdatedOn='LAST_UPDATED_ON_2',
uuid='UUID_2',
version='VERSION_2',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID_3',
date='PAYMENT_DATE_3',
status='PAYMENT_STATUS_3',
reconcileStatus='RECONCILE_STATUS_3',
totalApplied='TOTAL_APPLIED_3',
paymentApplied=[
PaymentAppliedDTO(
processor='PROCESSOR_3',
amount=AMOUNT_3,
reference='REFERENCE_3',
method='METHOD_3'
)
],
note='NOTE_3',
creditApplied=[],
invoices=[
InvoiceDTO(
applied='APPLIED_AMOUNT_3',
code='INVOICE_CODE_3',
dueDate='DUE_DATE_3',
issueDate='ISSUE_DATE_3',
outstanding='OUTSTANDING_AMOUNT_3',
total='TOTAL_AMOUNT_3'
)
],
createdBy='CREATED_BY_3',
createdOn='CREATED_ON_3',
lastUpdatedBy='LAST_UPDATED_BY_3',
lastUpdatedOn='LAST_UPDATED_ON_3',
uuid='UUID_3',
version='VERSION_3',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
)
],
pagination=PaginationDTO(
records='TOTAL_RECORDS',
limit='LIMIT',
offset='OFFSET',
previousPage='PREVIOUS_PAGE',
nextPage='NEXT_PAGE'
)
)
)
{
"invoice": {
"payments": [
{
"status": "PAYMENT_STATUS_1",
"id": "PAYMENT_ID_1",
"date": "PAYMENT_DATE_1",
"reconcile_status": "RECONCILE_STATUS_1",
"total_applied": "TOTAL_APPLIED_1",
"payment_applied": [
{
"amount": "AMOUNT_1",
"method": "METHOD_1",
"processor": "PROCESSOR_1",
"reference": "REFERENCE_1"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "APPLIED_AMOUNT_1",
"code": "INVOICE_CODE_1",
"due_date": "DUE_DATE_1",
"issue_date": "ISSUE_DATE_1",
"outstanding": "OUTSTANDING_AMOUNT_1",
"total": "TOTAL_AMOUNT_1"
}
],
"created_by": "CREATED_BY_1",
"created_on": "CREATED_ON_1",
"last_updated_by": "LAST_UPDATED_BY_1",
"last_updated_on": "LAST_UPDATED_ON_1",
"uuid": "UUID_1",
"version": "VERSION_1",
"custom_attributes": [],
"custom_objects": []
},
{
"status": "PAYMENT_STATUS_2",
"id": "PAYMENT_ID_2",
"date": "PAYMENT_DATE_2",
"reconcile_status": "RECONCILE_STATUS_2",
"total_applied": "TOTAL_APPLIED_2",
"payment_applied": [
{
"amount": "AMOUNT_2",
"method": "METHOD_2",
"processor": "PROCESSOR_2",
"reference": "REFERENCE_2"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "APPLIED_AMOUNT_2",
"code": "INVOICE_CODE_2",
"due_date": "DUE_DATE_2",
"issue_date": "ISSUE_DATE_2",
"outstanding": "OUTSTANDING_AMOUNT_2",
"total": "TOTAL_AMOUNT_2"
}
],
"created_by": "CREATED_BY_2",
"created_on": "CREATED_ON_2",
"last_updated_by": "LAST_UPDATED_BY_2",
"last_updated_on": "LAST_UPDATED_ON_2",
"uuid": "UUID_2",
"version": "VERSION_2",
"custom_attributes": [],
"custom_objects": []
},
{
"status": "PAYMENT_STATUS_3",
"id": "PAYMENT_ID_3",
"date": "PAYMENT_DATE_3",
"reconcile_status": "RECONCILE_STATUS_3",
"total_applied": "TOTAL_APPLIED_3",
"payment_applied": [
{
"amount": "AMOUNT_3",
"method": "METHOD_3",
"processor": "PROCESSOR_3",
"reference": "REFERENCE_3"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "APPLIED_AMOUNT_3",
"code": "INVOICE_CODE_3",
"due_date": "DUE_DATE_3",
"issue_date": "ISSUE_DATE_3",
"outstanding": "OUTSTANDING_AMOUNT_3",
"total": "TOTAL_AMOUNT_3"
}
],
"created_by": "CREATED_BY_3",
"created_on": "CREATED_ON_3",
"last_updated_by": "LAST_UPDATED_BY_3",
"last_updated_on": "LAST_UPDATED_ON_3",
"uuid": "UUID_3",
"version": "VERSION_3",
"custom_attributes": [],
"custom_objects": []
}
],
"pagination": {
"records": "TOTAL_RECORDS",
"limit": "LIMIT",
"offset": "OFFSET",
"previous_page": "PREVIOUS_PAGE",
"next_page": "NEXT_PAGE"
}
}
}
Getting a List of Payments
Function: getPaymentList()
Purpose
The function retrieves a list of all recorded payments in the system. It provides a structured way to access payment history, ensuring seamless integration with financial tracking and reconciliation processes.
Parameters
This function does not require any input parameters.
Use Case
This function can be used in applications that need to monitor and manage payments. For instance, an accounting system can use this function to display all processed payments, track outstanding amounts, and generate financial reports. This helps maintain accurate payment records and enhances transaction visibility.
def get_payment_list():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.list()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getPaymentList(){
try {
$payments = $this->paymentService->readAll();
echo '<pre>' . json_encode($payments, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
Returns a list of payments, including details such as payment IDs, amounts, dates, methods, and statuses. In case of an error, detailed error messages and raw responses are provided.
PaymentListDTO(
payments=[
PaymentDataDTO(
id="PLACEHOLDER_PAYMENT_ID_1",
date="YYYY-MM-DDTHH:MM:SSZ",
status="ACTIVE",
reconcileStatus="PLACEHOLDER_RECONCILE_STATUS",
totalApplied="PLACEHOLDER_TOTAL_APPLIED",
paymentApplied=[
PaymentAppliedDTO(
processor="PLACEHOLDER_PROCESSOR",
amount=PLACEHOLDER_AMOUNT,
reference="PLACEHOLDER_REFERENCE",
method="PLACEHOLDER_METHOD"
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied="PLACEHOLDER_APPLIED_AMOUNT",
code="PLACEHOLDER_INVOICE_CODE",
dueDate="YYYY-MM-DDTHH:MM:SSZ",
issueDate="YYYY-MM-DDTHH:MM:SSZ",
outstanding="PLACEHOLDER_OUTSTANDING_AMOUNT",
total="PLACEHOLDER_TOTAL_AMOUNT"
)
],
createdBy="PLACEHOLDER_CREATED_BY",
createdOn="YYYY-MM-DDTHH:MM:SSZ",
lastUpdatedBy="PLACEHOLDER_LAST_UPDATED_BY",
lastUpdatedOn="YYYY-MM-DDTHH:MM:SSZ",
uuid="UUID-PLACEHOLDER-1",
version="PLACEHOLDER_VERSION",
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id="PLACEHOLDER_PAYMENT_ID_2",
date="YYYY-MM-DDTHH:MM:SSZ",
status="ACTIVE",
reconcileStatus="PLACEHOLDER_RECONCILE_STATUS",
totalApplied="PLACEHOLDER_TOTAL_APPLIED",
paymentApplied=[
PaymentAppliedDTO(
processor="PLACEHOLDER_PROCESSOR",
amount=PLACEHOLDER_AMOUNT,
reference="PLACEHOLDER_REFERENCE",
method="PLACEHOLDER_METHOD"
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied="PLACEHOLDER_APPLIED_AMOUNT",
code="PLACEHOLDER_INVOICE_CODE",
dueDate="YYYY-MM-DDTHH:MM:SSZ",
issueDate="YYYY-MM-DDTHH:MM:SSZ",
outstanding="PLACEHOLDER_OUTSTANDING_AMOUNT",
total="PLACEHOLDER_TOTAL_AMOUNT"
)
],
createdBy="PLACEHOLDER_CREATED_BY",
createdOn="YYYY-MM-DDTHH:MM:SSZ",
lastUpdatedBy="PLACEHOLDER_LAST_UPDATED_BY",
lastUpdatedOn="YYYY-MM-DDTHH:MM:SSZ",
uuid="UUID-PLACEHOLDER-2",
version="PLACEHOLDER_VERSION",
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
)
],
pagination=PaginationDTO(
records=PLACEHOLDER_RECORD_COUNT,
limit=PLACEHOLDER_LIMIT,
offset=PLACEHOLDER_OFFSET,
previousPage="PLACEHOLDER_PREVIOUS_PAGE",
nextPage="PLACEHOLDER_NEXT_PAGE"
)
)
{
"payments": [
{
"status": "ACTIVE",
"id": "PLACEHOLDER_PAYMENT_ID_1",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"reconcile_status": "PLACEHOLDER_RECONCILE_STATUS",
"total_applied": "PLACEHOLDER_TOTAL_APPLIED",
"payment_applied": [
{
"amount": PLACEHOLDER_AMOUNT,
"method": "PLACEHOLDER_METHOD",
"processor": "PLACEHOLDER_PROCESSOR",
"reference": "PLACEHOLDER_REFERENCE"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "PLACEHOLDER_APPLIED_AMOUNT",
"code": "PLACEHOLDER_INVOICE_CODE",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "PLACEHOLDER_OUTSTANDING_AMOUNT",
"total": "PLACEHOLDER_TOTAL_AMOUNT"
}
],
"created_by": "PLACEHOLDER_CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "PLACEHOLDER_LAST_UPDATED_BY",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER-1",
"version": "PLACEHOLDER_VERSION",
"custom_attributes": [],
"custom_objects": []
},
{
"status": "ACTIVE",
"id": "PLACEHOLDER_PAYMENT_ID_2",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"reconcile_status": "PLACEHOLDER_RECONCILE_STATUS",
"total_applied": "PLACEHOLDER_TOTAL_APPLIED",
"payment_applied": [
{
"amount": PLACEHOLDER_AMOUNT,
"method": "PLACEHOLDER_METHOD",
"processor": "PLACEHOLDER_PROCESSOR",
"reference": "PLACEHOLDER_REFERENCE"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "PLACEHOLDER_APPLIED_AMOUNT",
"code": "PLACEHOLDER_INVOICE_CODE",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "PLACEHOLDER_OUTSTANDING_AMOUNT",
"total": "PLACEHOLDER_TOTAL_AMOUNT"
}
],
"created_by": "PLACEHOLDER_CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "PLACEHOLDER_LAST_UPDATED_BY",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER-2",
"version": "PLACEHOLDER_VERSION",
"custom_attributes": [],
"custom_objects": []
}
],
"pagination": {
"records": PLACEHOLDER_RECORD_COUNT,
"limit": PLACEHOLDER_LIMIT,
"offset": PLACEHOLDER_OFFSET,
"previous_page": "PLACEHOLDER_PREVIOUS_PAGE",
"next_page": "PLACEHOLDER_NEXT_PAGE"
}
}
Getting Specific Payment Details
Function: getPaymentDetails()
Purpose
The function fetches detailed information about a specific payment based on the payment ID. It is designed to provide a complete view of the payment transaction, including key details such as transaction amounts, status, payment method, and related references.
Parameters
Parameter | Type | Description |
---|---|---|
PAYMENT_ID | String | The unique identifier for the payment whose details are being requested. |
Use Case
This function can be used for auditing individual transactions, resolving payment disputes, or reviewing payment history for specific orders. It is commonly used in financial reporting, customer service inquiries, and system integrations where precise transaction data is necessary for accurate decision-making or troubleshooting.
def get_payment_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.details(id='PAYMENT_ID')
print(response)
return response
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getPaymentDetails()
{
$id = 'PAYMENT_ID';
try {
$response = $this->paymentService->readDetails($id);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response includes comprehensive details about the payment, such as the payment ID, transaction status, amounts, payment method, and timestamps. In case of an error, the response provides an error message and raw data to assist in troubleshooting.
PaymentDetailsDTO(
payment=PaymentDataDTO(
id="PMT-UUID-PLACEHOLDER",
date="YYYY-MM-DDTHH:MM:SSZ",
status="ACTIVE",
reconcileStatus="NOT_RECONCILE",
totalApplied="AMOUNT_PLACEHOLDER",
paymentApplied=[
PaymentAppliedDTO(
processor="PROCESSOR_PLACEHOLDER",
amount="AMOUNT_PLACEHOLDER",
reference="REFERENCE_PLACEHOLDER",
method="METHOD_PLACEHOLDER"
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied="AMOUNT_PLACEHOLDER",
code="INV-UUID-PLACEHOLDER",
dueDate="YYYY-MM-DDTHH:MM:SSZ",
issueDate="YYYY-MM-DDTHH:MM:SSZ",
outstanding="AMOUNT_PLACEHOLDER",
total="AMOUNT_PLACEHOLDER"
)
],
createdBy="CREATOR_PLACEHOLDER",
createdOn="YYYY-MM-DDTHH:MM:SSZ",
lastUpdatedBy="",
lastUpdatedOn="YYYY-MM-DDTHH:MM:SSZ",
uuid="UUID-PLACEHOLDER",
version="VERSION_PLACEHOLDER",
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
)
)
{
"payment": {
"status": "ACTIVE",
"id": "PMT-UUID-PLACEHOLDER",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"reconcile_status": "NOT_RECONCILE",
"total_applied": "AMOUNT_PLACEHOLDER",
"payment_applied": [
{
"amount": "AMOUNT_PLACEHOLDER",
"method": "METHOD_PLACEHOLDER",
"processor": "PROCESSOR_PLACEHOLDER",
"reference": "REFERENCE_PLACEHOLDER"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "AMOUNT_PLACEHOLDER",
"code": "INV-UUID-PLACEHOLDER",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "AMOUNT_PLACEHOLDER",
"total": "AMOUNT_PLACEHOLDER"
}
],
"created_by": "CREATOR_PLACEHOLDER",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "VERSION_PLACEHOLDER",
"custom_attributes": [],
"custom_objects": []
}
}
Getting a Payment List of a Specific Account
Function: getAccountPaymentDetails()
Purpose
The function provides detailed information about all payments associated with a specific account. This allows businesses to track payment history, review payment statuses, and analyze account-specific financial activities.
Parameters
Parameter | Type | Description |
---|---|---|
ACCOUNT_ID | String | The unique identifier for the account whose payment details are being retrieved. |
Use Case
This function can be used for analyzing a customer's payment patterns, resolving account-related billing queries, and generating account-specific financial reports.
def get_account_payment_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.account_details(id='ACCOUNT_ID')
print(response)
return response
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getAccountPaymentDetails()
{
$accountId = 'ACCOUNT_ID';
try {
$response = $this->paymentService->readAccountPaymentDetails($accountId);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response delivers a comprehensive list of payment transactions linked to the specified account. It includes payment IDs, amounts, statuses, payment methods, timestamps, and other metadata. In cases of errors, detailed error messages and raw response data are provided to facilitate troubleshooting.
PaymentAccountResponseDTO(
account=PaymentListDTO(
payments=[
PaymentDataDTO(
id="PAYMENT-ID-PLACEHOLDER-1",
date="YYYY-MM-DDTHH:MM:SSZ",
status="ACTIVE",
reconcileStatus="NOT_RECONCILE",
totalApplied="PLACEHOLDER-AMOUNT",
paymentApplied=[
PaymentAppliedDTO(
processor="PROCESSOR-NAME-PLACEHOLDER",
amount=PLACEHOLDER-AMOUNT,
reference="REFERENCE-PLACEHOLDER",
method="METHOD-PLACEHOLDER"
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied="PLACEHOLDER-AMOUNT",
code="INVOICE-CODE-PLACEHOLDER",
dueDate="YYYY-MM-DDTHH:MM:SSZ",
issueDate="YYYY-MM-DDTHH:MM:SSZ",
outstanding="PLACEHOLDER-AMOUNT",
total="PLACEHOLDER-AMOUNT"
)
],
createdBy="CREATOR-NAME-PLACEHOLDER",
createdOn="YYYY-MM-DDTHH:MM:SSZ",
lastUpdatedBy="",
lastUpdatedOn="YYYY-MM-DDTHH:MM:SSZ",
uuid="UUID-PLACEHOLDER-1",
version="VERSION-PLACEHOLDER",
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id="PAYMENT-ID-PLACEHOLDER-2",
date="YYYY-MM-DDTHH:MM:SSZ",
status="ACTIVE",
reconcileStatus="NOT_RECONCILE",
totalApplied="PLACEHOLDER-AMOUNT",
paymentApplied=[
PaymentAppliedDTO(
processor="PROCESSOR-NAME-PLACEHOLDER",
amount=PLACEHOLDER-AMOUNT,
reference="REFERENCE-PLACEHOLDER",
method="METHOD-PLACEHOLDER"
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied="PLACEHOLDER-AMOUNT",
code="INVOICE-CODE-PLACEHOLDER",
dueDate="YYYY-MM-DDTHH:MM:SSZ",
issueDate="YYYY-MM-DDTHH:MM:SSZ",
outstanding="PLACEHOLDER-AMOUNT",
total="PLACEHOLDER-AMOUNT"
)
],
createdBy="CREATOR-NAME-PLACEHOLDER",
createdOn="YYYY-MM-DDTHH:MM:SSZ",
lastUpdatedBy="",
lastUpdatedOn="YYYY-MM-DDTHH:MM:SSZ",
uuid="UUID-PLACEHOLDER-2",
version="VERSION-PLACEHOLDER",
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
)
],
pagination=PaginationDTO(
records=PLACEHOLDER-RECORDS,
limit=PLACEHOLDER-LIMIT,
offset=PLACEHOLDER-OFFSET,
previousPage="PLACEHOLDER-PREVIOUS-PAGE",
nextPage="PLACEHOLDER-NEXT-PAGE"
)
)
)
{
"account": {
"payments": [
{
"status": "ACTIVE",
"id": "PAYMENT-ID-PLACEHOLDER-1",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"reconcile_status": "NOT_RECONCILE",
"total_applied": "PLACEHOLDER-AMOUNT",
"payment_applied": [
{
"amount": PLACEHOLDER-AMOUNT,
"method": "METHOD-PLACEHOLDER",
"processor": "PROCESSOR-NAME-PLACEHOLDER",
"reference": "REFERENCE-PLACEHOLDER"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "PLACEHOLDER-AMOUNT",
"code": "INVOICE-CODE-PLACEHOLDER",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "PLACEHOLDER-AMOUNT",
"total": "PLACEHOLDER-AMOUNT"
}
],
"created_by": "CREATOR-NAME-PLACEHOLDER",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER-1",
"version": "VERSION-PLACEHOLDER",
"custom_attributes": [],
"custom_objects": []
},
{
"status": "ACTIVE",
"id": "PAYMENT-ID-PLACEHOLDER-2",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"reconcile_status": "NOT_RECONCILE",
"total_applied": "PLACEHOLDER-AMOUNT",
"payment_applied": [
{
"amount": PLACEHOLDER-AMOUNT,
"method": "METHOD-PLACEHOLDER",
"processor": "PROCESSOR-NAME-PLACEHOLDER",
"reference": "REFERENCE-PLACEHOLDER"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "PLACEHOLDER-AMOUNT",
"code": "INVOICE-CODE-PLACEHOLDER",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "PLACEHOLDER-AMOUNT",
"total": "PLACEHOLDER-AMOUNT"
}
],
"created_by": "CREATOR-NAME-PLACEHOLDER",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER-2",
"version": "VERSION-PLACEHOLDER",
"custom_attributes": [],
"custom_objects": []
}
],
"pagination": {
"records": PLACEHOLDER-RECORDS",
"limit": "PLACEHOLDER-LIMIT",
"offset": "PLACEHOLDER-OFFSET",
"previous_page": "PLACEHOLDER-PREVIOUS-PAGE",
"next_page": "PLACEHOLDER-NEXT-PAGE"
}
}
}
Getting a Payment List of a Specific Order
Function: getOrderPaymentDetails()
Purpose
The function fetches detailed payment information for a specific order. This function is essential for tracking payments related to individual orders, validating transactions, and resolving order-specific payment issues. It aids in enhancing customer support and ensuring accurate financial records.
Parameters
Parameter | Type | Description |
---|---|---|
ORDER_ID | String | The unique identifier of the order for which payment details are being retrieved. |
Use Case
This function can be used for businesses needing to examine payment details for specific orders. It supports use cases such as verifying successful transactions, troubleshooting failed payments, and reconciling order-level payment records. This function also enhances the ability to handle customer inquiries regarding order payments and contributes to efficient financial management.
def get_order_payment_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.order_details(id='ORDER_ID')
print(response)
return response
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getOrderPaymentDetails()
{
$orderId = 'ORDER_ID';
try {
$response = $this->paymentService->readOrderPaymentDetails($orderId);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response includes a detailed record of the payment associated with the specified order. This may encompass payment ID, amount, status, method, transaction date, and any associated metadata. Error responses provide descriptive messages and raw data for debugging and analysis.
PaymentOrderResponseDTO(
order=PaymentListDTO(
payments=[
PaymentDataDTO(
id="PAYMENT-ID-PLACEHOLDER-1",
date="YYYY-MM-DDTHH:MM:SSZ",
status="ACTIVE",
reconcileStatus="NOT_RECONCILE",
totalApplied="PLACEHOLDER-AMOUNT",
paymentApplied=[
PaymentAppliedDTO(
processor="PROCESSOR-NAME-PLACEHOLDER",
amount=PLACEHOLDER-AMOUNT,
reference="REFERENCE-PLACEHOLDER",
method="METHOD-PLACEHOLDER"
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied="PLACEHOLDER-AMOUNT",
code="INVOICE-CODE-PLACEHOLDER",
dueDate="YYYY-MM-DDTHH:MM:SSZ",
issueDate="YYYY-MM-DDTHH:MM:SSZ",
outstanding="PLACEHOLDER-AMOUNT",
total="PLACEHOLDER-AMOUNT"
)
],
createdBy="CREATOR-NAME-PLACEHOLDER",
createdOn="YYYY-MM-DDTHH:MM:SSZ",
lastUpdatedBy="",
lastUpdatedOn="YYYY-MM-DDTHH:MM:SSZ",
uuid="UUID-PLACEHOLDER-1",
version="VERSION-PLACEHOLDER",
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id="PAYMENT-ID-PLACEHOLDER-2",
date="YYYY-MM-DDTHH:MM:SSZ",
status="ACTIVE",
reconcileStatus="NOT_RECONCILE",
totalApplied="PLACEHOLDER-AMOUNT",
paymentApplied=[
PaymentAppliedDTO(
processor="PROCESSOR-NAME-PLACEHOLDER",
amount=PLACEHOLDER-AMOUNT,
reference="REFERENCE-PLACEHOLDER",
method="METHOD-PLACEHOLDER"
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied="PLACEHOLDER-AMOUNT",
code="INVOICE-CODE-PLACEHOLDER",
dueDate="YYYY-MM-DDTHH:MM:SSZ",
issueDate="YYYY-MM-DDTHH:MM:SSZ",
outstanding="PLACEHOLDER-AMOUNT",
total="PLACEHOLDER-AMOUNT"
)
],
createdBy="CREATOR-NAME-PLACEHOLDER",
createdOn="YYYY-MM-DDTHH:MM:SSZ",
lastUpdatedBy="",
lastUpdatedOn="YYYY-MM-DDTHH:MM:SSZ",
uuid="UUID-PLACEHOLDER-2",
version="VERSION-PLACEHOLDER",
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
)
],
pagination=PaginationDTO(
records=PLACEHOLDER-RECORDS,
limit=PLACEHOLDER-LIMIT,
offset=PLACEHOLDER-OFFSET,
previousPage="PLACEHOLDER-PREVIOUS-PAGE",
nextPage="PLACEHOLDER-NEXT-PAGE"
)
)
)
{
"order": {
"payments": [
{
"status": "ACTIVE",
"id": "PAYMENT-ID-PLACEHOLDER-1",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"reconcile_status": "NOT_RECONCILE",
"total_applied": "PLACEHOLDER-AMOUNT",
"payment_applied": [
{
"amount": PLACEHOLDER-AMOUNT,
"method": "METHOD-PLACEHOLDER",
"processor": "PROCESSOR-NAME-PLACEHOLDER",
"reference": "REFERENCE-PLACEHOLDER"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "PLACEHOLDER-AMOUNT",
"code": "INVOICE-CODE-PLACEHOLDER",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "PLACEHOLDER-AMOUNT",
"total": "PLACEHOLDER-AMOUNT"
}
],
"created_by": "CREATOR-NAME-PLACEHOLDER",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER-1",
"version": "VERSION-PLACEHOLDER",
"custom_attributes": [],
"custom_objects": []
},
{
"status": "ACTIVE",
"id": "PAYMENT-ID-PLACEHOLDER-2",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"reconcile_status": "NOT_RECONCILE",
"total_applied": "PLACEHOLDER-AMOUNT",
"payment_applied": [
{
"amount": PLACEHOLDER-AMOUNT,
"method": "METHOD-PLACEHOLDER",
"processor": "PROCESSOR-NAME-PLACEHOLDER",
"reference": "REFERENCE-PLACEHOLDER"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "PLACEHOLDER-AMOUNT",
"code": "INVOICE-CODE-PLACEHOLDER",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "PLACEHOLDER-AMOUNT",
"total": "PLACEHOLDER-AMOUNT"
}
],
"created_by": "CREATOR-NAME-PLACEHOLDER",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER-2",
"version": "VERSION-PLACEHOLDER",
"custom_attributes": [],
"custom_objects": []
}
],
"pagination": {
"records": PLACEHOLDER-RECORDS,
"limit": PLACEHOLDER-LIMIT,
"offset": PLACEHOLDER-OFFSET,
"previous_page": "PLACEHOLDER-PREVIOUS-PAGE",
"next_page": "PLACEHOLDER-NEXT-PAGE"
}
}
}
Deleting a Specific Payment
Function: deletePayment()
Purpose
The function removes a specified payment record from the system. It is designed to facilitate the removal of outdated, incorrect, or redundant payment entries associated with an account. This ensures that the payment database remains accurate and clutter-free while maintaining data integrity.
Note: Online payments can not be deleted.
Parameters
Parameter | Type | Description |
---|---|---|
PAYMENT_ID | String | The unique identifier of the payment to be deleted. |
Use Case
The function is ideal for managing payment records that are no longer needed, such as duplicate entries, records created in error, or test data. It is particularly useful for maintaining the accuracy of financial records, ensuring regulatory compliance, and preventing inconsistencies in account-related payment data.
def delete_payment():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.delete(id="PAYMENT_ID")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function deletePayment()
{
$id = 'PAYMENT_ID';
try {
$response = $this->paymentService->delete($id);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
A confirmation of the successful deletion of the specified payment record is returned. In case of an error, detailed error messages and the raw response are provided for debugging purposes.
{
"success": true,
"status_code": 204
}
null
Configuration
Before using any of these functions, ensure that your API credentials are properly configured.
- Python: The request token is retrieved from CommonData.get_request_token_dto().
- PHP: Configuration is managed via ConfigManager and $this->paymentManager.
Language-Specific Features
Feature |
Python Implementation |
PHP Implementation |
---|---|---|
SDK Initialization |
ExsitedSDK().init_sdk() |
$this->paymentManager |
Exception Handling |
ABException handles errors and raw response |
try-catch block for exceptions |
Response Format |
Prints response using print() |
Outputs response using json_encode() |
Configuration |
Managed through SDKConfig |
Managed via ConfigManager |
Authentication Method |
OAuth token via CommonData.get_request_token_dto() |
API credentials via $this->paymentManager |
Error Logging |
Captures errors with ABException and prints raw response |
Captures exceptions and prints error message |
Data Parsing |
JSON response parsed natively in Python |
JSON encoded and displayed using PHP |
Error Output |
print(ab.get_errors()) and ab.raw_response |
echo 'Error: ' . $e->getMessage() |