-
Notifications
You must be signed in to change notification settings - Fork 5
Connect Execution of products and subs, Recursive Expansion #96 #98
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
Conversation
| export const AccountExpandableFields = { | ||
| sensitive: 'sensitive', | ||
| balance: 'balance', | ||
| card_brand: 'card_brand', | ||
| attribute: 'attribute', | ||
| payoff: 'payoff', | ||
| transaction: 'transaction', | ||
| update: 'update', | ||
| payment_instrument: 'payment_instrument', | ||
| latest_verification_session: 'latest_verification_session', | ||
| } as const; | ||
|
|
||
| type AccountExpandableField = typeof AccountExpandableFields[keyof typeof AccountExpandableFields]; | ||
|
|
||
| export interface IExpandableOpts { | ||
| expand?: AccountExpandableField[]; | ||
| } | ||
|
|
||
| export interface IConnectListOpts extends IResourceListOpts, IExpandableOpts {} | ||
|
|
||
| export const AccountProductsEligibleForAutomaticExecution = [ | ||
| 'account_attribute', | ||
| 'balance', | ||
| 'card_brand', | ||
| 'update', | ||
| 'payoff', | ||
| ] as const; | ||
|
|
||
| export const AccountSubscriptionsEligibleForAutomaticExecution = [ | ||
| 'card_brand', | ||
| 'update', | ||
| 'update.snapshot', | ||
| 'transaction', | ||
| ] as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These already exist in the resources/Account/types.ts file. We should only maintain them in one location.
| expect(card_retrieve_response.id).to.equal(card_create_response.id); | ||
| expect(card_retrieve_response.account_id).to.equal(test_credit_card_account.id); | ||
| expect(card_retrieve_response.network).to.equal('visa'); | ||
| expect(card_retrieve_response.status).to.equal('completed'); | ||
| expect(card_retrieve_response.issuer).to.equal(card_create_response.issuer); | ||
| expect(card_retrieve_response.last4).to.equal('1580'); | ||
| expect(card_retrieve_response.shared).to.equal(false); | ||
| expect(card_retrieve_response.source).to.equal('network'); | ||
| expect(card_retrieve_response.error).to.be.null; | ||
| expect(card_retrieve_response.created_at).to.be.a('string'); | ||
| expect(card_retrieve_response.updated_at).to.be.a('string'); | ||
|
|
||
| const brand = card_retrieve_response.brands?.[0]; | ||
| expect(brand).to.exist; | ||
| expect(brand.id).to.equal('brand_UBwVzXjpP4PJ6'); | ||
| expect(brand.name).to.equal('Chase Sapphire Reserve'); | ||
| expect(brand.url).to.equal('https://static.methodfi.com/card_brands/1b7ccaba6535cb837f802d968add4700.png'); | ||
| expect(brand.art_id).to.be.a('string').and.match(/^art_/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason you want to do it this way?
Support automatic execution of valid products / subscriptions on POST Connect
Support recursive expansion of fields in all Connect endpoints