Свойство | Тип | Описание | |
---|---|---|---|
$validator | WC_Connect_Services_Validator | ||
$wc_connect_loader | WC_Connect_Loader |
Метод | Описание | |
---|---|---|
__construct ( WC_Connect_Service_Schemas_Validator $validator, WC_Connect_Loader $wc_connect_loader ) | ||
auth_test ( ) : true | WP_Error | Tests the connection to the Connect for WooCommerce Server | |
get_label_rates ( array $request ) : object | WP_Error | Gets shipping rates (for labels) from the Connect for WooCommerce Server | |
get_label_status ( $label_id ) : object | WP_Error | Gets the shipping label status (refund status, tracking code, etc) | |
get_labels_preview_pdf ( $request ) : object | WP_Error | Gets a PDF with the set of dummy labels specified in the request | |
get_labels_print_pdf ( $request ) : object | WP_Error | Gets a PDF with the requested shipping labels in it | |
get_payment_methods ( ) : mixed | WP_Error | Asks the Connect for WooCommerce server for an array of payment methods | |
get_service_schemas ( ) : array | WP_Error | Requests the available services for this site from the Connect for WooCommerce Server | |
get_shipping_rates ( $services, $package, $boxes ) : object | WP_Error | Gets shipping rates (for checkout) from the Connect for WooCommerce Server | |
send_address_normalization_request ( $body ) | ||
send_shipping_label_refund_request ( $label_id ) : object | WP_Error | Request a refund for a given shipping label | |
send_shipping_label_request ( $body ) | ||
validate_service_settings ( $service_slug, $service_settings ) : boolean | WP_Error | Validates the settings for a given service with the Connect for WooCommerce Server |
Метод | Описание | |
---|---|---|
authorization_header ( ) | ||
request ( $method, $path, $body = [] ) : mixed | WP_Error | Sends a request to the Connect for WooCommerce Server | |
request_body ( array $initial_body = [] ) : array | Adds useful WP/WC/WCC information to request bodies | |
request_headers ( ) : array | WP_Error | Generates headers for our request to the Connect for WooCommerce Server | |
request_signature ( $token_key, $token_secret, $timestamp, $nonce, $time_diff ) |
Метод | Описание | |
---|---|---|
generate_guid ( ) : string | Generates a GUID. | |
get_guid ( ) |
public __construct ( WC_Connect_Service_Schemas_Validator $validator, WC_Connect_Loader $wc_connect_loader ) | ||
$validator | WC_Connect_Service_Schemas_Validator | |
$wc_connect_loader | WC_Connect_Loader |
public auth_test ( ) : true | WP_Error | ||
Результат | true | WP_Error |
public get_label_rates ( array $request ) : object | WP_Error | ||
$request | array | - array( 'packages' => array( array( 'id' => 'box_1', 'height' => 10, 'length' => 10, 'width' => 10, 'weight' => 10, ), array( 'id' => 'box_2', 'box_id' => 'medium_flat_box_top', 'weight' => 5, ), ... ), 'carrier' => 'usps', 'origin' => array( 'address' => '132 Hawthorne St', 'address_2' => '', 'city' => 'San Francisco', 'state' => 'CA', 'postcode' => '94107', 'country' => 'US', ), 'destination' => array( 'address' => '1550 Snow Creek Dr', 'address_2' => '', 'city' => 'Park City', 'state' => 'UT', 'postcode' => '84060', 'country' => 'US', ), ) |
Результат | object | WP_Error |
public get_label_status ( $label_id ) : object | WP_Error | ||
$label_id | integer | |
Результат | object | WP_Error |
public get_labels_preview_pdf ( $request ) : object | WP_Error | ||
$request | ||
Результат | object | WP_Error |
public get_labels_print_pdf ( $request ) : object | WP_Error | ||
$request | ||
Результат | object | WP_Error |
public get_payment_methods ( ) : mixed | WP_Error | ||
Результат | mixed | WP_Error |
public get_service_schemas ( ) : array | WP_Error | ||
Результат | array | WP_Error |
public get_shipping_rates ( $services, $package, $boxes ) : object | WP_Error | ||
$services | All settings for all services we want rates for | |
$package | Package provided to WC_Shipping_Method::calculate_shipping() | |
Результат | object | WP_Error |
protected request_body ( array $initial_body = [] ) : array | ||
$initial_body | array | |
Результат | array |
protected request_headers ( ) : array | WP_Error | ||
Результат | array | WP_Error |
protected request_signature ( $token_key, $token_secret, $timestamp, $nonce, $time_diff ) |
public send_address_normalization_request ( $body ) |
public send_shipping_label_refund_request ( $label_id ) : object | WP_Error | ||
$label_id | integer | |
Результат | object | WP_Error |
public validate_service_settings ( $service_slug, $service_settings ) : boolean | WP_Error | ||
$service_slug | ||
$service_settings | ||
Результат | boolean | WP_Error |
protected WC_Connect_Services_Validator $validator | ||
Результат | WC_Connect_Services_Validator |