Plugin Directory

Changeset 3445785


Ignore:
Timestamp:
01/23/2026 07:42:13 PM (2 months ago)
Author:
coinsnap
Message:
  1. 1.0.1
Location:
coinsnap-bitcoin-invoice-form
Files:
52 added
6 edited

Legend:

Unmodified
Added
Removed
  • coinsnap-bitcoin-invoice-form/trunk/coinsnap-bitcoin-invoice-form.php

    r3439284 r3445785  
    22/*
    33 * Plugin Name:        Bitcoin Invoice Form
    4  * Plugin URI:         https://coinsnap.io/coinsnap-bitcoin-invoice-form/
     4 * Plugin URI:         https://coinsnap.io/modules/bitcoin-invoice/
    55 * Description:        Generate and embed customizable Bitcoin Invoice Forms on your website. Customers can complete and pay invoices directly on your site with payment processing via Coinsnap or BTCPay Server.
    6  * Version:            1.0.0
     6 * Version:            1.0.1
    77 * Author:             Coinsnap
    88 * Author URI:         https://coinsnap.io/
     
    2525
    2626if(!defined('COINSNAPBIF_REFERRAL_CODE' ) ) { define( 'COINSNAPBIF_REFERRAL_CODE', 'D85536' );}
    27 if(!defined('COINSNAPBIF_VERSION' ) ) { define( 'COINSNAPBIF_VERSION', '1.0.0' );}
     27if(!defined('COINSNAPBIF_VERSION' ) ) { define( 'COINSNAPBIF_VERSION', '1.0.1' );}
    2828if(!defined('COINSNAPBIF_PHP_VERSION' ) ) { define( 'COINSNAPBIF_PHP_VERSION', '7.4' );}
    2929if(!defined('COINSNAP_CURRENCIES')){define( 'COINSNAP_CURRENCIES', array("EUR","USD","SATS","BTC","CAD","JPY","GBP","CHF","RUB") );}
  • coinsnap-bitcoin-invoice-form/trunk/readme.txt

    r3441798 r3445785  
    44Tags: Lightning, bitcoin, invoice form, BTCPay
    55Tested up to: 6.9
    6 Stable tag: 1.0.0
     6Stable tag: 1.0.1
    77License: GPL2
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    230230= 1.0.0 :: 2026-01-14 =
    231231* Plugin is published in Wordpress plugin directory.
     232
     233= 1.0.1 :: 2026-01-23 =
     234* Update: added all the currencies supported by Coinsnap.
     235* Updated plugin URI.
     236* Updated default field labels for invoice form.
  • coinsnap-bitcoin-invoice-form/trunk/src/CPT/class-coinsnapbif-cpt-invoice-form-post-type.php

    r3439284 r3445785  
    105105            'description_enabled' => '1',
    106106            'description_required' => '0',
    107             'description_label'   => __( 'Your message to the Invoice receiver', 'coinsnap-bitcoin-invoice-form' ),
     107            'description_label'   => __( 'Your message to us', 'coinsnap-bitcoin-invoice-form' ),
    108108            'description_order'   => '70',
    109109            'button_text'         => __( 'Pay Invoice with Bitcoin', 'coinsnap-bitcoin-invoice-form' ),
     
    181181        echo '<h4 style="margin:0 0 10px 0;font-weight:bold;">' . esc_html__( 'Submit Button', 'coinsnap-bitcoin-invoice-form' ) . '</h4>';
    182182        echo '<div style="display:flex;align-items:center;gap:10px;">';
    183         echo '<label for="button_text" style="margin:0;font-weight:500;white-space:nowrap;">' . esc_html__( 'Button Text', 'coinsnap-bitcoin-invoice-form' ) . ':</label>';
     183        echo '<label for="button_text" style="margin:0;font-weight:500;white-space:nowrap; width:100px;">' . esc_html__( 'Button Text', 'coinsnap-bitcoin-invoice-form' ) . ':</label>';
    184184        echo '<input type="text" id="button_text" name="coinsnapbif_fields[button_text]" value="' . esc_attr( $values['button_text'] ) . '" style="flex:1;min-width:200px;padding:6px 10px;border:1px solid #ccc;border-radius:3px;" placeholder="' . esc_attr__( 'Pay with Bitcoin', 'coinsnap-bitcoin-invoice-form' ) . '" />';
    185185        echo '</div>';
     
    207207        echo '</div>';
    208208        echo '</div>';
     209               
     210               
     211                echo '<div style="display:flex;align-items:center;gap:10px; margin:15px 0 0;">';
     212        echo '<label for="discount_original_text" style="margin:0;font-weight:500;white-space:nowrap; width:100px;">' . esc_html__( 'Original', 'coinsnap-bitcoin-invoice-form' ) . ':</label>';
     213        echo '<input type="text" id="discount_original_text" name="coinsnapbif_fields[discount_original_text]" value="' . esc_attr( $values['discount_original_text'] ) . '" style="width:200px;padding:6px 10px;border:1px solid #ccc;border-radius:3px;" placeholder="' . esc_attr__( 'Original', 'coinsnap-bitcoin-invoice-form' ) . '" />';
     214        echo '</div>';
     215               
     216               
     217                echo '<div style="display:flex;align-items:center;gap:10px; margin:15px 0 0;">';
     218        echo '<label for="discount_discount_text" style="margin:0;font-weight:500;white-space:nowrap; width:100px;">' . esc_html__( 'Discount', 'coinsnap-bitcoin-invoice-form' ) . ':</label>';
     219        echo '<input type="text" id="discount_discount_text" name="coinsnapbif_fields[discount_discount_text]" value="' . esc_attr( $values['discount_discount_text'] ) . '" style="width:200px;padding:6px 10px;border:1px solid #ccc;border-radius:3px;" placeholder="' . esc_attr__( 'Discount', 'coinsnap-bitcoin-invoice-form' ) . '" />';
     220        echo '</div>';
     221               
     222               
     223                echo '<div style="display:flex;align-items:center;gap:10px; margin:15px 0 0;">';
     224        echo '<label for="discount_youpay_text" style="margin:0;font-weight:500;white-space:nowrap; width:100px;">' . esc_html__( 'You pay', 'coinsnap-bitcoin-invoice-form' ) . ':</label>';
     225        echo '<input type="text" id="discount_youpay_text" name="coinsnapbif_fields[discount_youpay_text]" value="' . esc_attr( $values['discount_youpay_text'] ) . '" style="width:200px;padding:6px 10px;border:1px solid #ccc;border-radius:3px;" placeholder="' . esc_attr__( 'You pay', 'coinsnap-bitcoin-invoice-form' ) . '" />';
     226        echo '</div>';
     227               
     228        echo '<p class="description" style="margin:15px 0 20px 0;color:#666;font-size:13px;">' . esc_html__( 'Customize amount and discount labels', 'coinsnap-bitcoin-invoice-form' ) . '</p>';
     229               
     230               
     231               
    209232        echo '<div class="bif-option-group" style="display:flex;flex-direction:column;gap:6px;margin-top:12px;">';
    210233        echo '<label for="discount_notice" style="margin:0;font-weight:500;">' . esc_html__( 'Customer-facing discount notice (optional)', 'coinsnap-bitcoin-invoice-form' ) . ':</label>';
     
    240263        echo '<fieldset class="bif-field-config" style="border:1px solid #ddd;padding:15px;margin:15px 0;border-radius:4px;background:#fafafa;">';
    241264        $legend_text = ( 'description' === $field_name )
    242             ? __( 'Message to the Invoice receiver', 'coinsnap-bitcoin-invoice-form' )
     265            ? __( 'Message to us', 'coinsnap-bitcoin-invoice-form' )
    243266            : ucwords( str_replace( '_', ' ', $field_name ) );
    244267        echo '<legend style="font-weight:bold;padding:0 8px;background:#fff;border-radius:3px;">' . esc_html( $legend_text ) . '</legend>';
     
    302325        echo '<p><label for="currency">' . esc_html__( 'Currency (per form)', 'coinsnap-bitcoin-invoice-form' ) . ':</label></p>';
    303326        echo '<select id="currency" name="coinsnapbif_payment[currency]" style="width:100%;">';
    304         echo '<option value="USD" ' . selected( $values['currency'], 'USD', false ) . '>USD</option>';
    305         echo '<option value="EUR" ' . selected( $values['currency'], 'EUR', false ) . '>EUR</option>';
    306         echo '<option value="CHF" ' . selected( $values['currency'], 'CHF', false ) . '>CHF</option>';
    307         echo '<option value="JPY" ' . selected( $values['currency'], 'JPY', false ) . '>JPY</option>';
    308         echo '<option value="SATS" ' . selected( $values['currency'], 'SATS', false ) . '>SATS</option>';
     327               
     328                foreach(COINSNAP_CURRENCIES as $currency){
     329                    echo '<option value="'.esc_html($currency).'" ' . selected( $values['currency'], $currency, false ) . '>'.esc_html($currency).'</option>';
     330                }
     331               
    309332        echo '</select>';
    310333
  • coinsnap-bitcoin-invoice-form/trunk/src/Providers/Payment/class-coinsnapprovider.php

    r3439284 r3445785  
    5555
    5656        // Validate currency code
    57         $supported_currencies = array( 'USD', 'EUR', 'CAD', 'JPY', 'GBP', 'CHF', 'BTC', 'SATS' );
     57        $supported_currencies = COINSNAP_CURRENCIES;
    5858        if ( ! in_array( $currency, $supported_currencies, true ) ) {
    5959            CoinsnapBIF_Logger::error( 'Unsupported currency for CoinSnap', array(
  • coinsnap-bitcoin-invoice-form/trunk/src/Services/class-coinsnapbif-services-payment-service.php

    r3439284 r3445785  
    4646
    4747            // Get form configuration
    48             $fields = get_post_meta( $form_id, '_bif_fields', true );
    49             $payment_config = get_post_meta( $form_id, '_bif_payment', true );
    50             $email_config = get_post_meta( $form_id, '_bif_email', true );
     48            $fields = get_post_meta( $form_id, '_coinsnapbif_fields', true );
     49            $payment_config = get_post_meta( $form_id, '_coinsnapbif_payment', true );
     50            $email_config = get_post_meta( $form_id, '_coinsnapbif_email', true );
    5151
    5252            // Set defaults
     
    132132                    $errors[] = sprintf(
    133133                                            /* translators: 1: Required value */
    134                                             __( '%s is required.', 'coinsnap-bitcoin-invoice-form' ), $label );
     134                                            __( '%s is required', 'coinsnap-bitcoin-invoice-form' ), $label );
    135135                                    } elseif ( 'email' === $f && ! is_email( $val ) ) {
    136136                    $errors[] = __( 'Please enter a valid email address.', 'coinsnap-bitcoin-invoice-form' );
     
    261261
    262262            // Get redirect configuration
    263             $redirect_config = get_post_meta( $form_id, '_bif_redirect', true );
     263            $redirect_config = get_post_meta( $form_id, '_coinsnapbif_redirect', true );
    264264            $redirect_config = wp_parse_args( $redirect_config, array(
    265265                'success_page' => '',
     
    517517        );
    518518
    519         $admin_config    = get_post_meta( $transaction->form_id, '_bif_email', true );
    520         $customer_config = get_post_meta( $transaction->form_id, '_bif_email_customer', true );
     519        $admin_config    = get_post_meta( $transaction->form_id, '_coinsnapbif_email', true );
     520        $customer_config = get_post_meta( $transaction->form_id, '_coinsnapbif_email_customer', true );
    521521
    522522        // Backward compatibility: if customer metabox not saved, fall back to any customer keys stored in admin metabox
  • coinsnap-bitcoin-invoice-form/trunk/src/Shortcode/class-coinsnapbif-shortcode-invoice-form-shortcode.php

    r3439284 r3445785  
    9595                'currency_enabled'    => '1',
    9696                'currency_required'   => '1',
    97                 'currency_label'      => __( 'Currency Selection', 'coinsnap-bitcoin-invoice-form' ),
     97                'currency_label'      => __( 'Currency', 'coinsnap-bitcoin-invoice-form' ),
    9898                'currency_order'      => '40',
    9999                'email_enabled'       => '1',
     
    276276
    277277            <?php if ( $disc_enabled && $disc_value > 0 ) : ?>
    278                 <div class="bif-discount-totals" role="status" aria-live="polite">
    279                     <div class="bif-totals-row">
    280                         <span class="bif-totals-label"><?php esc_html_e( 'Original', 'coinsnap-bitcoin-invoice-form' ); ?></span>
    281                         <span class="bif-totals-original" data-value="0">—</span>
    282                     </div>
    283                     <div class="bif-totals-row">
    284                         <span class="bif-totals-label"><?php esc_html_e( 'Discount', 'coinsnap-bitcoin-invoice-form' ); ?></span>
    285                         <span class="bif-totals-discount" data-value="0">—</span>
    286                     </div>
    287                     <div class="bif-totals-row bif-totals-final-row">
    288                         <span class="bif-totals-label"><?php esc_html_e( 'You pay', 'coinsnap-bitcoin-invoice-form' ); ?></span>
    289                         <span class="bif-totals-final" data-value="0">—</span>
    290                     </div>
    291                 </div>
     278            <div class="bif-discount-totals" role="status" aria-live="polite">
     279                            <div class="bif-totals-row">
     280                                <span class="bif-totals-label"><?php
     281                                if(isset($fields['discount_original_text']) && !empty($fields['discount_original_text'])){
     282                                    echo esc_html($fields['discount_original_text']);
     283                                } else {
     284                                    esc_html_e( 'Original', 'coinsnap-bitcoin-invoice-form' );
     285                                }?></span>
     286                <span class="bif-totals-original" data-value="0">—</span>
     287                            </div>
     288                            <div class="bif-totals-row">
     289                                <span class="bif-totals-label"><?php
     290                                if(isset($fields['discount_discount_text']) && !empty($fields['discount_discount_text'])){
     291                                    echo esc_html($fields['discount_discount_text']);
     292                                } else {
     293                                    esc_html_e( 'Discount', 'coinsnap-bitcoin-invoice-form' );
     294                                }?></span>
     295                                <span class="bif-totals-discount" data-value="0">—</span>
     296                            </div>
     297                            <div class="bif-totals-row bif-totals-final-row">
     298                                <span class="bif-totals-label"><?php
     299                                if(isset($fields['discount_youpay_text']) && !empty($fields['discount_youpay_text'])){
     300                                    echo esc_html($fields['discount_youpay_text']);
     301                                } else {
     302                                    esc_html_e( 'You pay', 'coinsnap-bitcoin-invoice-form' );
     303                                }?></span>
     304                <span class="bif-totals-final" data-value="0">—</span>
     305                            </div>
     306            </div>
    292307            <?php endif; ?>
    293308
Note: See TracChangeset for help on using the changeset viewer.