Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

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

Closed
fabregas4 opened this issue Apr 3, 2024 · 1 comment · Fixed by #1331

Comments

@fabregas4
Copy link

fabregas4 commented Apr 3, 2024

Not sure if this is a Remix issue or shopify-api-js one (I suspect the latter hence posting here)...

When I make a request to the rest api for a Recurring ApplicationCharge, like so:

const recurringApplicationCharge = await admin.rest.resources.RecurringApplicationCharge.find({
	session: session,
	id: shopifySubscriptionId
});

console.log(recurringApplicationCharge.currency);

The result of recurringApplicationCharge.currency is an object in this structure: Currency { '0': 'U', '1': 'S', '2': 'D' }

I'm guessing this isn't expected behaviour, and that it should simply be a string of "USD".

I also tried recurringApplicationCharge.currency.currency - which returns undefined.

@paulomarg
Copy link
Contributor

Good catch - it seems like we're getting a string back from the API but trying to parse it as a Currency resource, which is incorrect. I'll set up a PR to fix this right away :)

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

Successfully merging a pull request may close this issue.

2 participants