Skip to content

Commit

Permalink
Merge pull request #71 from pay-theory/premain
Browse files Browse the repository at this point in the history
build: v2.22.0
  • Loading branch information
aron23 authored Apr 16, 2024
2 parents cfcfdc5 + 0c7cccf commit 2f0666b
Show file tree
Hide file tree
Showing 84 changed files with 5,298 additions and 4,254 deletions.
1 change: 0 additions & 1 deletion docs/api/_category_.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"position": 1,
"link": {
"type": "generated-index"

}
}
246 changes: 84 additions & 162 deletions docs/api/authorization.md

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions docs/api/deprecated.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
---
sidebar_position: 1000
sidebar_label: 'Deprecated'
title: "Deprecated"
---


## Create One Time Payment

This call was deprecated in favor of the [`createTransaction`](transaction.md#create-transaction) mutation.
The `createTransaction` mutation returns a more detailed response than this call.

```graphql
mutation {
createOneTimePayment(amount: Int,
merchant_uid: String,
payment_method_id: String,
payment_method: PaymentMethodInput,
account_code: String,
currency: String,
fee: Int,
fee_mode: FeeMode,
invoice_id: String,
metadata: JSON,
receipt_description: String,
recurring_id: String,
reference: String,
send_receipt: Boolean) {
amount
card_brand
created_at
currency
last_four
service_fee
status
transaction_id
}
}
```

**Arguments**

| Key | type | description |
|---------------------|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| amount | Int! | The amount of the transaction. If the FeeMode is `SERVICE_FEE`, this is the amount of the transaction before fees. |
| merchant_uid | String! | The Pay Theory unique identifier for the merchant the transaction is for. |
| payment_method_id | String | The Pay Theory unique identifier for the payment method the transaction will be charged to. |
| payment_method | [PaymentMethodInput](payment_method_token.md#payment-method-input-object) | The payment method to be used for the transaction. This is required if you are not passing in a `payment_method_id`. |
| account_code | String | Customer defined account code for the transaction. |
| currency | String | The type of currency for the transaction. Defaults to `USD`. |
| fee | Int | The amount of the fee that will be charged to the payor for the transaction if the FeeMode is `SERVICE_FEE`. |
| fee_mode | FeeMode | The fee mode on the transaction. `SERVICE_FEE` charges the fees to the payor. `MERCHANT_FEE` charges the fees to the merchant. Options are: |
| invoice_id | String | The Pay Theory unique identifier for the invoice the transaction is for. |
| metadata | JSON | Custom defined JSON object to be stored with the transaction. |
| receipt_description | String | The description of the transaction that will be displayed on the receipt. |
| recurring_id | String | The Pay Theory unique identifier for the recurring payment the transaction is for. |
| reference | String | Customer defined reference for the transaction. |
| send_receipt | Boolean | If the receipt should be sent to the payor. Defaults to `false`. It is sent to the email address on file with the payment method. |


**Returns**

```js
{
"data": {
"createOneTimePayment": {
status: TransactionStatus
amount: Int
card_brand: String
last_four: String
service_fee: Int
currency: String
transaction_id: String
created_at: DateTime
}
}
}
```

|Key | type | description |
|-------------------|------------------------------------------|----------------------------------------------------------------------------|
|status | [TransactionStatus](#transaction-status) | The status of the transaction. |
|amount | Int | The amount of the transaction. |
|card_brand | String | The brand of the card used for the transaction. |
|last_four | String | The last four digits of the card or bank account used for the transaction. |
|service_fee | Int | The amount of the service fee charged for the transaction. |
|currency | String | The type of currency for the transaction. |
|transaction_id | String | The Pay Theory unique identifier for the transaction. |
|created_at | DateTime | The date and time the transaction was created. |

***
## Calculate Service Fee Amount

This call was deprecated in favor of the [`serviceFee`](transaction.md#calculate-service-fee) query.
The `serviceFee` query returns a single fee object that contains the fee, total, and adjusted total for the transaction based on the amount and payment method details passed in.

```graphql
{
serviceFeeAmount(amount: Int, merchant_uid: String) {
ach {
adjusted_total
fee
total
}
card {
adjusted_total
fee
total
}
}
}
```

**Arguments**

|Key |type | description |
|-------------------|-------------|---------------------------------------|
|amount |Int |The amount of the transaction.|
|merchant_uid |String |The Pay Theory unique identifier for the merchant the transaction is for.|


**Returns**

```js
{
"data": {
"serviceFeeAmount": {
ach: {
fee: Int
total: Int
adjusted_total: Int
},
card: {
fee: Int
total: Int
adjusted_total: Int
}
}
}
}
```

You are returned two objects, one for ACH and one for Card. Each object contains the following fields:

|Key |type | description |
|-------------------|-------------|---------------------------------------|
|fee |Int |The amount that the service fee should be based on the amount passed in.|
|total |Int |The total amount of the transaction before the service fee. This is what you would want to pass in the `amount` argument for the `createOneTimePayment` call.|
|adjusted_total |Int |The total amount of the transaction after the service fee. This is what you would want to show the payor the total amount of the transaction will be.|
128 changes: 50 additions & 78 deletions docs/api/dispute.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sidebar_position: 8
sidebar_label: 'Dispute'
title: ""
title: "Dispute"
---

# Disputes
Expand All @@ -10,6 +10,7 @@ Disputes are charges that have been contested by a cardholder to their card issu

They could be an `INQUIRY` which is just a request for information, or an actual chargeback in the status `PENDING` which is a request for a charge to be reversed.

***
## The Dispute Object

```graphql
Expand All @@ -31,57 +32,41 @@ They could be an `INQUIRY` which is just a request for information, or an actual
}
```

**merchant_uid**: ID
The Pay Theory unique identifier assigned to the merchant that the dispute belongs to.

**transaction**: Transaction
The transaction object for the transaction that is in dispute. More information on the transaction object can be found [here](transaction).

**dispute_id**: String
The Pay Theory unique dispute identifier.

**status**: DisputeStatus
The status of the dispute. It can be one of the following:
- INQUIRY
- LOST
- PENDING
- WON

**reason**: DisputeReason
The reason code for the dispute as passed by the card issuer. It can be one of the following:
- CLERICAL
- FRAUD
- INQUIRY
- QUALITY
- TECHNICAL

**amount**: Int
The amount of the transaction in dispute.

**dispute_date**: String
The date the dispute was created.

**evidence_last_send_date**: String
The last date evidence was sent to the processor. If no evidence was sent, this will be null.

**updated_date**: String
The date the dispute was last updated.

**expiration_date**: String
The final date to submit evidence to contest a dispute.

**reason_message**: String
A more detailed reason provided by the card issuer for the dispute.

**settlement_withdrawal_batch**: String
The settlement batch number where funds were withdrawn from the merchants account for the dispute.

**settlement_deposit_batch**: String
The settlement batch number where funds were deposited into the merchants account if a dispute is `WON`.

**updated_row_at**: String
The date the dispute was last updated in the database.

|Key | type | description |
|-------------------|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
|merchant_uid | ID | The Pay Theory unique identifier assigned to the merchant that the dispute belongs to. |
|transaction | Transaction | The transaction object for the transaction that is in dispute. More information on the transaction object can be found [here](transaction). |
|dispute_id | String | The Pay Theory unique dispute identifier. |
|status | [DisputeStatus](#dispute-status) | The status of the dispute. |
|reason | [DisputeReason](#dispute-reason) | The reason code for the dispute as passed by the card issuer. |
|amount | Int | The amount of the transaction in dispute. |
|dispute_date | String | The date the dispute was created. |
|evidence_last_send_date| String | The last date evidence was sent to the processor. If no evidence was sent, this will be null. |
|updated_date | String | The date the dispute was last updated. |
|expiration_date | String | The final date to submit evidence to contest a dispute. |
|reason_message | String | A more detailed reason provided by the card issuer for the dispute. |
|settlement_withdrawal_batch| String | The settlement batch number where funds were withdrawn from the merchants account for the dispute. |
|settlement_deposit_batch| String | The settlement batch number where funds were deposited into the merchants account if a dispute is `WON`. |
|updated_row_at | String | The date the dispute was last updated in the database. |

***
### Dispute Status

- `INQUIRY` - The dispute is in the inquiry stage. The cardholder has requested more information about the charge.
- `LOST` - The dispute has been lost. The cardholder has won the dispute and the funds have been withdrawn from the merchants account.
- `PENDING` - The dispute is in the pending stage. The cardholder has requested a chargeback.
- `WON` - The dispute has been won. The merchant has won the dispute and the funds have been deposited into the merchants account.

***
### Dispute Reason

- `CLERICAL`
- `FRAUD`
- `INQUIRY`
- `QUALITY`
- `TECHNICAL`

***
## Query Disputes

```graphql
Expand All @@ -108,28 +93,18 @@ query DisputeQuery($direction: MoveDirection, $limit: Int, $offset: String, $off
}
```

### Arguments

**`limit`: Int**
The number of disputes to return.
**Parameters**

**`direction`: String**
The direction of the pagination. Makes sure the results are returned in the correct order.
* `FORWARD`
* `BACKWARD`
|Key |type | description |
|-------------------|-------------|---------------------------------------|
|direction |MoveDirection|The direction of the pagination. Makes sure the results are returned in the correct order.|
|limit |Int |The number of disputes to return.|
|offset |String |The value of the offset item for which the list is being sorted.|
|offset_id |String |The `dispute_id` of the offset item.|
|query |QueryObject |The query to filter the disputes with based on Pay Theory defined data.|

**`offset`: String**
The value of the offset item for which the list is being sorted.
If the direction is `FORWARD`, the offset item is the last item in the previous list.
If the direction is `BACKWARD`, the offset is the first item in the previous list.

**`offset_id`: String**
The `dispute_id` of the offset item. If the direction is `FORWARD`, the offset item is the last item in the list. If the direction is `BACKWARD`, the offset is the first item in the list.

**`query`: QueryObject**
The query to filter the disputes with based on Pay Theory defined data. Detailed information about the query object can be found [here](query).

### Returns
**Returns**
```json
{
"data": {
Expand All @@ -147,10 +122,7 @@ The query to filter the disputes with based on Pay Theory defined data. Detaile
}
}
```


**`items`: [Dispute]**
The list of disputes that are returned from the query.

**`total_row_count`: Int**
The total number of disputes that match the query. Used to help with pagination.
|Key |type | description |
|-------------------|-------------|---------------------------------------|
|items |[Dispute] |The list of disputes that are returned from the query.|
|total_row_count |Int |The total number of disputes that match the query. Used to help with pagination.|
Loading

0 comments on commit 2f0666b

Please sign in to comment.