mutation RefundTransaction($input: RefundTransactionInput!) {
    refundTransaction(input: $input) {
        refund {
            id
            legacyId
            orderId
            status
            statusHistory {
                __typename
                status
                source
                ... on FailedEvent {
                    processorResponse {
                        message
                        legacyCode
                    }
                }
                ... on GatewayRejectedEvent {
                    processorResponse {
                        message
                        legacyCode
                    }
                }
                ... on ProcessorDeclinedEvent {
                    processorResponse {
                        message
                        legacyCode
                    }
                }
                ... on SettlementDeclinedEvent {
                    processorResponse {
                        message
                        legacyCode
                    }
                }
            }
            createdAt
            paymentMethodSnapshot {
                __typename
                ... on CreditCardTransactionDetails {
                    creditCard {
                        origin {
                            type
                        }
                    }
                }
                ... on CreditCardDetails {
                    origin {
                        type
                    }
                }
                ... on PayPalTransactionDetails {
                    captureId
                }
            }
            details {
                __typename
                ... on PayPalRefundDetails {
                    refundId
                }
            }
            amount {
                value
                currencyCode
            }
        }
    }
}
