Payment Processing Synchronization
Documentation for the real-time payment processing synchronization between KDL and SAT systems
Payment Processing Synchronization
The payment processing synchronization ensures that all payment transactions recorded in KDL are reliably and securely transferred to SAT through a queued job system, supporting real-time financial reconciliation and reporting.
Overview
This real-time integration point uses Laravel's queue system to process payment transactions asynchronously. When a payment is recorded in KDL, it triggers a queued job that securely transmits the payment data to SAT with proper authentication and error handling.
Technical Details
Code Location
- Job Class:
PostPaymentToSat(app/Jobs/PostPaymentToSat.php) - Queue Configuration: Laravel queue system
- Services Used:
GuzzleActions: HTTP client for API requestsAuthenticateSAT: Authentication service
Execution Model
// Payment job dispatch
dispatch(new PostPaymentToSat($paymentData));
// Job execution (asynchronous)
class PostPaymentToSat implements ShouldQueue
{
public function handle()
{
// Process payment to SAT
}
}Data Mapping
| KDL Property | SAT Field | Description | Example |
|---|---|---|---|
TransactionType | TransactionType | Type of payment transaction | "Pay Bill" |
TransID | TransID | Payment transaction ID | "MPT123456789" |
TransTime | TransTime | Timestamp of transaction | "20240115103000" |
Amount | TransAmount | Payment amount | "1500.00" |
ShortCode | BusinessShortCode | Business shortcode | "174379" |
BillRefNumber | BillRefNumber | Bill reference number | "INV-2024-001" |
InvoiceNumber | InvoiceNumber | Related invoice number | "INV-2024-001" |
OrgAccountBalance | OrgAccountBalance | Account balance after transaction | "25000.00" |
ThirdPartyTransID | ThirdPartyTransID | Third-party transaction ID | "LHG31AA5TX" |
Msisdn | MSISDN | Payer phone number | "254700000000" |
FirstName | FirstName | Payer first name | "John" |
MiddleName | MiddleName | Payer middle name | "Doe" |
LastName | LastName | Payer last name | "Smith" |
Sample Data Structure
{
"TransactionType": "Pay Bill",
"TransID": "MPT123456789",
"TransTime": "20240115103000",
"TransAmount": "1500.00",
"BusinessShortCode": "174379",
"BillRefNumber": "INV-2024-001",
"InvoiceNumber": "INV-2024-001",
"OrgAccountBalance": "25000.00",
"ThirdPartyTransID": "LHG31AA5TX",
"MSISDN": "254700000000",
"FirstName": "John",
"MiddleName": "Doe",
"LastName": "Smith"
}Troubleshooting
Issue: Payments Not Processing
Symptoms: Payments stuck in queue or failing Diagnostic Steps:
- Check queue worker status
- Verify SAT API connectivity
- Review authentication credentials
- Check payment data format
Solutions:
# Restart queue workers
php artisan queue:restart
# Check failed jobs
php artisan queue:failed