Changeset 2972309
- Timestamp:
- 09/27/2023 03:37:27 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
loystar-woocommerce-loyalty-program/trunk/includes/api/class-api.php
r2237449 r2972309 12 12 * @var string 13 13 */ 14 protected $base_url = 'https://api.loystar.co/api/v2/'; 14 // protected $base_url = 'https://api.loystar.co/api/v2/'; 15 protected $base_url = 'https://api0.loystar.co/api/v2/'; 15 16 16 17 /** … … 519 520 */ 520 521 public function get_merchant_products($id = 0,$single_data_index_arr_form = false,$include_deleted = false){ 521 $url = $this->base_url.'get_latest_merchant_products'; 522 $url = $this->base_url.'get_latest_merchant_products?page[size]=50000'; 523 // $url = $this->base_url.'get_latest_merchant_products'; 522 524 $data = array('data' => array('time_stamp'=>0) ); 523 525 if(!$this->get_endpoint($url, $this->remote_args(['body' => json_encode($data)] )) ){ … … 729 731 "business_branch_id" => $branch, 730 732 "user_id" => $customer['user_id'], 733 "payment_reference" => "woo_comm_".$order_id, 734 "reference_code" => time(), 731 735 "transactions" => array() 732 736 ]); 733 737 $transaction_data = array();//for product 734 735 738 $transaction_data_array = array( 736 739 "points"=> 0, … … 780 783 } 781 784 } 785 //quantity of item 786 $transaction_data_array['quantity'] = $item_data->get_quantity(); 787 //timestamp 788 $transaction_data_array['created_at'] = time(); 789 //product type 790 $transaction_data_array['product_type'] = "product"; 791 782 792 //update transaction_data_array 783 793 if(strtolower($loyalty_program['program_type']) == 'simplepoints') … … 790 800 } 791 801 $send_data['sale']['transactions'] = $transaction_data; 802 // var_dump($send_data); die; 792 803 //check if there was error 500 while adding product to branch error 793 804 if($add_p_to_branch_500_error){//record … … 796 807 $url = $this->base_url.'sales'; 797 808 $send_data_json = json_encode($send_data); 809 // print_r($send_data_json); die; 798 810 $remote_args = $this->remote_args(['body' => $send_data_json]); 799 811 if(!$this->get_endpoint($url, $remote_args)){
Note: See TracChangeset
for help on using the changeset viewer.