MarketPe APIs
Payment Testing

API Testing

Test UAT payment api

Perform these tests when you have received your UAT api key. You can use postman or any other tool.

Call payment/get endpoint without providing an API key in the request headers.

Expected Result: Forbidden

Call payment/get endpoint with a valid API key, but for a payment request that doesn't exist yet.

{
    "clientPaymentId": "yourid01"
}

Expected Result: PR not found

Use payment/create endpoint to create PR.

{
  "clientPaymentId": "yourid01",
  "paymentInstrument": {
    "bankAccountNumber": "026291800001191",
    "bankIfscCode": "YESB0000262"
  },
  "vendor": {
    "name": "AMEYA ANIL"
  }
}

Expected Result: Error as amount is required

Use payment/create endpoint to create PR.

{
  "clientPaymentId": "yourid01",
  "amount": "100.45",
  "paymentInstrument": {
    "bankAccountNumber": "026291800001191",
    "bankIfscCode": "YESB0000262"
  },
  "vendor": {
    "name": "AMEYA ANIL"
  }
}

Expected Result: Get success with PR in NEW state.

Call payment/get endpoint with the clientPaymentId from previous step.

Expected Result: PR is found with status NEW.

Note that even though you passed same clientPaymentId in step 3 and 4, you did not get error in step 4. This is because in step 3 marketpe did not accept your request and so PR was never created. Marketpe gaurantees that 2 PRs with same clientPaymentId cannot be created.

Check Marketpe App

Expected Result: PR you just created is visible in the UI.

Execute the PR from UI by entering your PIN.

Expected Result: PR is changed to status PROCESSINGin UI.

Call payment/get endpoint immediately after execution.

Expected Result: PR is found with status PROCESSING.

Call payment/get endpoint after 5 minutes.

Expected Result: PR is found with status COMPLETED.

Check if webhook was received (if configured).

Expected Result: payment/completed event is received via webhook.

Call payment/create endpoint with the same clientPaymentId from step 4.

{
  "clientPaymentId": "yourid01",
  "amount": "100.45",
  "paymentInstrument": {
    "bankAccountNumber": "026291800001191",
    "bankIfscCode": "YESB0000262"
  },
  "vendor": {
    "name": "AMEYA ANIL"
  }
}

Expected Result: Error - clientPaymentId already exists

Call payment/cancel endpoint for the completed PR.

Expected Result: Error - PR is not in NEW state

Last updated on