Refund Payments
This guide outlines the process of integrating the SecurePay API with in-store POS systems to enable secure, QR code-based payment processing via PayPal.
Introduction
The refund process involves several key steps to ensure proper handling of transactions:
- The POS system receives a refund request and verifies the original transaction's status through the Transaction Query API.
- Confirm the refund request
- The system initiates the refund by calling the Refund Transaction API with the transaction number or reference ID. This generates a unique refund transaction number.
- Pockyt communicates the refund details to the digital wallet network, which processes the request and credits the customer's account with the refunded amount.
Pre-RequisitesTransaction status: Have a transaction made with the
status
parameter on"success"
Key Notes for Implementation
-
Parameters Flow:
transactionNo
: Received during the transaction query step and required for the refund initiation.refundTransactionNo
: Generated upon successful refund initiation, used for tracking and auditing.reference
: The unique ID associated with the original transaction, used in both query and refund steps.
-
API Endpoints:
- Transaction Query: Verifies the status of the original transaction before processing a refund.
- Refund Transaction: Initiates the refund request using
transactionNo
orreference
.
-
Webhook Management:
- IPN URL: Configure an IPN (Instant Payment Notification) URL to receive updates on refund status.
- Ensure validation of
transactionNo
and refund status in webhook notifications.
-
Validation:
- All API requests require a valid
verifySign
for authentication. - A successful operation is indicated by
ret_code = 000100
.
- All API requests require a valid
-
Common Error Scenarios:
- Invalid or missing
transactionNo
orreference
. - Incorrect or mismatched refund parameters.
- Errors in verifying the
verifySign
. - Failure to receive webhook notifications due to IPN misconfiguration.
- Invalid or missing
API Workflow
API References for Endpoints in this Workflow:
- Step 1 Query Transaction Status
- Step 2 Process refund
- Step 3 Generate receipt
Step-by-Step Description of the Recurring Payments Workflow
Step 1: Refund Request
- Action: The Merchant Backend processes a refund request submitted by the customer for a previous payment.
You need a transactionNo and a successful status
Step 2: Query Transaction Status
- Action: The Merchant Backend polls the transaction status to monitor refund progress and handle necessary actions. Refunds are only possible for successful transactions. If the transaction was not successful, a refund cannot be processed.
- Endpoint:
POST /v3/tran-query
First Time Calling SecurePay for Creating VaultId - Key Parameters:
- Request Body: Includes
transactionNo
to retrieve transaction details. - Response: Returns transaction details, including status, amount, currency, and refund progress.
- Request Body: Includes
Step 3: Process Refund
- Action: The Merchant Backend allows the customer to request a refund and initiates the refund request.
- Endpoint:
POST app-data-search/v3/refund
- Key Parameters:
- Request Body: Includes transactionNo of the original payment, refundAmount, currency, and optional parameters like reason for the refund.
- Response: Returns a refundTransactionNo and success status confirming that the refund has been done.
Step 4: Generate Receipt
- Action: After a successful refund request, the Merchant Backend sends a receipt or notification to the customer.
- Process:
- Uses data from the API response to generate a receipt.
- Sends the receipt via email or another preferred method.
- Response: Confirms that the customer has been notified of the refund.
Updated 11 days ago