dummy-payment-server/subscriptions.ts

226 lines
3.7 KiB
TypeScript
Raw Permalink Normal View History

2023-08-18 12:49:03 +00:00
import { gql } from "graphql_tag/mod.ts";
export const gatewayInitialize = gql`
subscription {
event {
... on PaymentGatewayInitializeSession {
issuedAt
version
issuingPrincipal {
... on App {
id
__typename
}
... on User {
id
__typename
}
... on Node {
id
__typename
}
2023-08-07 12:56:54 +00:00
}
2023-08-18 12:49:03 +00:00
recipient {
2023-08-07 11:39:41 +00:00
id
2023-08-18 12:49:03 +00:00
name
2023-08-07 11:39:41 +00:00
}
2023-08-18 12:49:03 +00:00
sourceObject {
... on Checkout {
user {
id
}
}
2023-08-18 12:49:03 +00:00
... on Order {
user {
id
}
}
}
2023-08-18 12:49:03 +00:00
data
amount
2023-08-07 11:39:41 +00:00
}
}
}
2023-08-18 12:49:03 +00:00
`;
2023-08-07 11:39:41 +00:00
2023-08-18 12:49:03 +00:00
export const transactionInitialize = gql`
subscription {
event {
... on TransactionInitializeSession {
issuedAt
version
issuingPrincipal {
... on Node {
id
}
2023-08-18 12:49:03 +00:00
__typename
}
2023-08-18 12:49:03 +00:00
recipient {
id
name
}
sourceObject {
... on Checkout {
user {
id
}
}
2023-08-18 12:49:03 +00:00
... on Order {
user {
id
}
}
__typename
}
transaction {
id
name
pspReference
}
data
merchantReference
action {
amount
currency
actionType
}
2023-08-07 11:39:41 +00:00
}
}
}
2023-08-18 12:49:03 +00:00
`;
2023-08-07 11:39:41 +00:00
2023-08-18 12:49:03 +00:00
export const transactionProcess = gql`
fragment Money on Money {
currency
amount
}
2023-08-07 15:24:47 +00:00
2023-08-18 12:49:03 +00:00
subscription {
event {
... on TransactionProcessSession {
issuedAt
version
issuingPrincipal {
... on User {
id
lastName
firstName
}
... on App {
id
name
}
__typename
2023-08-07 15:24:47 +00:00
}
2023-08-18 12:49:03 +00:00
recipient {
2023-08-07 15:24:47 +00:00
id
name
}
2023-08-18 12:49:03 +00:00
sourceObject {
... on Checkout {
id
totalPrice {
currency
gross {
...Money
}
2023-08-07 15:24:47 +00:00
}
}
2023-08-18 12:49:03 +00:00
... on Order {
id
total {
currency
gross {
...Money
}
2023-08-07 15:24:47 +00:00
}
}
2023-08-18 12:49:03 +00:00
__typename
}
data
merchantReference
action {
amount
currency
actionType
2023-08-07 15:24:47 +00:00
}
2023-08-07 15:31:37 +00:00
}
2023-08-07 15:24:47 +00:00
}
}
2023-08-18 12:49:03 +00:00
`;
2023-08-07 15:24:47 +00:00
2023-08-18 12:49:03 +00:00
export const chargeSub = gql`
subscription {
event {
... on TransactionChargeRequested {
issuedAt
version
issuingPrincipal {
... on User {
lastName
firstName
email
}
}
transaction {
id
}
action {
actionType
amount
2023-01-11 09:52:15 +00:00
}
}
}
}
2023-08-07 11:39:41 +00:00
`;
2023-01-11 09:52:15 +00:00
2023-08-18 12:49:03 +00:00
export const refundSub = gql`
subscription {
event {
... on TransactionRefundRequested {
issuedAt
version
issuingPrincipal {
... on User {
lastName
firstName
email
}
}
transaction {
id
}
action {
actionType
amount
2023-01-11 09:52:15 +00:00
}
}
}
}
2023-08-18 12:49:03 +00:00
`;
2023-01-11 09:52:15 +00:00
2023-08-18 12:49:03 +00:00
export const cancelSub = gql`
subscription {
event {
... on TransactionCancelationRequested {
issuedAt
version
issuingPrincipal {
... on User {
lastName
firstName
email
}
}
transaction {
id
}
action {
actionType
amount
2023-01-11 09:52:15 +00:00
}
}
}
}
2023-08-18 12:49:03 +00:00
`;