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:

  1. The POS system receives a refund request and verifies the original transaction's status through the Transaction Query API.
  2. Confirm the refund request
  3. 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.
  4. 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-Requisites

Transaction status: Have a transaction made with thestatusparameter on "success"

Key Notes for Implementation

  1. 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.
  2. API Endpoints:

    • Transaction Query: Verifies the status of the original transaction before processing a refund.
    • Refund Transaction: Initiates the refund request using transactionNo or reference.
  3. 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.
  4. Validation:

    • All API requests require a valid verifySign for authentication.
    • A successful operation is indicated by ret_code = 000100.
  5. Common Error Scenarios:

    • Invalid or missing transactionNo or reference.
    • Incorrect or mismatched refund parameters.
    • Errors in verifying the verifySign.
    • Failure to receive webhook notifications due to IPN misconfiguration.

API Workflow

📘

API References for Endpoints in this Workflow:

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.

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.