Plugin Directory

Changeset 2205828


Ignore:
Timestamp:
12/04/2019 10:48:39 AM (6 years ago)
Author:
unlocklive
Message:

paysenz.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • woo-paysenz-payment-gateway/trunk/paysenz.php

    r2202268 r2205828  
    139139                $type               = 'WooCommerce Order';
    140140                $model_name         = '';
     141                $buyer_address      = $billing_info['address_1'] ? $billing_info['address_1'] : $billing_info['city'];
     142                $buyer_postcode     = $billing_info['postcode'] ? $billing_info['postcode'] : $billing_info['state'];
    141143
    142144                $make_array = array(
    143145                    'buyer_name'                => $billing_info['first_name'].' '.$billing_info['last_name'],
    144146                    'buyer_email'               => $billing_info['email'],
    145                     'buyer_address'             => $billing_info['address_1'],
     147                    'buyer_address'             => $buyer_address,
    146148                    'cus_city'                  => $billing_info['city'],
    147149                    'cus_state'                 => $billing_info['state'],
    148                     'cus_postcode'              => $billing_info['postcode'],
     150                    'cus_postcode'              => $buyer_postcode,
    149151                    'cus_country'               => $billing_info['country'],
    150152                    'buyer_contact_number'      => $billing_info['phone'],
     
    202204                if (!empty($_POST['payment_status']) && sanitize_text_field($_POST['payment_status']) == 'Successful') {
    203205                    $order = wc_get_order( sanitize_text_field($_POST['custom_4']) );
     206
     207                    // The text for the note
     208                    $make_notes = 'Total Amount: '.sanitize_text_field($_POST['payment_status']).', Paysenz Txn ID: '.sanitize_text_field($_POST['psz_txnid']).', Merchant Txn ID: '.sanitize_text_field($_POST['merchant_txnid']).', Type: '.sanitize_text_field($_POST['payment_type']).', Currency: '.sanitize_text_field($_POST['merchant_currency']).'';
     209
     210                    // Add the note
     211                    $order->add_order_note( $make_notes );
     212                   
     213                    // save
     214                    $order->save();
     215
    204216                    $order->payment_complete();
    205217
     
    214226
    215227                    $order = wc_get_order( sanitize_text_field($_GET['custom_4']) );
     228
     229                    // The text for the note
     230                    $make_notes = 'Total Amount: '.sanitize_text_field($_POST['payment_status']).', Paysenz Txn ID: '.sanitize_text_field($_POST['psz_txnid']).', Merchant Txn ID: '.sanitize_text_field($_POST['merchant_txnid']).', Type: '.sanitize_text_field($_POST['payment_type']).', Currency: '.sanitize_text_field($_POST['merchant_currency']).'';
     231
     232                    // Add the note
     233                    $order->add_order_note( $make_notes );
     234                   
     235                    // save
     236                    $order->save();
     237                   
    216238                    $order->payment_complete();
    217239                    //$order->wc_reduce_stock_levels();
Note: See TracChangeset for help on using the changeset viewer.