Wikifreedia
All versions

layout: default title: Payment Handler description: Handle payment requests on behalf of a user —

DVMs providing this service are capable of handling recurring payments on behalf of users. The user for whom payments are handled can be defined by an optional p param

Input

This job request takes no inputs.

Params (all optional)

  • nwc - A Nostr Wallet Connect
  • p - Pubkey of the target user for whom all kind:7001s should be handled
  • relays - A list of relays for kind:7001 and kind:7002 events.

When a nwc param is provided, that NWC should be used to perform payments. When no nwc param is provided the DVM can use a “balance” or any other means it chooses (i.e. the user may have a custodial wallet with the provider funded via credit card payments, LN/ecash deposits, etc.)

When a p param is provided, the DVM should handle all kind:7001 events for the user with the provided pubkey. If no p tag is provided then the pubkey of the job request is used.

Output

When the DVM stops handling payments for a user, it should publish a kind:6906 event acknowledging of service to this job request.

{
    "content": "",
    "kind": 6906,
    "tags": [
        [ "e", "<5906-event-job-request>" ],
        [ "p", "<pubkey-a>" ],
    ]
}

Feedback

Job feedback is sent back the moment an event is scheduled.

{
    "content": nip04_encrypt("
        [ \"status\", \"success\", \"Job has been scheduled, you can manage it on <....>\" ]
    "),
    "kind": 7000,
    "tags": [
        [ "e", "<5905-event-job-request>" ],
        [ "p", "<pubkey-a>" ],
        [ "encrypted" ]
    ]
}

Example

Request

pubkey-a requesting DVM dvm-pubkey to begin handling pubkey-b’s recurring payments.

{
    "content": nip04_encrypt("
        [ \"param\", \"nwc\", \"nostr+walletconnect://....\" ],
        [ \"param\", \"p\", \"<pubkey-b>\" ]
    "),
    "kind": 5906,
    "pubkey": "<pubkey-a>",
    "tags": [
        [ "p", "<dvm-pubkey>" ],
        [ "encrypted" ]
    ]
}

Upon reception of this request, the DVM should

{
    "content": nip04_encrypt("
        [ \"param\", \"nwc\", \"nostr+walletconnect://....\" ],
        [ \"param\", \"p\", \"<pubkey-b>\" ]
    "),
    "kind": 5906,
    "pubkey": "<pubkey-a>",
    "tags": [
        [ "p", "<dvm-pubkey>" ],
        [ "encrypted" ]
    ]
}

Feedback

A feedback

Desponse

{
    "content": "<eventid-of-1040-event>",
    "kind": 6900,
    "tags": [
        [ "p", "<pubkey-a>" ],
        [ "e", "<event-id-of-5900>" ]
    ]
}

Other authors

No one else has published this topic yet.