Просмотр исходного кода

chore(payments-plugin): Reinstate missing Mollie api types

Michael Bromley 1 год назад
Родитель
Сommit
c2e567daf8

+ 43 - 6
packages/payments-plugin/e2e/graphql/generated-admin-types.ts

@@ -1617,6 +1617,7 @@ export enum ErrorCode {
     MANUAL_PAYMENT_STATE_ERROR = 'MANUAL_PAYMENT_STATE_ERROR',
     MIME_TYPE_ERROR = 'MIME_TYPE_ERROR',
     MISSING_CONDITIONS_ERROR = 'MISSING_CONDITIONS_ERROR',
+    MOLLIE_PAYMENT_INTENT_ERROR = 'MOLLIE_PAYMENT_INTENT_ERROR',
     MULTIPLE_ORDER_ERROR = 'MULTIPLE_ORDER_ERROR',
     NATIVE_AUTH_STRATEGY_ERROR = 'NATIVE_AUTH_STRATEGY_ERROR',
     NEGATIVE_QUANTITY_ERROR = 'NEGATIVE_QUANTITY_ERROR',
@@ -1626,6 +1627,7 @@ export enum ErrorCode {
     ORDER_LIMIT_ERROR = 'ORDER_LIMIT_ERROR',
     ORDER_MODIFICATION_ERROR = 'ORDER_MODIFICATION_ERROR',
     ORDER_MODIFICATION_STATE_ERROR = 'ORDER_MODIFICATION_STATE_ERROR',
+    ORDER_PAYMENT_STATE_ERROR = 'ORDER_PAYMENT_STATE_ERROR',
     ORDER_STATE_TRANSITION_ERROR = 'ORDER_STATE_TRANSITION_ERROR',
     PAYMENT_METHOD_MISSING_ERROR = 'PAYMENT_METHOD_MISSING_ERROR',
     PAYMENT_ORDER_MISMATCH_ERROR = 'PAYMENT_ORDER_MISMATCH_ERROR',
@@ -2599,6 +2601,41 @@ export type ModifyOrderResult =
     | PaymentMethodMissingError
     | RefundPaymentIdMissingError;
 
+export type MolliePaymentIntent = {
+    url: Scalars['String']['output'];
+};
+
+export type MolliePaymentIntentError = ErrorResult & {
+    errorCode: ErrorCode;
+    message: Scalars['String']['output'];
+};
+
+export type MolliePaymentIntentInput = {
+    /**
+     * Optional preselected Mollie payment method. When this is passed
+     * the payment selection step will be skipped.
+     */
+    molliePaymentMethodCode?: InputMaybe<Scalars['String']['input']>;
+    /**
+     * Use this to create a payment intent for a specific order. This allows you to create intents for
+     * orders that are not active orders.
+     */
+    orderId?: InputMaybe<Scalars['String']['input']>;
+    /**
+     * The code of the Vendure payment method to use for the payment.
+     * Must have Mollie as payment method handler.
+     * Without this, the first method with Mollie as handler will be used.
+     */
+    paymentMethodCode?: InputMaybe<Scalars['String']['input']>;
+    /**
+     * The redirect url to which the customer will be redirected after the payment is completed.
+     * The configured fallback redirect will be used if this is not provided.
+     */
+    redirectUrl?: InputMaybe<Scalars['String']['input']>;
+};
+
+export type MolliePaymentIntentResult = MolliePaymentIntent | MolliePaymentIntentError;
+
 export type MoveCollectionInput = {
     collectionId: Scalars['ID']['input'];
     index: Scalars['Int']['input'];
@@ -2684,6 +2721,7 @@ export type Mutation = {
     createFacet: Facet;
     /** Create one or more FacetValues */
     createFacetValues: Array<FacetValue>;
+    createMolliePaymentIntent: MolliePaymentIntentResult;
     /** Create existing PaymentMethod */
     createPaymentMethod: PaymentMethod;
     /** Create a new Product */
@@ -2805,12 +2843,7 @@ export type Mutation = {
     duplicateEntity: DuplicateEntityResult;
     flushBufferedJobs: Success;
     importProducts?: Maybe<ImportInfo>;
-    /**
-     * Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
-     *
-     * The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
-     * to 1 year.
-     */
+    /** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */
     login: NativeAuthenticationResult;
     logout: Success;
     /**
@@ -3076,6 +3109,10 @@ export type MutationCreateFacetValuesArgs = {
     input: Array<CreateFacetValueInput>;
 };
 
+export type MutationCreateMolliePaymentIntentArgs = {
+    input: MolliePaymentIntentInput;
+};
+
 export type MutationCreatePaymentMethodArgs = {
     input: CreatePaymentMethodInput;
 };

+ 72 - 6
packages/payments-plugin/e2e/graphql/generated-shop-types.ts

@@ -895,6 +895,7 @@ export enum ErrorCode {
     INSUFFICIENT_STOCK_ERROR = 'INSUFFICIENT_STOCK_ERROR',
     INVALID_CREDENTIALS_ERROR = 'INVALID_CREDENTIALS_ERROR',
     MISSING_PASSWORD_ERROR = 'MISSING_PASSWORD_ERROR',
+    MOLLIE_PAYMENT_INTENT_ERROR = 'MOLLIE_PAYMENT_INTENT_ERROR',
     NATIVE_AUTH_STRATEGY_ERROR = 'NATIVE_AUTH_STRATEGY_ERROR',
     NEGATIVE_QUANTITY_ERROR = 'NEGATIVE_QUANTITY_ERROR',
     NOT_VERIFIED_ERROR = 'NOT_VERIFIED_ERROR',
@@ -1629,6 +1630,66 @@ export type MissingPasswordError = ErrorResult & {
     message: Scalars['String']['output'];
 };
 
+export type MollieAmount = {
+    currency?: Maybe<Scalars['String']['output']>;
+    value?: Maybe<Scalars['String']['output']>;
+};
+
+export type MolliePaymentIntent = {
+    url: Scalars['String']['output'];
+};
+
+export type MolliePaymentIntentError = ErrorResult & {
+    errorCode: ErrorCode;
+    message: Scalars['String']['output'];
+};
+
+export type MolliePaymentIntentInput = {
+    /**
+     * Optional preselected Mollie payment method. When this is passed
+     * the payment selection step will be skipped.
+     */
+    molliePaymentMethodCode?: InputMaybe<Scalars['String']['input']>;
+    /**
+     * Use this to create a payment intent for a specific order. This allows you to create intents for
+     * orders that are not active orders.
+     */
+    orderId?: InputMaybe<Scalars['String']['input']>;
+    /**
+     * The code of the Vendure payment method to use for the payment.
+     * Must have Mollie as payment method handler.
+     * Without this, the first method with Mollie as handler will be used.
+     */
+    paymentMethodCode?: InputMaybe<Scalars['String']['input']>;
+    /**
+     * The redirect url to which the customer will be redirected after the payment is completed.
+     * The configured fallback redirect will be used if this is not provided.
+     */
+    redirectUrl?: InputMaybe<Scalars['String']['input']>;
+};
+
+export type MolliePaymentIntentResult = MolliePaymentIntent | MolliePaymentIntentError;
+
+export type MolliePaymentMethod = {
+    code: Scalars['String']['output'];
+    description?: Maybe<Scalars['String']['output']>;
+    id: Scalars['ID']['output'];
+    image?: Maybe<MolliePaymentMethodImages>;
+    maximumAmount?: Maybe<MollieAmount>;
+    minimumAmount?: Maybe<MollieAmount>;
+    status?: Maybe<Scalars['String']['output']>;
+};
+
+export type MolliePaymentMethodImages = {
+    size1x?: Maybe<Scalars['String']['output']>;
+    size2x?: Maybe<Scalars['String']['output']>;
+    svg?: Maybe<Scalars['String']['output']>;
+};
+
+export type MolliePaymentMethodsInput = {
+    paymentMethodCode: Scalars['String']['input'];
+};
+
 export type Mutation = {
     /** Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available. */
     addItemToOrder: UpdateOrderItemsResult;
@@ -1642,14 +1703,10 @@ export type Mutation = {
     authenticate: AuthenticationResult;
     /** Create a new Customer Address */
     createCustomerAddress: Address;
+    createMolliePaymentIntent: MolliePaymentIntentResult;
     /** Delete an existing Address */
     deleteCustomerAddress: Success;
-    /**
-     * Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
-     *
-     * The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
-     * to 1 year.
-     */
+    /** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */
     login: NativeAuthenticationResult;
     /** End the current authenticated session */
     logout: Success;
@@ -1753,6 +1810,10 @@ export type MutationCreateCustomerAddressArgs = {
     input: CreateAddressInput;
 };
 
+export type MutationCreateMolliePaymentIntentArgs = {
+    input: MolliePaymentIntentInput;
+};
+
 export type MutationDeleteCustomerAddressArgs = {
     id: Scalars['ID']['input'];
 };
@@ -2756,6 +2817,7 @@ export type Query = {
     facets: FacetList;
     /** Returns information about the current authenticated User */
     me?: Maybe<CurrentUser>;
+    molliePaymentMethods: Array<MolliePaymentMethod>;
     /** Returns the possible next states that the activeOrder can transition to */
     nextOrderStates: Array<Scalars['String']['output']>;
     /**
@@ -2795,6 +2857,10 @@ export type QueryFacetsArgs = {
     options?: InputMaybe<FacetListOptions>;
 };
 
+export type QueryMolliePaymentMethodsArgs = {
+    input: MolliePaymentMethodsInput;
+};
+
 export type QueryOrderArgs = {
     id: Scalars['ID']['input'];
 };

+ 77 - 6
packages/payments-plugin/src/mollie/graphql/generated-shop-types.ts

@@ -926,6 +926,7 @@ export enum ErrorCode {
     INSUFFICIENT_STOCK_ERROR = 'INSUFFICIENT_STOCK_ERROR',
     INVALID_CREDENTIALS_ERROR = 'INVALID_CREDENTIALS_ERROR',
     MISSING_PASSWORD_ERROR = 'MISSING_PASSWORD_ERROR',
+    MOLLIE_PAYMENT_INTENT_ERROR = 'MOLLIE_PAYMENT_INTENT_ERROR',
     NATIVE_AUTH_STRATEGY_ERROR = 'NATIVE_AUTH_STRATEGY_ERROR',
     NEGATIVE_QUANTITY_ERROR = 'NEGATIVE_QUANTITY_ERROR',
     NOT_VERIFIED_ERROR = 'NOT_VERIFIED_ERROR',
@@ -1684,6 +1685,71 @@ export type MissingPasswordError = ErrorResult & {
     message: Scalars['String']['output'];
 };
 
+export type MollieAmount = {
+    __typename?: 'MollieAmount';
+    currency?: Maybe<Scalars['String']['output']>;
+    value?: Maybe<Scalars['String']['output']>;
+};
+
+export type MolliePaymentIntent = {
+    __typename?: 'MolliePaymentIntent';
+    url: Scalars['String']['output'];
+};
+
+export type MolliePaymentIntentError = ErrorResult & {
+    __typename?: 'MolliePaymentIntentError';
+    errorCode: ErrorCode;
+    message: Scalars['String']['output'];
+};
+
+export type MolliePaymentIntentInput = {
+    /**
+     * Optional preselected Mollie payment method. When this is passed
+     * the payment selection step will be skipped.
+     */
+    molliePaymentMethodCode?: InputMaybe<Scalars['String']['input']>;
+    /**
+     * Use this to create a payment intent for a specific order. This allows you to create intents for
+     * orders that are not active orders.
+     */
+    orderId?: InputMaybe<Scalars['String']['input']>;
+    /**
+     * The code of the Vendure payment method to use for the payment.
+     * Must have Mollie as payment method handler.
+     * Without this, the first method with Mollie as handler will be used.
+     */
+    paymentMethodCode?: InputMaybe<Scalars['String']['input']>;
+    /**
+     * The redirect url to which the customer will be redirected after the payment is completed.
+     * The configured fallback redirect will be used if this is not provided.
+     */
+    redirectUrl?: InputMaybe<Scalars['String']['input']>;
+};
+
+export type MolliePaymentIntentResult = MolliePaymentIntent | MolliePaymentIntentError;
+
+export type MolliePaymentMethod = {
+    __typename?: 'MolliePaymentMethod';
+    code: Scalars['String']['output'];
+    description?: Maybe<Scalars['String']['output']>;
+    id: Scalars['ID']['output'];
+    image?: Maybe<MolliePaymentMethodImages>;
+    maximumAmount?: Maybe<MollieAmount>;
+    minimumAmount?: Maybe<MollieAmount>;
+    status?: Maybe<Scalars['String']['output']>;
+};
+
+export type MolliePaymentMethodImages = {
+    __typename?: 'MolliePaymentMethodImages';
+    size1x?: Maybe<Scalars['String']['output']>;
+    size2x?: Maybe<Scalars['String']['output']>;
+    svg?: Maybe<Scalars['String']['output']>;
+};
+
+export type MolliePaymentMethodsInput = {
+    paymentMethodCode: Scalars['String']['input'];
+};
+
 export type Mutation = {
     __typename?: 'Mutation';
     /** Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available. */
@@ -1698,14 +1764,10 @@ export type Mutation = {
     authenticate: AuthenticationResult;
     /** Create a new Customer Address */
     createCustomerAddress: Address;
+    createMolliePaymentIntent: MolliePaymentIntentResult;
     /** Delete an existing Address */
     deleteCustomerAddress: Success;
-    /**
-     * Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
-     *
-     * The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
-     * to 1 year.
-     */
+    /** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */
     login: NativeAuthenticationResult;
     /** End the current authenticated session */
     logout: Success;
@@ -1809,6 +1871,10 @@ export type MutationCreateCustomerAddressArgs = {
     input: CreateAddressInput;
 };
 
+export type MutationCreateMolliePaymentIntentArgs = {
+    input: MolliePaymentIntentInput;
+};
+
 export type MutationDeleteCustomerAddressArgs = {
     id: Scalars['ID']['input'];
 };
@@ -2852,6 +2918,7 @@ export type Query = {
     facets: FacetList;
     /** Returns information about the current authenticated User */
     me?: Maybe<CurrentUser>;
+    molliePaymentMethods: Array<MolliePaymentMethod>;
     /** Returns the possible next states that the activeOrder can transition to */
     nextOrderStates: Array<Scalars['String']['output']>;
     /**
@@ -2891,6 +2958,10 @@ export type QueryFacetsArgs = {
     options?: InputMaybe<FacetListOptions>;
 };
 
+export type QueryMolliePaymentMethodsArgs = {
+    input: MolliePaymentMethodsInput;
+};
+
 export type QueryOrderArgs = {
     id: Scalars['ID']['input'];
 };