Home > @vue-storefront/magento-api > setPaymentMethodOnCart
setPaymentMethodOnCart() function
Sets received payment method on cart.
Signature:
export default function setPaymentMethodOnCart(context: Context, input: SetPaymentMethodOnCartInputs, customQuery?: CustomQuery, customHeaders?: CustomHeaders): Promise<FetchResult<SetPaymentMethodOnCartMutation>>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| context | Context | VSF context |
| input | SetPaymentMethodOnCartInputs | params containing the cart's ID and the payment method |
| customQuery | CustomQuery | (Optional) (optional) - custom GraphQL query that extends the default query |
| customHeaders | CustomHeaders | (Optional) (optional) - custom headers that extends the default headers |
Returns:
Promise<FetchResult<SetPaymentMethodOnCartMutation>>