Skip to content
This repository has been archived by the owner on Sep 26, 2020. It is now read-only.

Latest commit

 

History

History
92 lines (64 loc) · 3.14 KB

04-documentation.md

File metadata and controls

92 lines (64 loc) · 3.14 KB
  1. Getting Started
  2. Obtaining OAuth Tokens For Patrons
  3. Patreon Integration Examples
  4. Method Documentation
  5. Library Architecture

Resources

Current User

Access using the me() method on Patreon, e.g: $patreon->me()->get()

  • get() Returns a User. Depending on context, this will either be a Campaign Creator (when accessed using a Creators Access Token) or a User who could be a Patron of the OAuth Client Creator's Campaign.

Campaigns

Access using the campaigns() method on Patreon, e.g: $patreon->campaigns()->getMyCampaign()

  • getMyCampaign() Returns the Campaign belonging to the Creator Access Token owner.
  • getMyCampaignWithPledges() Returns the Campaign belonging to the Creator Access Token owner with the Pledges property populated with all of the Campaign's Pledges.
  • getCampaign(int $id) Returns a Campaign by ID.
  • getCampaignWithPledges(int $id) Returns a Campaign by ID with the Pledges property populated with all of the Campaign's Pledges.

Pledges

Access using the pledges() method on Patreon, e.g: $patreon->pledges()->getCampaignPledges($int $id)

  • getCampaignPledges($int id) Returns a Collection of Pledges.
  • getPageOfCampaignPledges($campaign, $count, $sort, $cursor) Returns a Collection of Pledges for the requested page.

Webhook

Access using the webhook() method on Patreon, e.g: $patreon->webhook()->accept(...)

  • accept($body, $secret, $signature) Verifies the request signature against the body and returns a Collection of Pledges, or throws a SignatureVerificationFailed Exception.

Entities

Address

Campaign

  • 27 Properties — see Entities\Campaign
  • 1 Relation — creator
  • 3 Collections — goals, pledges and rewards
  • 2 helpers — getAvailableRewards(), getPledgeUrl()

Card

Goal

  • 6 Properties — see Entities\Goal
  • 2 Helpers — hasBeenCompleted() and isCompleted()

Pledge

  • 9 Properties — see Entities\Pledge
  • 5 Relations — address, card, creator, patron, reward
  • 4 Helpers — isActive(), isPaymentDeclined(), hasMadeAPayment(), hasReward() getTotalSpent()

Reward

  • 17 Properties — see Entities\Reward
  • 1 Relation — campaign
  • 3 Helpers — isAvailableToChoose(), hasRemainingLimit(), isSystemReward() getPledgeUrl(), getPrice()

User

  • 23 Properties — see Entities\User
  • 1 Relation — campaign
  • 1 Collection — pledges
  • 2 Helpers — hasActivePledge(), isCreator(), hasInactivePledge(), getPledge()