Solutech Engineering

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 requests
    • AuthenticateSAT: 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 PropertySAT FieldDescriptionExample
TransactionTypeTransactionTypeType of payment transaction"Pay Bill"
TransIDTransIDPayment transaction ID"MPT123456789"
TransTimeTransTimeTimestamp of transaction"20240115103000"
AmountTransAmountPayment amount"1500.00"
ShortCodeBusinessShortCodeBusiness shortcode"174379"
BillRefNumberBillRefNumberBill reference number"INV-2024-001"
InvoiceNumberInvoiceNumberRelated invoice number"INV-2024-001"
OrgAccountBalanceOrgAccountBalanceAccount balance after transaction"25000.00"
ThirdPartyTransIDThirdPartyTransIDThird-party transaction ID"LHG31AA5TX"
MsisdnMSISDNPayer phone number"254700000000"
FirstNameFirstNamePayer first name"John"
MiddleNameMiddleNamePayer middle name"Doe"
LastNameLastNamePayer 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:

  1. Check queue worker status
  2. Verify SAT API connectivity
  3. Review authentication credentials
  4. Check payment data format

Solutions:

# Restart queue workers
php artisan queue:restart

# Check failed jobs
php artisan queue:failed