Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: I can't get credit card information on order details mutation #16000

Open
ttvan20 opened this issue May 16, 2024 · 1 comment
Open

Bug: I can't get credit card information on order details mutation #16000

ttvan20 opened this issue May 16, 2024 · 1 comment

Comments

@ttvan20
Copy link

ttvan20 commented May 16, 2024

What are you trying to achieve?

I tried to get credit card information on querying order detail, but it always returns empty for payments object and I can't get credit card information from it, not sure why? Do I missing anything?

Steps to reproduce the problem

Query:

{
  order(id: "T3JkZXI6...") {
    payments {
      creditCard {
        brand
        expMonth
        expYear
        firstDigits
        lastDigits
      }
    }
  }
}

Response:

{
  "data": {
    "order": {
      "payments": []
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 2,
      "maximumAvailable": 50000
    }
  }
}

What did you expect to happen?

I can get credit card information on order details mutation

Logs

No response

Environment

Saleor version: 5.15

@korycins
Copy link
Member

Hey @ttvan20
Did you mean Saleor in 3.15 version - You provided 5.15.

From the sample that you provided, it looks like you have an order without payments objects. It means that you created the order from a draft or with the help of App. In the case of using App to process a payments, payments list will be empty as this field is related to PaymentAPI. App to process the payments uses TransactionAPI.

For PaymentAPI (used by payment plugins), credit card details are set by PaymentPlugin (but from the above example, this field is empty, so you probably don't use payment plugins).
For TransactionAPI, we don't have fields to explicitly store the payment details (as described here). As a workaround, your payment app can store it in the metadata of TransactionItem.
To clarify, if the order from the example was created from a draft, it will not have any credit card details as we don't have any payment related to the order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants