Task #795
openEpic #786: Square Payment Gateway Integration
Feature #793: Core Payment Processing
Implement Payment Creation API
0%
Description
Develop backend service to create payment requests using Square Payments API. The service should accept amount, currency, customer ID, and payment source (token/card). Implement support for both authorization and immediate capture flows. Ensure idempotency key is used to prevent duplicate transactions.
Updated by Deeksha Singh about 1 month ago ยท Edited
Module: Implement Payment Creation API
TC_ID_PAYMENT_01
Title: Verify payment is created successfully with valid details
Preconditions: Valid customer_id and source_id available
Steps:
Call payment API
Pass required fields
Test Data: amount, currency, customer_id, source_id
Expected Result: Payment created successfully with transaction ID
TC_ID_PAYMENT_02
Title: Verify payment fails when required fields are missing
Preconditions: Payment API available
Steps:
Call payment API with missing fields
Test Data: missing amount or source_id
Expected Result: Validation error returned
TC_ID_PAYMENT_03
Title: Verify correct amount and currency are sent in request
Preconditions: Payment API working
Steps:
Call API
Check request payload
Test Data: amount, currency
Expected Result: Same values sent in request
TC_ID_PAYMENT_04
Title: Verify payment fails with invalid payment token
Preconditions: Payment API available
Steps:
Call API with invalid source_id
Test Data: invalid token
Expected Result: Payment failed with error response
TC_ID_PAYMENT_05
Title: Verify idempotency prevents duplicate payment creation
Preconditions: Same request sent multiple times
Steps:
Call API with same idempotency key
Test Data: same payload, same idempotency key
Expected Result: Only one payment created
TC_ID_PAYMENT_06
Title: Verify authorization flow works correctly
Preconditions: Authorization flow enabled
Steps:
Call API with autocomplete false
Test Data: valid payment details
Expected Result: Payment authorized but not captured
TC_ID_PAYMENT_07
Title: Verify immediate capture flow works correctly
Preconditions: Default flow enabled
Steps:
Call API
Test Data: valid payment details
Expected Result: Payment captured immediately
TC_ID_PAYMENT_08
Title: Verify payment response is stored correctly
Preconditions: Payment successful
Steps:
Call API
Check database
Test Data: payment response
Expected Result: Payment ID, status, and amount stored
TC_ID_PAYMENT_09
Title: Verify handling of large amount values
Preconditions: Payment API available
Steps:
Call API with high amount
Test Data: large amount
Expected Result: Payment processed or validation error
TC_ID_PAYMENT_10
Title: Verify error handling when payment API fails
Preconditions: API failure scenario
Steps:
Call payment API
Test Data: API failure
Expected Result: Proper error response, no duplicate payment
Updated by Deeksha Singh about 1 month ago
- Status changed from New to Ready for Client