mutation ChargePayPalAccount($input: ChargePayPalAccountInput!) {
    chargePayPalAccount(input: $input) {
        transaction {
            id
            legacyId
            merchantAccountId
            amount {
                value
                currencyCode
            }
            createdAt
            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
                    }
                }
            }
            paymentMethodSnapshot {
                __typename
                ... on CreditCardTransactionDetails {
                    creditCard {
                        origin {
                            type
                        }
                    }
                }
                ... on CreditCardDetails {
                    origin {
                        type
                    }
                }
                ... on PayPalTransactionDetails {
                    captureId
                }
            }
            paymentMethod {
                id
                legacyId
                details {
                    __typename
                    ... on CreditCardDetails {
                        brandCode
                        last4
                        expirationMonth
                        expirationYear
                        origin {
                            type
                        }
                    }
                }
            }
        }
        billingAgreementWithPurchasePaymentMethod {
            id,
            legacyId,
            details {
                __typename
            }
        }
    }
}
