Skip to content

Commit

Permalink
Separate payment processor fees (#506)
Browse files Browse the repository at this point in the history
* implement support for separate payment processor fees
* update GraphQL schema
  • Loading branch information
znarf authored Dec 6, 2023
1 parent f6e6ccb commit 30b9740
Show file tree
Hide file tree
Showing 4 changed files with 5,312 additions and 2,766 deletions.
50 changes: 25 additions & 25 deletions docs/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,45 +48,45 @@ The URL should be: https://opencollective.com/{slug}/admin/for-developers

## Fields

| Name | GraphQL v2 | Description | Included? |
| -------------------- | -------------------------------- | --------------------------------------------------------- | ------------------------------- |
| Name | GraphQL v2 | Description | Included? |
| -------------------- | -------------------------------- | --------------------------------------------------------- | ------------------------------------------- |
| date | createdAt | UTC date (ISO 8601) |
| datetime | createdAt | UTC date and time with a second precision (ISO 8601) | Yes |
| datetime | createdAt | UTC date and time with a second precision (ISO 8601) | Yes |
| id | id | unique identifier for the transaction |
| shortId | id | first 8 characters of the `id` | Yes |
| shortId | id | first 8 characters of the `id` | Yes |
| legacyId | legacyId | auto-increment identifier for the transaction |
| group | group | group identifier of the transaction |
| shortGroup | group | first 8 characters of the `group` | Yes |
| description | description | human readable description of the transaction | Yes |
| type | type | `CREDIT` or `DEBIT` | Yes |
| kind | kind | `CONTRIBUTION`, `ADDED_FUNDS`, `EXPENSE`, etc ... | Yes |
| isRefund | isRefund | `REFUND` if it's a refund, empty if not | Yes |
| isRefunded | isRefunded | `REFUNDED` if it was refunded, empty if not | Yes |
| displayAmount | amount | user facing amount and currency as a string | Yes |
| amount | amountInHostCurrency.value | accounted amount | Yes |
| paymentProcessorFee | paymentProcessorFee.value | accounted payment processor fee | Yes |
| hostFee | hostFee.value | accounted host fee | Yes (if flattenHostFee is used) |
| netAmount | netAmountInHostCurrency.value | accounted amount after payment processor fees | Yes |
| balance | balanceInHostCurrency.value | balance of the account after the transaction | Yes (not for hostTransactions) |
| currency | netAmountInHostCurrency.currency | accounted currency | Yes |
| accountSlug | account.slug | slug of the account on the main side of the transaction | Yes |
| accountName | account.name | name of the account on the main side of the transaction | Yes |
| shortGroup | group | first 8 characters of the `group` | Yes |
| description | description | human readable description of the transaction | Yes |
| type | type | `CREDIT` or `DEBIT` | Yes |
| kind | kind | `CONTRIBUTION`, `ADDED_FUNDS`, `EXPENSE`, etc ... | Yes |
| isRefund | isRefund | `REFUND` if it's a refund, empty if not | Yes |
| isRefunded | isRefunded | `REFUNDED` if it was refunded, empty if not | Yes |
| displayAmount | amount | user facing amount and currency as a string | Yes |
| amount | amountInHostCurrency.value | accounted amount | Yes |
| paymentProcessorFee | paymentProcessorFee.value | accounted payment processor fee | Yes (if flattenPaymentProcessorFee is used) |
| hostFee | hostFee.value | accounted host fee | Yes (if flattenHostFee is used) |
| netAmount | netAmountInHostCurrency.value | accounted amount after payment processor fees | Yes |
| balance | balanceInHostCurrency.value | balance of the account after the transaction | Yes (not for hostTransactions) |
| currency | netAmountInHostCurrency.currency | accounted currency | Yes |
| accountSlug | account.slug | slug of the account on the main side of the transaction | Yes |
| accountName | account.name | name of the account on the main side of the transaction | Yes |
| accountType | account.type | type of the account on the main side of the transaction |
| oppositeAccountSlug | oppositeAccount.slug | slug of the account on the opposite side | Yes |
| oppositeAccountName | oppositeAccount.name | name of the account on the opposite side | Yes |
| oppositeAccountSlug | oppositeAccount.slug | slug of the account on the opposite side | Yes |
| oppositeAccountName | oppositeAccount.name | name of the account on the opposite side | Yes |
| oppositeAccountType | oppositeAccount.type | type of the account on the opposite side |
| hostSlug | host.slug | slug of the host accounting the transaction |
| oppositeAccountName | oppositeAccount.name | name of the host accounting the transaction |
| oppositeAccountType | oppositeAccount.type | type of the host accounting the transaction |
| orderId | order.id | unique identifier for the order |
| orderLegacyId | order.legacyId | auto-increment identifier for the order |
| orderFrequency | order.frequency | frequency of the order (`ONETIME`, `MONTHLY` or `YEARLY`) |
| paymentMethodService | paymentMethod.service | service of the payment method ( `STRIPE`, etc ...) | Yes |
| paymentMethodType | paymentMethod.type | type of the payment method (`CREDITCARD`, etc ...) | Yes |
| paymentMethodService | paymentMethod.service | service of the payment method ( `STRIPE`, etc ...) | Yes |
| paymentMethodType | paymentMethod.type | type of the payment method (`CREDITCARD`, etc ...) | Yes |
| expenseId | expense.id | unique identifier for the expense |
| expenseLegacyId | expense.legacyId | auto-increment identifier for the expense |
| expenseType | expense.type | type of the expense (`INVOICE`, `RECEIPT`, etc ...) | Yes |
| payoutMethodType | payoutMethod.type | type of the payout method (`PAYPAL`, etc ...) | Yes |
| expenseType | expense.type | type of the expense (`INVOICE`, `RECEIPT`, etc ...) | Yes |
| payoutMethodType | payoutMethod.type | type of the payout method (`PAYPAL`, etc ...) | Yes |

### Adding fields

Expand Down
Loading

0 comments on commit 30b9740

Please sign in to comment.