-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphqls
97 lines (81 loc) · 4.42 KB
/
schema.graphqls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
type Query {
tpayPaymentMethods: [TpayPaymentMethod] @resolver(class: "Tpay\\Magento2GraphQl\\Model\\Resolver\\PaymentMethods") @doc(description: "Provides Tpay available payment methods with additional data like images, etc.") @cache(cacheable: false)
tpayStoredCards: [TpayStoredCard] @resolver(class: "Tpay\\Magento2GraphQl\\Model\\Resolver\\StoredTokens") @doc(descriptions: "Provides list of stored card tokens") @cache(cacheable: false)
}
type Mutation {
tpayCreateTransaction(input: CreateTpayTransactionInput): CreateTpayTransactionOutput @resolver(class: "Tpay\\Magento2GraphQl\\Model\\Resolver\\CreateTransaction")
tpayCardPayment(input: CardPaymentInput): TpayPayOutput @resolver(class: "Tpay\\Magento2GraphQl\\Model\\Resolver\\CardPayment")
tpayStoredCardPayment(input: StoredCardPaymentInput): TpayPayOutput @resolver(class: "Tpay\\Magento2GraphQl\\Model\\Resolver\\StoredCardPayment")
tpayBlikPayment(input: BlikPaymentInput): TpayPayOutput @resolver(class: "Tpay\\Magento2GraphQl\\Model\\Resolver\\BlikPayment")
}
type TpayPaymentMethod @doc(description: "The standard output of tpayPaymentMethods Query, OpenApi Config should be valid") {
id: Int @doc(description: "Method ID")
fullName: String @doc(description: "Method name")
image: String @doc(description: "Method image URL")
available: Boolean @doc(description: "Is channel available right now")
onlinePayment: Boolean @doc(description: "Determines if instant payment can be done")
instantRedirection: Boolean @doc(description: "Determines if instant user redirect has to be processed")
groups: [ChannelGroups] @doc(description: "List of channel groups")
constraints: [ChannelConstraints] @doc(description: "List of constraints")
}
type TpayStoredCard @doc(description: "Stored tokens"){
tokenId: Int! @doc(description: "Part of TpayPaymentMethod")
token: String! @doc(description: "Part of TpayPaymentMethod")
cardShortCode: String! @doc(description: "Part of TpayPaymentMethod")
vendor: String! @doc(description: "Part of TpayPaymentMethod")
crc: String! @doc(description: "Part of TpayPaymentMethod")
}
type ChannelGroups @doc(description: "Part of TpayPaymentMethod") {
id: Int @doc(description: "ID")
name: String @doc(description: "Group name")
image: Image @doc(description: "IMG object")
}
type Image {
url: String @doc(description: "Image URL")
}
type ChannelConstraints @doc(description: "Part of TpayPaymentMethod") {
field: String @doc(description: "Field to be checked in this condition")
type: String @doc(description: "Type like min or max")
value: String @doc(description: "Value, can be an amount or value")
}
input CardPaymentInput {
incrementId: String! @doc(description: "Magento increment ID for order")
transactionId: String @doc(description: "Tpay transaction ta_xxxx ID - can be null for OriginApi card sales")
cardData: String! @doc(description: "Encrypted card data, example of encryption algorithm can be found in tpaycom/magento2basic")
storeCard: Boolean! @doc(description: "Users decision if card token can be stored in your app")
shortCode: String @doc(description: "Last card charcacter, for example 0000")
cardVendor: String @doc(description: "Card vendor")
}
input StoredCardPaymentInput {
incrementId: String! @doc(description: "Magento increment ID for order")
transactionId: String @doc(description: "Tpay transaction ta_xxxx ID - can be null for OriginApi card sales")
tokenId: String! @doc(description: "Token ID from TpayStoredCard type")
}
input BlikPaymentInput {
incrementId: String! @doc(description: "Magento increment ID for order")
transactionId: String! @doc(description: "Tpay transaction ta_xxxx ID")
blikCode: String! @doc(description: "BLIK code - use only of code or token fields")
}
type CreateTpayTransactionOutput {
transaction: String
redirectUrl: String
}
input CreateTpayTransactionInput {
real_order_id: String!
}
type TpayPayOutput {
transaction: String
result: String
redirectUrl: String!
}
input PaymentMethodInput {
tpay: TpayInput
}
input TpayInput {
channel: Int @doc(description: "Set channel ID, group ID or just ignore it to allow user to choose bank on Tpay paywall")
group: Int
accept_tos: Boolean!
}
type Order {
tpay: CreateTpayTransactionOutput @doc(description: "Tpay transaction output") @resolver(class: "Tpay\\Magento2GraphQl\\Model\\Resolver\\CreateTransaction")
}