Start Credit Card Transaction

Start a credit card transaction

POST /api/.../creditcardpayments?task={1}/

This method allows the caller to initiate a credit card transaction on the credit card reader device to pay patron fines.

Request Information

Parameters
Name Type Required Description
fineData DtoFineData Yes Define this parameter in the request body.
task Int Yes Define this parameter in the request query string. Possible values listed in enum CCPaymentTask. Default value is '1'.
  • PatronAccount - 1
  • PatronRegistration - 2
  • CheckOut - 3
  • CheckIn - 4
  • CheckInOverduePendingCharges - 5
  • ResolveLostBilled - 6
  • DeclareLost - 7
  • RenewAndOverdueCharge - 8
DtoFineData
Property Type Nullable Description
PatronID Int Yes Patron ID.
TxnAmount Decimal No Required. Amount to pay. Amount should be equal to the balance owed.
MainTxnIDs List of Int Yes Required if 'task' is 1 (CCPaymentTask.PatronAccount) or '5' (CCPaymentTask.CheckInOverduePendingCharges). List of transaction IDs. Unique identifier for each transaction
PatronPaymentMethod Int No Payment method. Value is 12 for paying by credit card.
FreeTextNote String Yes Notes
Charges List of DtoChargeData Yes Required if 'task' is not '1' or '5'. List of charges that will be charged and paid.
Request body
Example if task=1 (i.e. CCPaymentTask.PatronAccount)
application/json, text/json
{ 
    "PatronID": 1234,
    "TxnAmount" : 12.15, 
    "FreeTextNote" : "Paying by credit card from LEAP",
    "PatronPaymentMethod": 12,
    "MainTxnIDs":
    [
        123,
        124
    ]
}
Example if task=3 (i.e. CCPaymentTask.CheckOut)
application/json, text/json
{ 
    "PatronID": 1234,
    "TxnAmount" : 12.15, 
    "FreeTextNote" : "Checkout from LEAP",
    "PatronPaymentMethod": 12,
    "Charges":
    [
        {
            "TxnAmount": 6.65
            "FreeTextNote": "Overdue charge while renew"
            "FeeReasonCode": 0
        },
        {
            "TxnAmount": 5.50
            "FreeTextNote": "Checkout charge while renew"
            "FeeReasonCode": -11
        }
    ]
}

Response Information

Returns a DtoCCPaymentData object
Example
application/json, text/json
{
        "TrackId": 3302,
        "Guid": "91242415-7546-4bc7-bdd0-fcd50951",
        "VendorId": 0,
        "BaseAddress": null,
        "CustomerID": null,
        "TerminalID": null,
        "UserName": null,
        "Password": null,
        "Amount": null,
        "PatronID": null,
        "Language": null,
        "Result": 0,
        "TrackNumber": null,
        "Error": null,
        "TxnStatus": null,
        "TroutId": null,
        "CCDigits": null,
        "CCType": null,
        "AuthCode": null,
        "Request": null,
        "Response": null,
        "PaymentsServiceUrl": "https://[server_address]/Payments.Service/api/payments/3302?guid=91242415-7546-4bc7-bdd0-fcd50951&amount=12.15"
 }

Reference for Polaris enum values:

enum CCPaymentTask
{
    None = 0,
    PatronAccount = 1,
    PatronRegistration = 2,
    CheckOutCharge = 3,
    OverdueFine = 4,
    CheckInOverduePendingCharges = 5,
    ResolveLostBilled = 6,
    DeclareLost = 7,
    RenewAndOverdueCharge = 8
}

enum PatronAccountTxnCode
{	
    Charge = 1,
    Payment = 2,
    Return = 3,
    Deposit = 4,
    Waive = 5,
    WaiveExistingCharge = 6,
    Forfeit = 7,
    Credit = 8,
    PayRefund = 9,
    AutoWaive = 10
}

enum PatronPaymentMethod
{
    PayFrmCredit = 1,
    PayFrmDeposit = 2,
    DepositFrmCredit = 3,
    CreditFrmDeposit = 4,
    CreditFrmPAY = 5,
    StoredValue = 6,
    Cash = 11,
    CreditCard = 12,
    DebitCard = 13,
    Check = 14,
    Voucher = 15,
    CollectionAgency = 16,
    SmartCard = 17
}

            

HTTP Response Codes

Code Description
200 OK. Success
400 Null object. Bad request
409 CONFLICT. Patron record is secured.