Skip to content

Commit

Permalink
use paid flag in order endpoint (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
rheber authored May 7, 2024
1 parent 6ac668d commit f4e9ce1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spiff-connect/spiff-connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,15 @@ function spiff_create_order($order_id) {
if (!empty($items)) {
$access_key = get_option('spiff_api_key');
$secret_key = get_option('spiff_api_secret');
spiff_post_order($access_key, $secret_key, $items, $order->get_id());
spiff_post_order($access_key, $secret_key, $items, $order->get_id(), $order->is_paid());
}
}

// Craft the request to the Spiff orders endpoint.
function spiff_post_order($access_key, $secret_key, $items, $woo_order_id) {
function spiff_post_order($access_key, $secret_key, $items, $woo_order_id, $paid) {
$body = json_encode(array(
'externalId' => $woo_order_id,
'autoPrint' => false,
'paid' => $paid,
'orderItems' => $items
));
$headers = spiff_request_headers($access_key, $secret_key, $body, SPIFF_API_ORDERS_PATH);
Expand Down

0 comments on commit f4e9ce1

Please sign in to comment.