When i trying get The Payment Methods using REST API , "rest/V1/carts/{cartId}/payment-methods" , it is returning Empty Array as a result.
I'm passing Admin Bearer Token as Authorization.
1 Answer 1
I am facing similar issue as of now. with guest-carta api.
https://www.example.com/rest/{store}/V1/guest-
carts/{quote_mask_id}/payment-information
What I did is I build a wrapper api of my own and called this api to initate order and then in case if the api response is empty I am calling sql query i.e
SELECT * FROM `quote_id_mask` WHERE `masked_id` =
'{QUOTE_KEY}'
or
SELECT * FROM `quote_id_mask` WHERE `quote_id` =
'{QUOTE_ID_MASK}'
It will give you entityID to initiate order for payment processing.
\Magento\Payment\Model\MethodInterface::isAvailableit should returntrue, also payment method should satisfy default validators likeuseOnCheckout,useForCountry,useForCurrency,orderTotalMinMax- some of them can be configured via Admin Panel, some inconfig.xmlfor per a payment integration.