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

Application Charge currency being returned as weird object with each letter as a different value #1345

Closed
5 tasks done
anastis opened this issue Aug 8, 2024 · 1 comment · Fixed by #1518
Closed
5 tasks done
Assignees
Labels
good first issue Good for newcomers

Comments

@anastis
Copy link

anastis commented Aug 8, 2024

Issue summary

Before opening this issue, I have:

  • Upgraded to the latest version of the relevant packages
    • @shopify/* package and version:
    • Node version: 20.14.0
    • Operating system: MacOS
  • Set { logger: { level: LogSeverity.Debug } } in my configuration, when applicable
  • Found a reliable way to reproduce the problem that indicates it's a problem with the package
  • Looked for similar issues in this repository
  • Checked that this isn't an issue with a Shopify API

Description

This is really a duplicate of Shopify/shopify-api-js#1325 but applicable to one-time charges (ApplicationCharge class).
Not sure if this is the right repo, I observe the issue in a Remix app.

Current code:

public currency: Currency | null | {[key: string]: any};

Previous fix in recurring charges:
Shopify/shopify-api-js@513f9e6#diff-b7fd618aa27ac126617eff6762287fed5dbe2aa82a516a1da587a788fc4bf786

Expected behavior

The charge's currency should be a string (to be consistent with recurring charges), or perhaps a proper currency object.

Actual behavior

currency property is an object like { 0: "U", 1: "S", 2: "D" }

image

Steps to reproduce the problem

  const charges = await admin.rest.resources.ApplicationCharge.all({
    session,
  });

  console.log(charges[0].currency);
@lizkenyon
Copy link
Contributor

Thanks for flagging! I will add this to our work list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
3 participants