Property | Type | Description | |
---|---|---|---|
$validator | WC_Connect_Services_Validator | ||
$wc_connect_loader | WC_Connect_Loader |
Method | Description | |
---|---|---|
__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 |
Method | Description | |
---|---|---|
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 ) |
Method | Description | |
---|---|---|
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 | ||
return | 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', ), ) |
return | object | WP_Error |
public get_label_status ( $label_id ) : object | WP_Error | ||
$label_id | integer | |
return | object | WP_Error |
public get_labels_preview_pdf ( $request ) : object | WP_Error | ||
$request | ||
return | object | WP_Error |
public get_labels_print_pdf ( $request ) : object | WP_Error | ||
$request | ||
return | object | WP_Error |
public get_payment_methods ( ) : mixed | WP_Error | ||
return | mixed | WP_Error |
public get_service_schemas ( ) : array | WP_Error | ||
return | 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() | |
return | object | WP_Error |
protected request_body ( array $initial_body = [] ) : array | ||
$initial_body | array | |
return | array |
protected request_headers ( ) : array | WP_Error | ||
return | 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 | |
return | object | WP_Error |
public validate_service_settings ( $service_slug, $service_settings ) : boolean | WP_Error | ||
$service_slug | ||
$service_settings | ||
return | boolean | WP_Error |
protected WC_Connect_Services_Validator $validator | ||
return | WC_Connect_Services_Validator |