buckaroo-it / Magento2_GraphQL

Repository containing the Magento 2 GraphQL plugin by Buckaroo
MIT License
1 stars 1 forks source link

transaction details #15

Closed raoulguillermo closed 1 year ago

raoulguillermo commented 2 years ago

How can i get the correct transaction details? When i use the return url. I get a hashed code after the url. Can i somehow use that to get the transaction id? In the docs it states that i need to save the transaction id. But i need something to match it with. So i can save it into the database or something.

I might be way of here.. So any advice would be appreciated! :)

harli91 commented 1 year ago

Hello @raoulguillermo the hash in the url is the checkout id, you can use it to get the saved transaction id

raoulguillermo commented 1 year ago

Ah.. ofcourse.. obvious... Thanks!

raoulguillermo commented 1 year ago

Sorry to bother you with this again. But where can i get the checkout id?

When running the below code I should get something back like a checkout id or something right? Or is this checkout_id a hashed version of the order_id? If so how can i decode that?

mutation {
  setBuckarooReturnUrl(
    input: {
      return_url: "/payment"
      cart_id: "cartid"
    }
  ) {
    success
  }

  placeOrder(input: { cart_id: "cartid" }) {
    order {
      order_id
      order_number
      buckaroo_additional {
        redirect
        transaction_id
        data {
          key
          value
        }
      }
    }
  }
}
harli91 commented 1 year ago

the "checkout id" is the masked cart id obtained from the create empty cart mutation createEmptyCart