Description
Choose how many fortnights to pay with Kueski Pay
Requirements
- WordPress 6.2 or newer.
- WooCommerce 7.6 or newer.
- PHP 7.4 or newer is recommended.
External services
This plugin connects to services operated by Kueski (Kueski, S.A.P.I. de C.V., SOFOM, E.N.R.) to show promotional widgets and to create, check and refund payments. The payment connections are required for the gateway to work. They are made only after you activate the plugin and enter your Kueski API key.
The payment connections go to the Kueski Pay WooCommerce middleware: https://woocommerce-middleware-go.production-pay.kueski.com/. When Sandbox mode is enabled they go to its test environment, https://woocommerce-middleware-go.staging-pay.kueski.codes/, instead.
Kueski privacy notices:
- Customers and users: https://preguntas.frecuentes.kueski.com/hc/es/articles/12385430001563-Aviso-de-privacidad-integral-para-clientes-y-usuarios-de-Kueski-S-A-P-I-de-C-V-SOFOM-E-N-R
- Merchants (commercial allies): https://preguntas.frecuentes.kueski.com/hc/es/articles/12385599806747-PRIVACY-NOTICE-FOR-THIRD-PARTIES-AND-COMMERCIAL-ALLIES-OF-KUESKI-SAPI-DE-CV-SOFOM-ENR
Kueski Pay widgets (cdn.kueskipay.com)
- What it is: the script
https://cdn.kueskipay.com/widgets.js, which shows the Kueski Pay installment widget on product and cart pages. - When: the script is loaded on storefront pages.
- Data sent: the page that loads the script includes your Kueski API key, whether Sandbox mode is on, the integration name (
woocommerce) and the plugin version in a hidden element that the script reads. The visitor’s browser also sends its usual request data (IP address, User-Agent) to the CDN, and the plugin version as the script’sverparameter. - Code:
public/class-wc-kueski-gateway-public.php(kueski_widget_enqueue_scripts(),add_widget_init()).
Kueski Pay middleware, validate keys: GET api/v1/merchant/validate-keys
- What it does: checks that your Kueski API key is valid and returns your merchant limits.
- When: when WooCommerce checks whether Kueski Pay can be offered to a customer (for example at checkout), when a customer places an order paying with Kueski Pay, and when someone calls the plugin’s monitoring endpoint (
/wp-json/kueski/v1/monitoring) on your store. The answer is kept for 12 hours, or 10 minutes after a failed check. - Data sent: your Kueski API key (in the
api_keyquery parameter), a generated request identifier (kp-identifierheader) and the User-Agent of the browser that triggered the request. - Code:
Kueski_Gateway_Api::wp_validate_keys()inincludes/class-wc-kueski-gateway-api.php, called throughget_merchant_data()fromincludes/class-wc-kueski-gateway.phpandincludes/class-wc-kueski-gateway-rest-api.php.
Kueski Pay middleware, create payment: POST api/v1/order/create
- What it does: creates a Kueski Pay payment for the order and returns the Kueski page where the customer completes it.
- When: a customer places an order paying with Kueski Pay. The customer is then redirected to Kueski.
- Data sent:
- Headers: your Kueski API key (
Authorization), the customer’s browser User-Agent, a generated request identifier (kp-identifier) and the integration name (kp-name), plugin version (kp-version), web or mobile source (kp-source), trigger (kp-trigger), and WordPress, WooCommerce and PHP versions (kp-wp-version,kp-wc-version,kp-php-version). - Body: the order ID and description, order total, currency and its breakdown (subtotal, shipping, tax, handling fee, discount), each item (name, description, SKU, quantity, price, currency), the shipping address (first and last name, street, interior, city, state, postcode, country), the billing phone number and email, and the store URLs Kueski returns the customer to (they carry the encrypted order ID and a nonce).
- Headers: your Kueski API key (
- Code:
Kueski_Gateway_Api::wp_create_order()inincludes/class-wc-kueski-gateway-api.php, called fromprocess_payment()inincludes/class-wc-kueski-gateway.php; the body is built inincludes/class-wc-kueski-gateway-order.php.
Kueski Pay middleware, check payments: POST api/v1/orders-sync
- What it does: returns the status of one or more Kueski Pay payments.
- When: every 5 minutes through WP-Cron for the latest three orders still pending payment, and when a customer returns to your store from Kueski.
- Data sent: your Kueski API key (
Authorization), the browser User-Agent, a generated request identifier (kp-identifier) and the Kueski payment IDs to check, separated by commas. - Code:
Kueski_Gateway_Api::wp_orders_sync()inincludes/class-wc-kueski-gateway-api.php, called fromincludes/class-wc-kueski-gateway-cron-manager.phpandincludes/class-wc-kueski-gateway-conciliator.php.
Kueski Pay middleware, refund a payment: POST api/v1/order/refund
- What it does: refunds part or all of a Kueski Pay payment.
- When: an admin refunds an order from the Kueski refund box of the order screen.
- Data sent: the headers listed for create payment (your Kueski API key, User-Agent,
kp-identifier,kp-name,kp-version,kp-source,kp-trigger,kp-wp-version,kp-wc-version,kp-php-version) and, in the body, the Kueski payment ID, the refund amount and the reason (merchant_refund). - Code:
Kueski_Gateway_Api::kueskiRefundOrder()inincludes/class-wc-kueski-gateway-api.php, called fromincludes/class-kueski-gateway-refund.php.
