Plugin Directory

Changeset 2847454


Ignore:
Timestamp:
01/12/2023 01:56:40 PM (3 years ago)
Author:
paystack
Message:

Update to version 1.0.3 from GitHub

Location:
paystack-for-events-calendar
Files:
12 added
46 edited
1 copied

Legend:

Unmodified
Added
Removed
  • paystack-for-events-calendar/assets/banner-1544x500.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • paystack-for-events-calendar/assets/banner-772x250.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • paystack-for-events-calendar/assets/icon-128x128.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • paystack-for-events-calendar/assets/icon-256x256.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • paystack-for-events-calendar/tags/1.0.3/assets/js/checkout.js

    r2846787 r2847454  
    66 * @type   {Object}
    77 */
    8  tribe.tickets.commerce.gateway.paystack = tribe.tickets.commerce.gateway.paystack || {};
     8tribe.tickets.commerce.gateway.paystack = tribe.tickets.commerce.gateway.paystack || {};
    99
    1010/**
     
    4040            this.container = $( tribe.tickets.commerce.selectors.checkoutContainer );
    4141        },
    42         getSettings: function () {
     42        getSettings: function ( leaveMeta = false ) {
    4343            let settings = {
    4444                key: tecTicketsPaystackCheckout.publicKey,
     
    4747                email: this.email_address.val(),
    4848                amount: this.total.val() * 100,
    49                 currency: tecTicketsPaystackCheckout.currency_code,
     49                currency: tecTicketsPaystackCheckout.currency_code
    5050            }
    5151            if ( 0 < this.sub_account.length && '' !== this.sub_account.val() ) {
     
    5454                settings.split_code = this.split_trans.val();
    5555            }
     56
     57            if ( false == leaveMeta ) {
     58                settings.metaData = tecTicketsPaystackCheckout.metaData;
     59            }
     60
    5661            return settings;
    5762        },
     
    8893
    8994            let bodyArgs = {
    90                 purchaser: tribe.tickets.commerce.getPurchaserData( $this.container )
     95                purchaser: tribe.tickets.commerce.getPurchaserData( $this.container ),
     96                cart: $this.getSettings()
    9197            }
    9298
    9399            if ( 'redirect' == tecTicketsPaystackCheckout.gatewayMode ) {
    94100                bodyArgs.redirect_url = window.location.href;
    95                 bodyArgs.cart         = $this.getSettings();
    96101            }
    97102
     
    128133            let $this = this;
    129134
    130             let settings = this.getSettings();
     135            let settings = this.getSettings( true );
    131136           
    132137            settings.ref = order.id; // Uses the Order ID
    133 
     138            if ( undefined != order.meta ) {
     139                settings.metadata = {
     140                    plugin:'the-events-calendar'
     141                };
     142                settings.metadata.custom_fields = order.meta;
     143            } else {
     144                settings.metadata = {};
     145            }
     146           
    134147            settings.onClose = function( response ){
    135148                response = {
     
    155168            };
    156169
     170            tribe.tickets.debug.log( 'paystackPopUpSettings', settings );
    157171            let handler = PaystackPop.setup( settings );
    158172            handler.openIframe();
  • paystack-for-events-calendar/tags/1.0.3/classes/REST/Order_Endpoint.php

    r2846787 r2847454  
    2828 * @since   5.1.9
    2929 *
    30  * @package TEC\Tickets\Commerce\Gateways\PayPal\REST
     30 * @package TEC\Tickets\Commerce\Gateways\Paystack\REST
    3131 */
    3232class Order_Endpoint extends Abstract_REST_Endpoint {
     
    8787
    8888    /**
    89      * Handles the request that creates an order with Tickets Commerce and the PayPal gateway.
     89     * Handles the request that creates an order with Tickets Commerce and the Paystack gateway.
    9090     *
    9191     * @since 5.1.9
     
    100100        );
    101101
    102         $data      = $request->get_json_params();
    103         $purchaser = tribe( Order::class )->get_purchaser_data( $data );
     102        $data        = $request->get_json_params();
     103        $purchaser   = tribe( Order::class )->get_purchaser_data( $data );
     104        $cart_string = array();
    104105
    105106        if ( is_wp_error( $purchaser ) ) {
     
    129130                'sku'         => $ticket->sku,
    130131            );
     132
     133            $cart_string[] = $item['quantity'] . ' x ' . $ticket->name;
     134        }
     135
     136        //generate the metadata
     137        $metadata = array();
     138        $metadata[] = array(
     139            'display_name'  => 'Plugin',
     140            'variable_name' => 'plugin',
     141            'value'         => 'the-events-calendar',
     142        );
     143        if ( isset( $data['cart']['metaData'] ) ) {
     144            foreach ( $data['cart']['metaData'] as $datafield ) {
     145
     146                $save_field = '';
     147
     148                switch ( $datafield ) {
     149                    case 'order_id':
     150                        $save_field = array(
     151                            'display_name'  => 'Order ID',
     152                            'variable_name' => 'order_id',
     153                            'value'         => $order->ID,
     154                        );
     155                        break;
     156
     157                    case 'customer_name':
     158                        $save_field = array(
     159                            'display_name'  => 'Customer Name',
     160                            'variable_name' => 'customer_name',
     161                            'value'         => $order->purchaser['first_name'],
     162                        );
     163                        break;
     164
     165                    case 'customer_surname':
     166                        $save_field = array(
     167                            'display_name'  => 'Customer Surname',
     168                            'variable_name' => 'customer_surname',
     169                            'value'         => $order->purchaser['last_name'],
     170                        );
     171                        break;
     172
     173                    case 'cart_details':
     174                        $save_field = array(
     175                            'display_name'  => 'Cart Details',
     176                            'variable_name' => 'cart_details',
     177                            'value'         => implode( ',', $cart_string ),
     178                        );
     179                        break;
     180                }
     181
     182                if ( '' !== $save_field ) {
     183                    $metadata[] = $save_field;
     184                }
     185            }
    131186        }
    132187
     
    141196                'reference'    => $order->ID,
    142197            );
     198            $redirect_data['metadata']['plugin'] =  'the-events-calendar';
     199            if ( ! empty( $metadata ) ) {
     200                $redirect_data['metadata']['custom_fields'] = $metadata;
     201            }
    143202
    144203            if ( isset( $data['cart']['subaccount'] ) ) {
     
    172231        }
    173232
    174         // Respond with the ID for Paypal Usage.
     233        // Respond with the ID for Paystack Usage.
    175234        $response['success'] = true;
    176235        $response['id']      = $order->ID;
     236        $response['meta']    = $metadata;
    177237
    178238        return new WP_REST_Response( $response );
     
    180240
    181241    /**
    182      * Handles the request that updates an order with Tickets Commerce and the PayPal gateway.
     242     * Handles the request that updates an order with Tickets Commerce and the Paystack gateway.
    183243     *
    184244     * @since 5.1.9
     
    341401
    342402    /**
    343      * Arguments used for the updating order for PayPal.
     403     * Arguments used for the updating order for Paystack.
    344404     *
    345405     * @since 5.1.9
  • paystack-for-events-calendar/tags/1.0.3/classes/class-assets.php

    r2846787 r2847454  
    7676        }
    7777
     78        $metadata = array(
     79            'none',
     80        );
     81        $assigned_meta = $gateway->get_option( 'metadata' );
     82        if ( ! empty( $assigned_meta ) ) {
     83            $metadata = $assigned_meta;
     84        }
     85
    7886        tribe_asset(
    7987            $plugin,
     
    103111                        'currency_code' => $currency_code,
    104112                        'gatewayMode'   => $checkout_mode,
     113                        'metaData'      => $metadata,
    105114                        'errorMessages' => array(
    106115                            'name'    => esc_html__( 'Name is required', 'paystack-for-events-calendar' ),
     
    116125
    117126    /**
    118      * Define if the assets for `PayPal` should be enqueued or not.
     127     * Define if the assets for `Paystack` should be enqueued or not.
    119128     *
    120129     * @since 5.1.10
    121130     *
    122      * @return bool If the `PayPal` assets should be enqueued or not.
     131     * @return bool If the `Paystack` assets should be enqueued or not.
    123132     */
    124133    public function should_enqueue_assets() {
     
    127136
    128137    /**
    129      * Define if the assets for `PayPal` should be enqueued or not.
     138     * Define if the assets for `Paystack` should be enqueued or not.
    130139     *
    131140     * @since 5.1.10
    132141     *
    133      * @return bool If the `PayPal` assets should be enqueued or not.
     142     * @return bool If the `Paystack` assets should be enqueued or not.
    134143     */
    135144    public function should_enqueue_assets_payments_tab() {
  • paystack-for-events-calendar/tags/1.0.3/classes/class-gateway.php

    r2846787 r2847454  
    8383        }
    8484
    85         // If option is not explicitly set, the default will be if PayPal is connected.
     85        // If option is not explicitly set, the default will be if Paystack is connected.
    8686        return static::is_connected();
    8787    }
     
    150150            return $options[ $key ];
    151151        }
    152         // If option is not explicitly set, the default will be if PayPal is connected.
     152        // If option is not explicitly set, the default will be if Paystack is connected.
    153153        return false;
    154154    }
  • paystack-for-events-calendar/tags/1.0.3/classes/class-hooks.php

    r2846787 r2847454  
    4848
    4949    /**
    50      * Register the Endpoints from Paypal.
     50     * Register the Endpoints from Paystack.
    5151     *
    5252     * @since 5.1.9
  • paystack-for-events-calendar/tags/1.0.3/classes/class-merchant.php

    r2846787 r2847454  
    2929        'checkout_mode',
    3030        'transaction_type',
     31        'metadata',
    3132    );
    3233
  • paystack-for-events-calendar/tags/1.0.3/classes/class-settings.php

    r2846787 r2847454  
    4141        'checkout_mode'    => 'popup',
    4242        'transaction_type' => '',
     43        'metadata'         => array(),
    4344    );
    4445
  • paystack-for-events-calendar/tags/1.0.3/classes/class-signup.php

    r2846787 r2847454  
    33
    44use TEC\Tickets\Commerce\Gateways\Contracts\Abstract_Signup;
    5 use TEC\Tickets\Commerce\Gateways\PayPal\Location\Country;
     5use TEC\Tickets\Commerce\Gateways\Paystack\Location\Country;
    66use TEC\Tickets\Commerce\Settings;
    77use Tribe__Utils__Array as Arr;
  • paystack-for-events-calendar/tags/1.0.3/languages/tec-paystack-en_EN.po

    r2846800 r2847454  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Paystack for The Events Calendar 1.0.2\n"
     5"Project-Id-Version: Paystack for The Events Calendar 1.0.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/plugin-the-events-calendar\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    218218
    219219#: paystack/admin-views/modal/signup-complete.php:24
    220 msgid "You are now connected to PayPal, here's what's next..."
     220msgid "You are now connected to Paystack, here's what's next..."
    221221msgstr ""
    222222
    223223#. Translators: %1$s: opening `a` tag to the knowledge base article. %2$s: closing `a` tag to the knowledge base article.
    224224#: paystack/admin-views/modal/signup-complete/content.php:20
    225 msgid "PayPal allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
     225msgid "Paystack allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
    226226msgstr ""
    227227
     
    300300
    301301#: paystack/checkout/order/details/capture-id.php:40
    302 msgid "PayPal Capture ID:"
    303 msgstr ""
     302msgid "Paystack Capture ID:"
     303msgstr ""
  • paystack-for-events-calendar/tags/1.0.3/languages/tec-paystack-en_US.po

    r2846800 r2847454  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Paystack for The Events Calendar 1.0.2\n"
     5"Project-Id-Version: Paystack for The Events Calendar 1.0.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/plugin-the-events-calendar\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    218218
    219219#: paystack/admin-views/modal/signup-complete.php:24
    220 msgid "You are now connected to PayPal, here's what's next..."
     220msgid "You are now connected to Paystack, here's what's next..."
    221221msgstr ""
    222222
    223223#. Translators: %1$s: opening `a` tag to the knowledge base article. %2$s: closing `a` tag to the knowledge base article.
    224224#: paystack/admin-views/modal/signup-complete/content.php:20
    225 msgid "PayPal allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
     225msgid "Paystack allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
    226226msgstr ""
    227227
     
    300300
    301301#: paystack/checkout/order/details/capture-id.php:40
    302 msgid "PayPal Capture ID:"
    303 msgstr ""
     302msgid "Paystack Capture ID:"
     303msgstr ""
  • paystack-for-events-calendar/tags/1.0.3/languages/tec-paystack.pot

    r2846800 r2847454  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Paystack for The Events Calendar 1.0.2\n"
     5"Project-Id-Version: Paystack for The Events Calendar 1.0.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/plugin-the-events-calendar\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    218218
    219219#: paystack/admin-views/modal/signup-complete.php:24
    220 msgid "You are now connected to PayPal, here's what's next..."
     220msgid "You are now connected to Paystack, here's what's next..."
    221221msgstr ""
    222222
    223223#. Translators: %1$s: opening `a` tag to the knowledge base article. %2$s: closing `a` tag to the knowledge base article.
    224224#: paystack/admin-views/modal/signup-complete/content.php:20
    225 msgid "PayPal allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
     225msgid "Paystack allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
    226226msgstr ""
    227227
     
    300300
    301301#: paystack/checkout/order/details/capture-id.php:40
    302 msgid "PayPal Capture ID:"
    303 msgstr ""
     302msgid "Paystack Capture ID:"
     303msgstr ""
  • paystack-for-events-calendar/tags/1.0.3/package.json

    r2846800 r2847454  
    11{
    22    "name": "tec-paystack",
    3     "version": "1.0.2",
     3    "version": "1.0.3",
    44    "description": "Paystack for The Events Calendar",
    55    "scripts": {
  • paystack-for-events-calendar/tags/1.0.3/paystack-tec.php

    r2846800 r2847454  
    55 * Description: Add-on for The Event Calendar that allows you to accept payments for event tickets via Paystack
    66 * Author:      Paystack
    7  * Version:     1.0.2
    8  * Author URI:  https://www.lsdev.biz/
     7 * Version:     1.0.3
     8 * Author URI:  https://paystack.com/
    99 * License:     GPL3
    1010 * Text Domain: paystack-for-events-calendar
     
    2020define( 'PS_TEC_CORE', __FILE__ );
    2121define( 'PS_TEC_URL', plugin_dir_url( __FILE__ ) );
    22 define( 'PS_TEC_VER', '1.0.2' );
     22define( 'PS_TEC_VER', '1.0.3' );
    2323
    2424/* ======================= Below is the Plugin Class init ========================= */
  • paystack-for-events-calendar/tags/1.0.3/paystack/admin-views/connect/active.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * The Template for displaying the Tickets Commerce PayPal Settings when connected.
     3 * The Template for displaying the Tickets Commerce Paystack Settings when connected.
    44 *
    55 * @version 5.3.0
    66 *
    77 * @since   5.1.10
    8  * @since   5.3.0 Using generic CSS classes for gateway instead of PayPal.
     8 * @since   5.3.0 Using generic CSS classes for gateway instead of Paystack.
    99 *
    1010 * @var Tribe__Tickets__Admin__Views                  $this                  [Global] Template object.
     
    2929    ?>
    3030
     31    <?php
     32        $metadata_args = array(
     33            'selected' => $merchant->get_prop( 'metadata' ),
     34        );
     35        $this->template( 'paystack/admin-views/fields/metadata-options', $metadata_args );
     36    ?>
     37
    3138<fieldset id="tribe-field-ticket-display-tickets-left-threshold" class="tribe-field tribe-field-text tribe-size-small">
    3239    <legend class="tribe-field-label"><?php echo esc_html_e( 'Webhooks', 'paystack-for-events-calendar' ); ?></legend>
  • paystack-for-events-calendar/tags/1.0.3/paystack/admin-views/connect/logo.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * The Template for displaying the Tickets Commerce PayPal logo and features.
     3 * The Template for displaying the Tickets Commerce Paystack logo and features.
    44 *
    55 * @version 5.3.0
    66 *
    77 * @since   5.1.10
    8  * @since   5.3.0 Using generic CSS classes for gateway instead of PayPal.
     8 * @since   5.3.0 Using generic CSS classes for gateway instead of Paystack.
    99 *
    1010 * @var Tribe__Tickets__Admin__Views                  $this                  [Global] Template object.
    1111 * @var string                                        $plugin_url            [Global] The plugin URL.
    12  * @var TEC\Tickets\Commerce\Gateways\PayPal\Merchant $merchant              [Global] The merchant class.
    13  * @var TEC\Tickets\Commerce\Gateways\PayPal\Signup   $signup                [Global] The Signup class.
     12 * @var TEC\Tickets\Commerce\Gateways\Paystack\Merchant $merchant              [Global] The merchant class.
     13 * @var TEC\Tickets\Commerce\Gateways\Paystack\Signup   $signup                [Global] The Signup class.
    1414 * @var bool                                          $is_merchant_active    [Global] Whether the merchant is active or not.
    1515 * @var bool                                          $is_merchant_connected [Global] Whether the merchant is connected or not.
     
    2020<div class="tec-tickets__admin-settings-tickets-commerce-gateway-logo">
    2121
    22     <?php $this->template( 'settings/tickets-commerce/paypal/connect/logo/image' ); ?>
     22    <?php $this->template( 'settings/tickets-commerce/paystack/connect/logo/image' ); ?>
    2323
    24     <?php $this->template( 'settings/tickets-commerce/paypal/connect/logo/features' ); ?>
     24    <?php $this->template( 'settings/tickets-commerce/paystack/connect/logo/features' ); ?>
    2525
    2626</div>
  • paystack-for-events-calendar/tags/1.0.3/paystack/admin-views/fields/country-select.php

    r2846787 r2847454  
    55    'ZA' => esc_html__( 'South Africa', 'paystack-for-events-calendar' ),
    66);
    7 $default_country_code  = \TEC\Tickets\Commerce\Gateways\PayPal\Location\Country::DEFAULT_COUNTRY_CODE;
     7$default_country_code  = \TEC\Tickets\Commerce\Gateways\Paystack\Location\Country::DEFAULT_COUNTRY_CODE;
    88$selected_country_code = $country_code;
    99if ( empty( $selected_country_code ) ) {
  • paystack-for-events-calendar/tags/1.0.3/paystack/admin-views/main.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * The Template for displaying the Tickets Commerce PayPal Settings.
     3 * The Template for displaying the Tickets Commerce Paystack Settings.
    44 *
    55 * @version 5.3.0
    66 *
    77 * @since   5.1.10
    8  * @since   5.3.0 Using generic CSS classes for gateway instead of PayPal.
     8 * @since   5.3.0 Using generic CSS classes for gateway instead of Paystack.
    99 *
    1010 * @var Tribe__Tickets__Admin__Views                  $this                  [Global] Template object.
  • paystack-for-events-calendar/tags/1.0.3/paystack/checkout/container.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * Tickets Commerce: PayPal Checkout container
     3 * Tickets Commerce: Paystack Checkout container
    44 *
    55 * Override this template in your own theme by creating a file at:
    6  * [your-theme]/tribe/tickets/v2/commerce/gateway/paypal/container.php
     6 * [your-theme]/tribe/tickets/v2/commerce/gateway/paystack/container.php
    77 *
    88 * See more documentation about our views templating system.
  • paystack-for-events-calendar/tags/1.0.3/paystack/checkout/fields/submit.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * Tickets Commerce: Checkout Advanced Payments for PayPal - Submit
     3 * Tickets Commerce: Checkout Advanced Payments for Paystack - Submit
    44 *
    55 * Override this template in your own theme by creating a file at:
    6  * [your-theme]/tribe/tickets/v2/commerce/gateway/paypal/advanced-payments/fields/submit.php
     6 * [your-theme]/tribe/tickets/v2/commerce/gateway/paystack/advanced-payments/fields/submit.php
    77 *
    88 * See more documentation about our views templating system.
     
    2020$classes = [
    2121    'tribe-common-c-btn',
    22     'tribe-tickets__commerce-checkout-paypal-advanced-payments-form-submit-button',
     22    'tribe-tickets__commerce-checkout-paystack-advanced-payments-form-submit-button',
    2323];
    2424
  • paystack-for-events-calendar/tags/1.0.3/paystack/checkout/order/details/capture-id.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * Tickets Commerce: Success Order Page Details > PayPal capture ID
     3 * Tickets Commerce: Success Order Page Details > Paystack capture ID
    44 *
    55 * Override this template in your own theme by creating a file at:
    6  * [your-theme]/tribe/tickets/v2/commerce/gateway/paypal/order/details/capture-id.php
     6 * [your-theme]/tribe/tickets/v2/commerce/gateway/paystack/order/details/capture-id.php
    77 *
    88 * See more documentation about our views templating system.
     
    2020 * @var int              $order_id      [Global] The order ID.
    2121 * @var bool             $is_tec_active [Global] Whether `The Events Calendar` is active or not.
    22  * @var string           $capture_id    PayPal Capture ID for this order.
     22 * @var string           $capture_id    Paystack Capture ID for this order.
    2323 */
    2424
     
    3838<div class="tribe-tickets__commerce-order-details-row">
    3939    <div class="tribe-tickets__commerce-order-details-col1">
    40         <?php esc_html_e( 'PayPal Capture ID:', 'paystack-for-events-calendar' ); ?>
     40        <?php esc_html_e( 'Paystack Capture ID:', 'paystack-for-events-calendar' ); ?>
    4141    </div>
    4242    <div class="tribe-tickets__commerce-order-details-col2">
  • paystack-for-events-calendar/tags/1.0.3/readme.txt

    r2846800 r2847454  
    22Contributors: paystack, feedmymedia, krugazul, lightspeed
    33Tags: the events calendar, paystack, payment gateway
    4 Requires at least: 6.1.1
     4Requires at least: 5.8.6
    55Tested up to: 6.1.1
    6 Stable tag: 1.0.2
     6Stable tag: 1.0.3
    77Requires PHP: 8.0
    88License: GPL3
  • paystack-for-events-calendar/trunk/assets/js/checkout.js

    r2846787 r2847454  
    66 * @type   {Object}
    77 */
    8  tribe.tickets.commerce.gateway.paystack = tribe.tickets.commerce.gateway.paystack || {};
     8tribe.tickets.commerce.gateway.paystack = tribe.tickets.commerce.gateway.paystack || {};
    99
    1010/**
     
    4040            this.container = $( tribe.tickets.commerce.selectors.checkoutContainer );
    4141        },
    42         getSettings: function () {
     42        getSettings: function ( leaveMeta = false ) {
    4343            let settings = {
    4444                key: tecTicketsPaystackCheckout.publicKey,
     
    4747                email: this.email_address.val(),
    4848                amount: this.total.val() * 100,
    49                 currency: tecTicketsPaystackCheckout.currency_code,
     49                currency: tecTicketsPaystackCheckout.currency_code
    5050            }
    5151            if ( 0 < this.sub_account.length && '' !== this.sub_account.val() ) {
     
    5454                settings.split_code = this.split_trans.val();
    5555            }
     56
     57            if ( false == leaveMeta ) {
     58                settings.metaData = tecTicketsPaystackCheckout.metaData;
     59            }
     60
    5661            return settings;
    5762        },
     
    8893
    8994            let bodyArgs = {
    90                 purchaser: tribe.tickets.commerce.getPurchaserData( $this.container )
     95                purchaser: tribe.tickets.commerce.getPurchaserData( $this.container ),
     96                cart: $this.getSettings()
    9197            }
    9298
    9399            if ( 'redirect' == tecTicketsPaystackCheckout.gatewayMode ) {
    94100                bodyArgs.redirect_url = window.location.href;
    95                 bodyArgs.cart         = $this.getSettings();
    96101            }
    97102
     
    128133            let $this = this;
    129134
    130             let settings = this.getSettings();
     135            let settings = this.getSettings( true );
    131136           
    132137            settings.ref = order.id; // Uses the Order ID
    133 
     138            if ( undefined != order.meta ) {
     139                settings.metadata = {
     140                    plugin:'the-events-calendar'
     141                };
     142                settings.metadata.custom_fields = order.meta;
     143            } else {
     144                settings.metadata = {};
     145            }
     146           
    134147            settings.onClose = function( response ){
    135148                response = {
     
    155168            };
    156169
     170            tribe.tickets.debug.log( 'paystackPopUpSettings', settings );
    157171            let handler = PaystackPop.setup( settings );
    158172            handler.openIframe();
  • paystack-for-events-calendar/trunk/classes/REST/Order_Endpoint.php

    r2846787 r2847454  
    2828 * @since   5.1.9
    2929 *
    30  * @package TEC\Tickets\Commerce\Gateways\PayPal\REST
     30 * @package TEC\Tickets\Commerce\Gateways\Paystack\REST
    3131 */
    3232class Order_Endpoint extends Abstract_REST_Endpoint {
     
    8787
    8888    /**
    89      * Handles the request that creates an order with Tickets Commerce and the PayPal gateway.
     89     * Handles the request that creates an order with Tickets Commerce and the Paystack gateway.
    9090     *
    9191     * @since 5.1.9
     
    100100        );
    101101
    102         $data      = $request->get_json_params();
    103         $purchaser = tribe( Order::class )->get_purchaser_data( $data );
     102        $data        = $request->get_json_params();
     103        $purchaser   = tribe( Order::class )->get_purchaser_data( $data );
     104        $cart_string = array();
    104105
    105106        if ( is_wp_error( $purchaser ) ) {
     
    129130                'sku'         => $ticket->sku,
    130131            );
     132
     133            $cart_string[] = $item['quantity'] . ' x ' . $ticket->name;
     134        }
     135
     136        //generate the metadata
     137        $metadata = array();
     138        $metadata[] = array(
     139            'display_name'  => 'Plugin',
     140            'variable_name' => 'plugin',
     141            'value'         => 'the-events-calendar',
     142        );
     143        if ( isset( $data['cart']['metaData'] ) ) {
     144            foreach ( $data['cart']['metaData'] as $datafield ) {
     145
     146                $save_field = '';
     147
     148                switch ( $datafield ) {
     149                    case 'order_id':
     150                        $save_field = array(
     151                            'display_name'  => 'Order ID',
     152                            'variable_name' => 'order_id',
     153                            'value'         => $order->ID,
     154                        );
     155                        break;
     156
     157                    case 'customer_name':
     158                        $save_field = array(
     159                            'display_name'  => 'Customer Name',
     160                            'variable_name' => 'customer_name',
     161                            'value'         => $order->purchaser['first_name'],
     162                        );
     163                        break;
     164
     165                    case 'customer_surname':
     166                        $save_field = array(
     167                            'display_name'  => 'Customer Surname',
     168                            'variable_name' => 'customer_surname',
     169                            'value'         => $order->purchaser['last_name'],
     170                        );
     171                        break;
     172
     173                    case 'cart_details':
     174                        $save_field = array(
     175                            'display_name'  => 'Cart Details',
     176                            'variable_name' => 'cart_details',
     177                            'value'         => implode( ',', $cart_string ),
     178                        );
     179                        break;
     180                }
     181
     182                if ( '' !== $save_field ) {
     183                    $metadata[] = $save_field;
     184                }
     185            }
    131186        }
    132187
     
    141196                'reference'    => $order->ID,
    142197            );
     198            $redirect_data['metadata']['plugin'] =  'the-events-calendar';
     199            if ( ! empty( $metadata ) ) {
     200                $redirect_data['metadata']['custom_fields'] = $metadata;
     201            }
    143202
    144203            if ( isset( $data['cart']['subaccount'] ) ) {
     
    172231        }
    173232
    174         // Respond with the ID for Paypal Usage.
     233        // Respond with the ID for Paystack Usage.
    175234        $response['success'] = true;
    176235        $response['id']      = $order->ID;
     236        $response['meta']    = $metadata;
    177237
    178238        return new WP_REST_Response( $response );
     
    180240
    181241    /**
    182      * Handles the request that updates an order with Tickets Commerce and the PayPal gateway.
     242     * Handles the request that updates an order with Tickets Commerce and the Paystack gateway.
    183243     *
    184244     * @since 5.1.9
     
    341401
    342402    /**
    343      * Arguments used for the updating order for PayPal.
     403     * Arguments used for the updating order for Paystack.
    344404     *
    345405     * @since 5.1.9
  • paystack-for-events-calendar/trunk/classes/class-assets.php

    r2846787 r2847454  
    7676        }
    7777
     78        $metadata = array(
     79            'none',
     80        );
     81        $assigned_meta = $gateway->get_option( 'metadata' );
     82        if ( ! empty( $assigned_meta ) ) {
     83            $metadata = $assigned_meta;
     84        }
     85
    7886        tribe_asset(
    7987            $plugin,
     
    103111                        'currency_code' => $currency_code,
    104112                        'gatewayMode'   => $checkout_mode,
     113                        'metaData'      => $metadata,
    105114                        'errorMessages' => array(
    106115                            'name'    => esc_html__( 'Name is required', 'paystack-for-events-calendar' ),
     
    116125
    117126    /**
    118      * Define if the assets for `PayPal` should be enqueued or not.
     127     * Define if the assets for `Paystack` should be enqueued or not.
    119128     *
    120129     * @since 5.1.10
    121130     *
    122      * @return bool If the `PayPal` assets should be enqueued or not.
     131     * @return bool If the `Paystack` assets should be enqueued or not.
    123132     */
    124133    public function should_enqueue_assets() {
     
    127136
    128137    /**
    129      * Define if the assets for `PayPal` should be enqueued or not.
     138     * Define if the assets for `Paystack` should be enqueued or not.
    130139     *
    131140     * @since 5.1.10
    132141     *
    133      * @return bool If the `PayPal` assets should be enqueued or not.
     142     * @return bool If the `Paystack` assets should be enqueued or not.
    134143     */
    135144    public function should_enqueue_assets_payments_tab() {
  • paystack-for-events-calendar/trunk/classes/class-gateway.php

    r2846787 r2847454  
    8383        }
    8484
    85         // If option is not explicitly set, the default will be if PayPal is connected.
     85        // If option is not explicitly set, the default will be if Paystack is connected.
    8686        return static::is_connected();
    8787    }
     
    150150            return $options[ $key ];
    151151        }
    152         // If option is not explicitly set, the default will be if PayPal is connected.
     152        // If option is not explicitly set, the default will be if Paystack is connected.
    153153        return false;
    154154    }
  • paystack-for-events-calendar/trunk/classes/class-hooks.php

    r2846787 r2847454  
    4848
    4949    /**
    50      * Register the Endpoints from Paypal.
     50     * Register the Endpoints from Paystack.
    5151     *
    5252     * @since 5.1.9
  • paystack-for-events-calendar/trunk/classes/class-merchant.php

    r2846787 r2847454  
    2929        'checkout_mode',
    3030        'transaction_type',
     31        'metadata',
    3132    );
    3233
  • paystack-for-events-calendar/trunk/classes/class-settings.php

    r2846787 r2847454  
    4141        'checkout_mode'    => 'popup',
    4242        'transaction_type' => '',
     43        'metadata'         => array(),
    4344    );
    4445
  • paystack-for-events-calendar/trunk/classes/class-signup.php

    r2846787 r2847454  
    33
    44use TEC\Tickets\Commerce\Gateways\Contracts\Abstract_Signup;
    5 use TEC\Tickets\Commerce\Gateways\PayPal\Location\Country;
     5use TEC\Tickets\Commerce\Gateways\Paystack\Location\Country;
    66use TEC\Tickets\Commerce\Settings;
    77use Tribe__Utils__Array as Arr;
  • paystack-for-events-calendar/trunk/languages/tec-paystack-en_EN.po

    r2846800 r2847454  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Paystack for The Events Calendar 1.0.2\n"
     5"Project-Id-Version: Paystack for The Events Calendar 1.0.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/plugin-the-events-calendar\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    218218
    219219#: paystack/admin-views/modal/signup-complete.php:24
    220 msgid "You are now connected to PayPal, here's what's next..."
     220msgid "You are now connected to Paystack, here's what's next..."
    221221msgstr ""
    222222
    223223#. Translators: %1$s: opening `a` tag to the knowledge base article. %2$s: closing `a` tag to the knowledge base article.
    224224#: paystack/admin-views/modal/signup-complete/content.php:20
    225 msgid "PayPal allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
     225msgid "Paystack allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
    226226msgstr ""
    227227
     
    300300
    301301#: paystack/checkout/order/details/capture-id.php:40
    302 msgid "PayPal Capture ID:"
    303 msgstr ""
     302msgid "Paystack Capture ID:"
     303msgstr ""
  • paystack-for-events-calendar/trunk/languages/tec-paystack-en_US.po

    r2846800 r2847454  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Paystack for The Events Calendar 1.0.2\n"
     5"Project-Id-Version: Paystack for The Events Calendar 1.0.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/plugin-the-events-calendar\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    218218
    219219#: paystack/admin-views/modal/signup-complete.php:24
    220 msgid "You are now connected to PayPal, here's what's next..."
     220msgid "You are now connected to Paystack, here's what's next..."
    221221msgstr ""
    222222
    223223#. Translators: %1$s: opening `a` tag to the knowledge base article. %2$s: closing `a` tag to the knowledge base article.
    224224#: paystack/admin-views/modal/signup-complete/content.php:20
    225 msgid "PayPal allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
     225msgid "Paystack allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
    226226msgstr ""
    227227
     
    300300
    301301#: paystack/checkout/order/details/capture-id.php:40
    302 msgid "PayPal Capture ID:"
    303 msgstr ""
     302msgid "Paystack Capture ID:"
     303msgstr ""
  • paystack-for-events-calendar/trunk/languages/tec-paystack.pot

    r2846800 r2847454  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Paystack for The Events Calendar 1.0.2\n"
     5"Project-Id-Version: Paystack for The Events Calendar 1.0.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/plugin-the-events-calendar\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    218218
    219219#: paystack/admin-views/modal/signup-complete.php:24
    220 msgid "You are now connected to PayPal, here's what's next..."
     220msgid "You are now connected to Paystack, here's what's next..."
    221221msgstr ""
    222222
    223223#. Translators: %1$s: opening `a` tag to the knowledge base article. %2$s: closing `a` tag to the knowledge base article.
    224224#: paystack/admin-views/modal/signup-complete/content.php:20
    225 msgid "PayPal allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
     225msgid "Paystack allows you to accept credit or debit cards directly on your website. Because of this, your site needs to maintain %1$sPCI-DSS compliance%2$s."
    226226msgstr ""
    227227
     
    300300
    301301#: paystack/checkout/order/details/capture-id.php:40
    302 msgid "PayPal Capture ID:"
    303 msgstr ""
     302msgid "Paystack Capture ID:"
     303msgstr ""
  • paystack-for-events-calendar/trunk/package.json

    r2846800 r2847454  
    11{
    22    "name": "tec-paystack",
    3     "version": "1.0.2",
     3    "version": "1.0.3",
    44    "description": "Paystack for The Events Calendar",
    55    "scripts": {
  • paystack-for-events-calendar/trunk/paystack-tec.php

    r2846800 r2847454  
    55 * Description: Add-on for The Event Calendar that allows you to accept payments for event tickets via Paystack
    66 * Author:      Paystack
    7  * Version:     1.0.2
    8  * Author URI:  https://www.lsdev.biz/
     7 * Version:     1.0.3
     8 * Author URI:  https://paystack.com/
    99 * License:     GPL3
    1010 * Text Domain: paystack-for-events-calendar
     
    2020define( 'PS_TEC_CORE', __FILE__ );
    2121define( 'PS_TEC_URL', plugin_dir_url( __FILE__ ) );
    22 define( 'PS_TEC_VER', '1.0.2' );
     22define( 'PS_TEC_VER', '1.0.3' );
    2323
    2424/* ======================= Below is the Plugin Class init ========================= */
  • paystack-for-events-calendar/trunk/paystack/admin-views/connect/active.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * The Template for displaying the Tickets Commerce PayPal Settings when connected.
     3 * The Template for displaying the Tickets Commerce Paystack Settings when connected.
    44 *
    55 * @version 5.3.0
    66 *
    77 * @since   5.1.10
    8  * @since   5.3.0 Using generic CSS classes for gateway instead of PayPal.
     8 * @since   5.3.0 Using generic CSS classes for gateway instead of Paystack.
    99 *
    1010 * @var Tribe__Tickets__Admin__Views                  $this                  [Global] Template object.
     
    2929    ?>
    3030
     31    <?php
     32        $metadata_args = array(
     33            'selected' => $merchant->get_prop( 'metadata' ),
     34        );
     35        $this->template( 'paystack/admin-views/fields/metadata-options', $metadata_args );
     36    ?>
     37
    3138<fieldset id="tribe-field-ticket-display-tickets-left-threshold" class="tribe-field tribe-field-text tribe-size-small">
    3239    <legend class="tribe-field-label"><?php echo esc_html_e( 'Webhooks', 'paystack-for-events-calendar' ); ?></legend>
  • paystack-for-events-calendar/trunk/paystack/admin-views/connect/logo.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * The Template for displaying the Tickets Commerce PayPal logo and features.
     3 * The Template for displaying the Tickets Commerce Paystack logo and features.
    44 *
    55 * @version 5.3.0
    66 *
    77 * @since   5.1.10
    8  * @since   5.3.0 Using generic CSS classes for gateway instead of PayPal.
     8 * @since   5.3.0 Using generic CSS classes for gateway instead of Paystack.
    99 *
    1010 * @var Tribe__Tickets__Admin__Views                  $this                  [Global] Template object.
    1111 * @var string                                        $plugin_url            [Global] The plugin URL.
    12  * @var TEC\Tickets\Commerce\Gateways\PayPal\Merchant $merchant              [Global] The merchant class.
    13  * @var TEC\Tickets\Commerce\Gateways\PayPal\Signup   $signup                [Global] The Signup class.
     12 * @var TEC\Tickets\Commerce\Gateways\Paystack\Merchant $merchant              [Global] The merchant class.
     13 * @var TEC\Tickets\Commerce\Gateways\Paystack\Signup   $signup                [Global] The Signup class.
    1414 * @var bool                                          $is_merchant_active    [Global] Whether the merchant is active or not.
    1515 * @var bool                                          $is_merchant_connected [Global] Whether the merchant is connected or not.
     
    2020<div class="tec-tickets__admin-settings-tickets-commerce-gateway-logo">
    2121
    22     <?php $this->template( 'settings/tickets-commerce/paypal/connect/logo/image' ); ?>
     22    <?php $this->template( 'settings/tickets-commerce/paystack/connect/logo/image' ); ?>
    2323
    24     <?php $this->template( 'settings/tickets-commerce/paypal/connect/logo/features' ); ?>
     24    <?php $this->template( 'settings/tickets-commerce/paystack/connect/logo/features' ); ?>
    2525
    2626</div>
  • paystack-for-events-calendar/trunk/paystack/admin-views/fields/country-select.php

    r2846787 r2847454  
    55    'ZA' => esc_html__( 'South Africa', 'paystack-for-events-calendar' ),
    66);
    7 $default_country_code  = \TEC\Tickets\Commerce\Gateways\PayPal\Location\Country::DEFAULT_COUNTRY_CODE;
     7$default_country_code  = \TEC\Tickets\Commerce\Gateways\Paystack\Location\Country::DEFAULT_COUNTRY_CODE;
    88$selected_country_code = $country_code;
    99if ( empty( $selected_country_code ) ) {
  • paystack-for-events-calendar/trunk/paystack/admin-views/main.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * The Template for displaying the Tickets Commerce PayPal Settings.
     3 * The Template for displaying the Tickets Commerce Paystack Settings.
    44 *
    55 * @version 5.3.0
    66 *
    77 * @since   5.1.10
    8  * @since   5.3.0 Using generic CSS classes for gateway instead of PayPal.
     8 * @since   5.3.0 Using generic CSS classes for gateway instead of Paystack.
    99 *
    1010 * @var Tribe__Tickets__Admin__Views                  $this                  [Global] Template object.
  • paystack-for-events-calendar/trunk/paystack/checkout/container.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * Tickets Commerce: PayPal Checkout container
     3 * Tickets Commerce: Paystack Checkout container
    44 *
    55 * Override this template in your own theme by creating a file at:
    6  * [your-theme]/tribe/tickets/v2/commerce/gateway/paypal/container.php
     6 * [your-theme]/tribe/tickets/v2/commerce/gateway/paystack/container.php
    77 *
    88 * See more documentation about our views templating system.
  • paystack-for-events-calendar/trunk/paystack/checkout/fields/submit.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * Tickets Commerce: Checkout Advanced Payments for PayPal - Submit
     3 * Tickets Commerce: Checkout Advanced Payments for Paystack - Submit
    44 *
    55 * Override this template in your own theme by creating a file at:
    6  * [your-theme]/tribe/tickets/v2/commerce/gateway/paypal/advanced-payments/fields/submit.php
     6 * [your-theme]/tribe/tickets/v2/commerce/gateway/paystack/advanced-payments/fields/submit.php
    77 *
    88 * See more documentation about our views templating system.
     
    2020$classes = [
    2121    'tribe-common-c-btn',
    22     'tribe-tickets__commerce-checkout-paypal-advanced-payments-form-submit-button',
     22    'tribe-tickets__commerce-checkout-paystack-advanced-payments-form-submit-button',
    2323];
    2424
  • paystack-for-events-calendar/trunk/paystack/checkout/order/details/capture-id.php

    r2846787 r2847454  
    11<?php
    22/**
    3  * Tickets Commerce: Success Order Page Details > PayPal capture ID
     3 * Tickets Commerce: Success Order Page Details > Paystack capture ID
    44 *
    55 * Override this template in your own theme by creating a file at:
    6  * [your-theme]/tribe/tickets/v2/commerce/gateway/paypal/order/details/capture-id.php
     6 * [your-theme]/tribe/tickets/v2/commerce/gateway/paystack/order/details/capture-id.php
    77 *
    88 * See more documentation about our views templating system.
     
    2020 * @var int              $order_id      [Global] The order ID.
    2121 * @var bool             $is_tec_active [Global] Whether `The Events Calendar` is active or not.
    22  * @var string           $capture_id    PayPal Capture ID for this order.
     22 * @var string           $capture_id    Paystack Capture ID for this order.
    2323 */
    2424
     
    3838<div class="tribe-tickets__commerce-order-details-row">
    3939    <div class="tribe-tickets__commerce-order-details-col1">
    40         <?php esc_html_e( 'PayPal Capture ID:', 'paystack-for-events-calendar' ); ?>
     40        <?php esc_html_e( 'Paystack Capture ID:', 'paystack-for-events-calendar' ); ?>
    4141    </div>
    4242    <div class="tribe-tickets__commerce-order-details-col2">
  • paystack-for-events-calendar/trunk/readme.txt

    r2846800 r2847454  
    22Contributors: paystack, feedmymedia, krugazul, lightspeed
    33Tags: the events calendar, paystack, payment gateway
    4 Requires at least: 6.1.1
     4Requires at least: 5.8.6
    55Tested up to: 6.1.1
    6 Stable tag: 1.0.2
     6Stable tag: 1.0.3
    77Requires PHP: 8.0
    88License: GPL3
Note: See TracChangeset for help on using the changeset viewer.