CreateCheckoutOrder.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { gql,TypedDocumentNode } from "@apollo/client";
  2. import { CreateCheckoutOrderData, CreatePaymentInitiateData } from "@/types/checkout/type";
  3. export const CREATE_PAYMENT_INITIATE: TypedDocumentNode<CreatePaymentInitiateData> = gql`
  4. mutation CreatePaymentInitiate(
  5. $expressCheckout: Boolean
  6. $paymentMethod: String
  7. $paymentSuccessUrl: String
  8. $paymentFailureUrl: String
  9. $paymentCancelUrl: String
  10. ) {
  11. createPaymentInitiate(
  12. input: {
  13. expressCheckout: $expressCheckout
  14. paymentMethod: $paymentMethod
  15. paymentSuccessUrl: $paymentSuccessUrl
  16. paymentFailureUrl: $paymentFailureUrl
  17. paymentCancelUrl: $paymentCancelUrl
  18. }
  19. ) {
  20. paymentInitiate {
  21. id
  22. success
  23. message
  24. orderId
  25. status
  26. gatewayOrderId
  27. newCartToken
  28. express
  29. }
  30. }
  31. }
  32. `;
  33. // 这个不用了
  34. export const CREATE_CHECKOUT_ORDER: TypedDocumentNode<CreateCheckoutOrderData> = gql`
  35. mutation CreateCheckoutOrder {
  36. createCheckoutOrder(
  37. input: {}
  38. ) {
  39. checkoutOrder {
  40. id
  41. orderId
  42. message
  43. success
  44. paymentTransactionId
  45. }
  46. }
  47. }
  48. `;