Skip to main content
GitHub entitlement는 결제한 고객을 비공개 repository의 collaborator로 추가합니다. 권한 수준(pull, push, triage, maintain 또는 admin)을 선택할 수 있습니다. Dodo Payments는 collaborator 초대를 보내고 grant가 철회되면 collaborator를 제거합니다.

제공되는 항목

  • 고객은 Customer Portal에서 GitHub 계정을 연결합니다. 이렇게 하면 GitHub 계정이 구매 항목에 연결됩니다.
  • Dodo Payments는 구성된 권한 수준으로 해당 계정을 사용자의 repository에 초대합니다. 고객은 GitHub에서 초대를 수락한 후 액세스 권한을 얻습니다. 고객이 repository 소유자인 경우 초대가 필요하지 않습니다.
  • 취소, 환불 또는 수동 철회가 발생하면 collaborator가 제거되고 대기 중인 초대가 취소됩니다.
일반적인 사용 사례로는 source-available 제품, 유료 템플릿, 강의 코드 repository, 액세스가 제한된 client SDK가 있습니다.

GitHub 연결

1

Open Entitlements

Dodo Payments dashboard에서 Entitlements로 이동한 다음 **+**를 클릭하여 새 entitlement를 시작합니다.
2

Pick GitHub

통합으로 GitHub Access를 선택합니다. 아직 GitHub가 연결되지 않았다면 Connect GitHub를 클릭합니다.
Merchant에게 GitHub 연결을 요청하는 새 entitlement 패널

Connect GitHub prompt before the install handoff.

GitHub가 새 탭에서 열립니다. 로그인한 다음 repository를 소유한 organization 또는 사용자 계정에 Dodo Payments GitHub App을 설치합니다. App에 All repositories 또는 Only select repositories에 대한 액세스 권한을 부여할 수 있습니다. repository를 선택하는 경우 액세스를 제한할 모든 repository를 포함해야 합니다.
GitHub Install and Authorize page with All repositories and Only select repositories options

GitHub Install & Authorize page. Choose which repositories the app can manage.

GitHub가 다시 리디렉션하면 계정이 연결되었음을 보여 주는 확인 페이지가 표시됩니다.
GitHub Access connected successfully confirmation page

Account connected. Return to the Dodo Payments dashboard to continue.

3

Pick a Repository and Permission

Dashboard로 돌아와 entitlement가 액세스 권한을 부여할 Repository를 선택한 다음 Permission 수준을 선택합니다. repository 선택기에는 GitHub App이 액세스할 수 있는 repository만 표시됩니다. entitlement의 Name을 입력하고 Create Entitlement를 클릭합니다.
연결된 GitHub Access, repository 선택기, permission 드롭다운 및 name 필드가 포함된 GitHub entitlement 양식

Creating a GitHub entitlement. Pick the repository and the permission you want customers to receive.

4

Attach It to a Product

entitlement를 원하는 제품에 연결합니다. 해당 제품을 구매한 고객은 GitHub 계정을 연결한 후 GitHub 초대를 받습니다.

권한 수준

entitlement는 GitHub의 표준 repository 권한을 사용합니다:
사용 사례에 맞는 최소 권한을 부여하세요. 대부분의 유료 콘텐츠 제품에는 pull만 필요합니다.

고객 흐름

  1. 고객이 결제를 완료합니다.
  2. Dodo Payments가 Pending 상태로 grant를 생성합니다. Dodo Payments는 즉시 GitHub authorization URL을 생성하려고 시도하고 이를 oauth_url에 저장합니다. 이 작업이 실패하면 고객이 accept flow를 시작할 때까지 oauth_url는 null 상태로 유지됩니다.
  3. 결제 확인 이메일에는 entitlement가 Action Required로 표시되고 Customer Portal 링크가 포함됩니다. 포털에서 고객은 Connect를 클릭하고 GitHub로 authorize합니다. authorization link는 30분 후 만료되며, 고객이 다시 방문하면 Customer Portal에서 새 링크를 생성합니다.
  4. Dodo Payments가 구성된 permission으로 고객의 GitHub account를 repository에 초대합니다. invitation이 생성되면 grant가 Delivered로 변경됩니다. GitHub가 invitation을 거부하면 grant가 전달되지 않습니다.
  5. subscription이 취소되거나 payment가 환불되거나 grant가 revoke되면 Dodo Payments가 collaborator에서 고객을 제거하고 pending invitation을 취소합니다.

필수 구성

API로 생성

Webhooks

표준 entitlement_grant.* webhook events가 GitHub flow를 처리합니다:
  • entitlement_grant.created가 status: "Pending"와 함께 발생합니다. oauth_url에 이미 GitHub authorization URL이 저장되어 있을 수 있습니다. 값이 null인 경우 고객이 Customer Portal에서 accept flow를 시작하면 값이 설정됩니다.
  • collaborator invitation이 생성되면 entitlement_grant.delivered가 발생합니다.
  • access가 철회되면 entitlement_grant.revoked가 발생합니다. GitHub App을 uninstall하면 Dodo Payments가 revocation_reason: platform_external를 사용하여 해당 installation의 pending 및 delivered grant를 revoke합니다.
  • Dodo Payments가 repository에 고객을 추가할 수 없을 때(예: GitHub App이 repository에 대한 access를 잃은 경우) entitlement_grant.failed가 error_code: "GRANT_ACCESS_FAILED"와 함께 발생합니다.

문제 해결

Dodo Payments GitHub App은 repository를 소유한 organization 또는 user에 설치되어 있어야 합니다. entitlement form에서 GitHub card의 Disconnect를 클릭한 다음 Connect GitHub를 클릭하여 app을 다시 설치하고, gate하려는 repository에 대한 access를 부여합니다.
GitHub App의 installation이 더 이상 repository에 액세스할 수 없거나 repository의 이름이 변경되었거나 이전되었습니다. App에 repository 액세스 권한을 다시 부여하면 다음 regrant가 성공합니다.
고객은 GitHub 알림 또는 GitHub 초대 이메일의 링크를 통해 GitHub 초대를 수락합니다. 수락하기 전에는 초대된 상태이지만 repository를 clone할 수 없습니다. Dodo Payments에서 grant는 여전히 Delivered 상태입니다. Dodo Payments가 발급하는 것은 초대이기 때문입니다.
마지막 수정일 2026년 9월 28일