make-a-payment
Last updated: 2025-01-21 01:10:36.669346 File source: link on GitLab
Make a Payment
Actors
Primary Actor: AI Developer
Supporting Actors:
Payment Service
Billing Microservice
DID Resolver
Goal in Context:
The user wants to make a crypto payment for services (e.g., hosting, compute) securely using their DID.
Preconditions:
The user has a DID and a wallet capable of signing transactions.
The Payment Service supports DID Auth and crypto payments.
The Billing Microservice has generated a payment request.
Trigger:
The Billing Microservice generates a payment request for the user.
Main Success Scenario:
Payment request:
The Payment Service notifies the user of a pending payment request.
Authenticate user:
The Payment Service generates a cryptographic challenge and sends it to the user.
The user signs the challenge using their DID private key and sends it back.
The Payment Service verifies the signature using the DID Document.
Process payment:
The user sends the payment transaction via their wallet.
The Payment Service verifies the payment and updates the user’s account status.
Confirm payment:
The Payment Service confirms the successful payment to the user and the Billing Microservice.
Extensions:
Authentication failure:
If the user fails to sign the challenge correctly, the Payment Service rejects the payment request.
Payment failure:
If the crypto payment fails (e.g., insufficient funds), the service notifies the user to retry.
Timeout:
If payment is not completed within a specified time, the request expires.
Functional Requirements
To be rewritten in Gherkin features as use-case specific regression tests and integrated into test-suite.
Make a payment: As a user, I want to make a crypto payment for services securely using my DID so that I can pay for my usage without exposing sensitive credentials.
The Payment Service must authenticate the user using DID Auth before processing the payment.
The user must be able to sign the payment request with their wallet.
The system must verify the payment transaction and update the user’s account status upon successful payment.
The user must receive a confirmation message once the payment is processed.
Verify Payment Status: As a user, I want to check the status of my payment so that I can confirm whether it has been processed successfully.
The Payment Service must authenticate the user using DID Auth before providing payment status information.
The user must be able to view the current status (e.g., pending, completed, failed) of their payment.
If authentication fails, the system must deny the request and notify the user.
Request a Refund: As a user, I want to request a refund for an overpayment or unused service so that I can recover my funds securely.
The Payment Service must authenticate the user using DID Auth before processing the refund request.
The system must verify the user’s wallet ownership and ensure that the refund amount is valid.
The user must receive a confirmation message once the refund is processed.
Last updated