Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
silenaker committed Aug 30, 2024
1 parent 710ff38 commit 96ad6f5
Show file tree
Hide file tree
Showing 12 changed files with 871 additions and 709 deletions.
13 changes: 9 additions & 4 deletions packages/core/types/src/payment/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@ import { BigNumberValue } from "../totals"
/* ********** PAYMENT COLLECTION ********** */

export type PaymentCollectionStatus =
| "not_paid"
| "awaiting"
| "pending"
| "paid"
| "partially_paid"
| "authorized"
| "partially_authorized"
| "canceled"
| "refunded"
| "partially_refunded"

export type PaymentSessionStatus =
| "authorized"
| "captured"
| "partially_captured"
| "refunded"
| "partially_refunded"
| "pending"
| "requires_more"
| "error"
| "canceled"
| "processing"

/**
* The payment collection details.
Expand Down
41 changes: 13 additions & 28 deletions packages/core/types/src/payment/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,6 @@ export interface CreateCaptureDTO {
*/
amount?: BigNumberInput

/**
* The associated payment's ID.
*/
payment_id: string

/**
* Who captured the payment. For example,
* a user's ID.
Expand All @@ -207,16 +202,11 @@ export interface CreateRefundDTO {
*/
amount?: BigNumberInput

/**
* The associated payment's ID.
*/
payment_id: string

/**
* Who refunded the payment. For example,
* a user's ID.
*/
created_by?: string
refunded_by?: string
}

/**
Expand All @@ -243,15 +233,10 @@ export interface CreatePaymentSessionDTO {
*/
amount: BigNumberInput

/**
* Necessary data for the associated payment provider to process the payment.
*/
data: Record<string, unknown>

/**
* Necessary context data for the associated payment provider.
*/
context?: PaymentProviderContext
context: PaymentProviderContext
}

/**
Expand All @@ -264,24 +249,24 @@ export interface UpdatePaymentSessionDTO {
id: string

/**
* Necessary data for the associated payment provider to process the payment.
*/
data: Record<string, unknown>

/**
* The ISO 3 character currency code.
* The provider's payment method token
*/
currency_code: string
provider_token?: string

/**
* The amount to be authorized.
* Necessary context data for the associated payment provider.
*/
amount: BigNumberInput
context: PaymentProviderContext
}

/**
* The attributes to authorize in a payment session.
*/
export interface AuthorizePaymentSessionDTO {
/**
* Necessary context data for the associated payment provider.
* The provider token to authorize payment session
*/
context?: PaymentProviderContext
provider_token?: string
}

/**
Expand Down
Loading

0 comments on commit 96ad6f5

Please sign in to comment.