File manager - Edit - /home/verseaumee/blueversionx/wp-content/plugins/rave-woocommerce-payment-gateway/client/api/blocks.js
Back
import $ from 'jquery'; import { normalizeOrderData, normalizeAddress, } from 'wcflutterwave/blocks/normalize'; import { getBlocksConfiguration } from 'wcflutterwave/blocks/utils'; /** * Construct WC AJAX endpoint URL. * * @param {string} endpoint Request endpoint URL. * @param {string} prefix Endpoint URI prefix (default: 'wc_rave_'). * @return {string} URL with interpolated endpoint. */ const getAjaxUrl = ( endpoint, prefix = 'wc_rave_' ) => { return getBlocksConfiguration() ?.ajax_url?.toString() ?.replace( '%%endpoint%%', prefix + endpoint ); }; export const getCartDetails = () => { const data = { security: getBlocksConfiguration()?.nonce?.payment, }; return $.ajax( { type: 'POST', data, url: getAjaxUrl( 'get_cart_details' ), } ); }; export const createOrder = ( sourceEvent, paymentRequestType ) => { const data = normalizeOrderData( sourceEvent, paymentRequestType ); return $.ajax( { type: 'POST', data, dataType: 'json', url: getAjaxUrl( 'create_order' ), } ); };
| ver. 1.4 |
Github
|
.
| PHP 8.5.7 | Generation time: 0 |
proxy
|
phpinfo
|
Settings