Changeset 3039359
- Timestamp:
- 02/21/2024 06:50:50 PM (2 years ago)
- File:
-
- 1 edited
-
qisstpay/trunk/gateways/QPBaseConfiguration.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
qisstpay/trunk/gateways/QPBaseConfiguration.php
r3039350 r3039359 2 2 3 3 class QPBaseConfiguration extends WC_Payment_Gateway{ 4 5 6 4 7 5 /* … … 51 49 } 52 50 53 54 55 51 function athenticatedToken() 56 52 { 57 58 59 53 $token = $this->_this->get_option( 'merchant_token' ); 60 54 $result = array( … … 156 150 } 157 151 158 159 160 152 function getMerchantGatewaysView() { 161 153 … … 170 162 if ( $resultToken['status'] ) { 171 163 172 173 164 $curl = curl_init(); 174 165 175 176 166 $url = $this->getQPBaseUrl() . "ms-web-external-apis/merchants/v1/payment/methods"; 177 178 167 179 168 curl_setopt_array( $curl, array( … … 221 210 222 211 return $result; 223 224 } 225 212 } 226 213 227 214 function createPayload( $order_id,$transaction_number,$callbackUrl=null) { 228 215 $order = wc_get_order( $order_id ); 229 216 230 231 217 if ( $order ) { 232 218 … … 234 220 235 221 $line_item= []; 236 237 238 222 239 223 foreach ($wpLineItems as $row){ … … 247 231 $description = $productDetail->get_description(); 248 232 249 250 233 $terms = get_the_terms($item_data['product_id'], 'product_cat'); 251 234 252 235 //$product_cats_ids = wc_get_product_term_ids( $product->get_id(), 'product_cat' ); 253 254 255 236 $categories = []; 256 237 $sub_categories = []; … … 264 245 } 265 246 266 267 268 269 270 271 247 if (is_array($categories) && is_array($categories) >0){ 272 248 … … 278 254 } 279 255 280 281 282 283 284 256 $attributes = $this->getVariations($product); 285 286 287 288 257 289 258 $imgUrl = null; … … 297 266 $sku = $productDetail->get_sku(); 298 267 299 300 268 $tags = []; 301 269 302 270 $itemtags = $product->tag_ids; 303 304 271 305 272 foreach($itemtags as $tag) { … … 346 313 } 347 314 348 349 350 315 $line_item = json_encode($line_item); 351 352 316 353 317 $paymentGtway = "ubl"; … … 360 324 $qp_account_number=null; 361 325 $customer_cnic=null; 362 363 364 365 366 367 326 368 327 $payload = '{ … … 415 374 return false; 416 375 } 417 418 419 } 420 376 } 421 377 422 378 function getVariations($product) … … 501 457 curl_close( $curl ); 502 458 }catch (\Exception $exception){ 503 504 } 505 459 } 506 460 return json_decode( $response ); 507 508 461 } 509 462
Note: See TracChangeset
for help on using the changeset viewer.