Skip to content

SDP 1685 add create receiver endpoint - #687

Merged
dpohr merged 6 commits into
developfrom
SDP-1685-add-create-receiver-endpoint
May 26, 2025
Merged

SDP 1685 add create receiver endpoint#687
dpohr merged 6 commits into
developfrom
SDP-1685-add-create-receiver-endpoint

Conversation

@dpohr

@dpohr dpohr commented May 20, 2025

Copy link
Copy Markdown
Contributor

What

Implementation of a new POST /receivers endpoint that allows creating receiver records via the API. The endpoint supports creating a receiver with associated verification data and/or wallet information, providing a programmatic way to register receivers that can later be referenced in payments or disbursements.

Key features:

  • Create receiver records with email and/or phone number
  • Associate verification information (date of birth, PIN, etc.)
  • Register wallet addresses with optional memos

Why

This endpoint complements the existing receiver reference model used in payments and disbursements. It provides an API-first approach to receiver management, enhancing the platform's capabilities for integration with external systems.

Known limitations

  • Receivers created through this endpoint will have wallets in "READY" status , indicating they still need to complete the SEP-24 onboarding process before receiving payments.

Checklist

  • Title follows SDP-1234: Add new feature or Chore: Refactor package xyz format. The Jira ticket code was included if available.
  • PR has a focused scope and doesn't mix features with refactoring
  • Tests are included (if applicable)
  • CHANGELOG.md is updated (if applicable)
  • CONFIG/SECRETS changes are updated in helmcharts and deployments (if applicable)
  • Preview deployment works as expected
  • Ready for production

@dpohr
dpohr had a problem deploying to Anchor Integration Tests May 20, 2025 15:48 — with GitHub Actions Failure
@dpohr
dpohr temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) May 20, 2025 15:48 — with GitHub Actions Inactive
@dpohr
dpohr temporarily deployed to Anchor Integration Tests May 20, 2025 16:16 — with GitHub Actions Inactive
@dpohr
dpohr temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) May 20, 2025 16:16 — with GitHub Actions Inactive
@dpohr
dpohr temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) May 20, 2025 17:57 — with GitHub Actions Inactive
@dpohr
dpohr temporarily deployed to Anchor Integration Tests May 20, 2025 17:57 — with GitHub Actions Inactive
@dpohr
dpohr marked this pull request as ready for review May 21, 2025 08:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a new POST /receivers endpoint to create receiver records with associated verification and wallet data through a transactional API call.

  • Introduces endpoint registration in serve.go with role-based middleware.
  • Implements request validation, receiver creation, and insertion of associated verifications and wallets.
  • Adds unit tests to validate proper request handling and error responses.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/serve/serve_test.go Adds a new test case for POST /receivers.
internal/serve/serve.go Registers the new POST /receivers endpoint with appropriate middleware.
internal/serve/httphandler/receiver_handler_test.go Refactors test setup for receiver endpoints using a common DB connection helper.
internal/serve/httphandler/receiver_handler.go Implements validation logic and transactional creation for receivers, verifications, and wallets.
internal/serve/httphandler/receiver_create_handler_test.go Provides comprehensive tests for validation errors and successful receiver creation.

Comment thread internal/serve/httphandler/receiver_handler.go
Comment thread internal/serve/httphandler/receiver_create_handler_test.go Outdated
Comment thread internal/serve/httphandler/receiver_handler.go
Comment thread internal/serve/httphandler/receiver_handler.go Outdated
Comment thread internal/serve/httphandler/receiver_handler.go
Comment thread internal/serve/httphandler/receiver_handler.go
Comment thread internal/serve/httphandler/receiver_handler.go Outdated
Comment thread internal/serve/httphandler/receiver_handler.go Outdated
Comment thread internal/serve/httphandler/receiver_create_handler_test.go Outdated
@dpohr
dpohr temporarily deployed to Anchor Integration Tests May 23, 2025 17:21 — with GitHub Actions Inactive
@dpohr
dpohr temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) May 23, 2025 17:21 — with GitHub Actions Inactive

@philipliu philipliu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dpohr
dpohr temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) May 26, 2025 09:41 — with GitHub Actions Inactive
@dpohr
dpohr temporarily deployed to Anchor Integration Tests May 26, 2025 09:41 — with GitHub Actions Inactive
@dpohr
dpohr merged commit 570187a into develop May 26, 2025
@dpohr
dpohr deleted the SDP-1685-add-create-receiver-endpoint branch May 26, 2025 10:54
philipliu added a commit that referenced this pull request Jun 13, 2025
* SDP-1689 Prevent unregistering user-managed wallets and wallets with in-progress payments. (#683)

* Feat: Turn on service account use in the ap deployment in the helm chart (#679)

### What

Turn on the service account in the helm chart for the ap deployment

### Why

Currently the serviceaccount name is commented out while all the other deployments have the serviceaccountname set up

* Bump vite (#654)

* Bump the minor-and-patch group across 1 directory with 6 updates (#690)

* Bump the minor-and-patch group across 1 directory with 6 updates

Bumps the minor-and-patch group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [github.com/getsentry/sentry-go](https://github.com/getsentry/sentry-go) | `0.32.0` | `0.33.0` |
| [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) | `1.6.1` | `1.6.3` |
| [github.com/segmentio/kafka-go](https://github.com/segmentio/kafka-go) | `0.4.47` | `0.4.48` |
| [github.com/twilio/twilio-go](https://github.com/twilio/twilio-go) | `1.25.1` | `1.26.1` |
| [golang.org/x/crypto](https://github.com/golang/crypto) | `0.37.0` | `0.38.0` |
| [golang.org/x/net](https://github.com/golang/net) | `0.39.0` | `0.40.0` |



Updates `github.com/getsentry/sentry-go` from 0.32.0 to 0.33.0
- [Release notes](https://github.com/getsentry/sentry-go/releases)
- [Changelog](https://github.com/getsentry/sentry-go/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-go@v0.32.0...v0.33.0)

Updates `github.com/nyaruka/phonenumbers` from 1.6.1 to 1.6.3
- [Release notes](https://github.com/nyaruka/phonenumbers/releases)
- [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md)
- [Commits](nyaruka/phonenumbers@v1.6.1...v1.6.3)

Updates `github.com/segmentio/kafka-go` from 0.4.47 to 0.4.48
- [Release notes](https://github.com/segmentio/kafka-go/releases)
- [Commits](segmentio/kafka-go@v0.4.47...v0.4.48)

Updates `github.com/twilio/twilio-go` from 1.25.1 to 1.26.1
- [Release notes](https://github.com/twilio/twilio-go/releases)
- [Changelog](https://github.com/twilio/twilio-go/blob/main/CHANGES.md)
- [Commits](twilio/twilio-go@v1.25.1...v1.26.1)

Updates `golang.org/x/crypto` from 0.37.0 to 0.38.0
- [Commits](golang/crypto@v0.37.0...v0.38.0)

Updates `golang.org/x/net` from 0.39.0 to 0.40.0
- [Commits](golang/net@v0.39.0...v0.40.0)

---
updated-dependencies:
- dependency-name: github.com/getsentry/sentry-go
  dependency-version: 0.33.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: github.com/nyaruka/phonenumbers
  dependency-version: 1.6.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: github.com/segmentio/kafka-go
  dependency-version: 0.4.48
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: github.com/twilio/twilio-go
  dependency-version: 1.26.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: golang.org/x/crypto
  dependency-version: 0.38.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: golang.org/x/net
  dependency-version: 0.40.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update CHANGELOG.md

* Update go.list

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marcelo Salloum <[email protected]>

* SDP 1685 add create receiver endpoint (#687)

* SDP 1685 add create receiver endpoint

* SDP 1685 receiver shadowing fix

* SDP-1685 discussions fix

* Add badges to the README.md file (#691)

### What

Add Several badges to the README.md:

<img width="969" alt="Screenshot 2025-05-23 at 2 19 10 PM" src="https://github.com/user-attachments/assets/d0a45bb4-4d35-4ccb-a9c7-798e16845ffe" />

This includes the DeepWiki badge, which ensures DeepWiki will re-index this repo once a week.

### Why

📈  Kaizen

* chore: bump version to 3.7.1

* Fix stellar.expert pubnet URL configuration in helm chart

* SDP-1630: add api key auth to all SDP endpoints (#681)

* SDP-1630 add api keys middleware

* SDP-1630 fix existing tests

* SDP 1630 merge develop

* SDP 1630

* SDP 1630 gofumpt

* SDP 1630

* SDP 1630 changelog update

* SDP 1630 keys parsing improve

* SDP 1630 update remote debug template file

* SDP-1630 resolve discussions

* SDP 1630 resolve discussion

* SDP 1686 create wallet endpoint update (#696)

* SDP 1686 create wallet endpoint update

* SDP-1686

* SDP-1686 fix test

* SDP-1686

* SDP 1687 update wallet patch endpoint (#697)

* SDP 1686 create wallet endpoint update

* SDP-1686

* SDP-1686 fix test

* SDP-1687 update PATCH endpoint

* SDP 1687 update chengelog

* SDP 1687

* SDP-1687 linter fix

* SDP-1687 discussions fix

* SDP-1687

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Marwen Abid <[email protected]>
Co-authored-by: Traver Tischio <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marcelo Salloum <[email protected]>
Co-authored-by: Denys <[email protected]>
Co-authored-by: Marcelo Salloum dos Santos <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants