Skip to content

Commit

Permalink
feat(mollie-plugin): Support amount parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
casperiv0 committed Nov 7, 2023
1 parent 765b4b7 commit d2a5a14
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,12 @@ export type MollieAmount = {
value?: Maybe<Scalars['String']['output']>;
};

export type MollieAmountInput = {
__typename?: 'MollieAmountInput';
currency: Scalars['String']['output'];
value: Scalars['Int']['output'];
};

export type MolliePaymentIntent = {
__typename?: 'MolliePaymentIntent';
url: Scalars['String']['output'];
Expand Down Expand Up @@ -1681,6 +1687,7 @@ export type MolliePaymentMethodImages = {
};

export type MolliePaymentMethodsInput = {
amount?: InputMaybe<MollieAmountInput>;
billingCountry?: InputMaybe<Scalars['String']['input']>;
locale?: InputMaybe<Scalars['String']['input']>;
paymentMethodCode: Scalars['String']['input'];
Expand Down
5 changes: 5 additions & 0 deletions packages/payments-plugin/src/mollie/mollie-shop-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@ export const shopSchema = gql`
paymentMethodCode: String!
molliePaymentMethodCode: String
}
type MollieAmountInput {
value: Int!
currency: String!
}
input MolliePaymentMethodsInput {
paymentMethodCode: String!
billingCountry: String
locale: String
amount: MollieAmountInput
}
extend type Mutation {
createMolliePaymentIntent(input: MolliePaymentIntentInput!): MolliePaymentIntentResult!
Expand Down
1 change: 1 addition & 0 deletions packages/payments-plugin/src/mollie/mollie.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ export class MollieService {
const methods = await client.methods.list({
locale: (input.locale as Locale | null) ?? undefined,
billingCountry: input.billingCountry ?? undefined,
amount: input.amount ? toAmount(input.amount.value, input.amount.currency) : undefined,
resource: 'orders',
});
return methods.map(m => ({
Expand Down

0 comments on commit d2a5a14

Please sign in to comment.