Changeset 3445785
- Timestamp:
- 01/23/2026 07:42:13 PM (2 months ago)
- Location:
- coinsnap-bitcoin-invoice-form
- Files:
-
- 52 added
- 6 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/assets (added)
-
tags/1.0.1/assets/css (added)
-
tags/1.0.1/assets/css/admin.css (added)
-
tags/1.0.1/assets/css/frontend.css (added)
-
tags/1.0.1/assets/css/index.php (added)
-
tags/1.0.1/assets/index.php (added)
-
tags/1.0.1/assets/js (added)
-
tags/1.0.1/assets/js/admin.js (added)
-
tags/1.0.1/assets/js/frontend.js (added)
-
tags/1.0.1/assets/js/index.php (added)
-
tags/1.0.1/coinsnap-bitcoin-invoice-form.php (added)
-
tags/1.0.1/index.php (added)
-
tags/1.0.1/languages (added)
-
tags/1.0.1/languages/index.php (added)
-
tags/1.0.1/readme.txt (added)
-
tags/1.0.1/src (added)
-
tags/1.0.1/src/Admin (added)
-
tags/1.0.1/src/Admin/class-coinsnapbif-admin-logs-page.php (added)
-
tags/1.0.1/src/Admin/class-coinsnapbif-admin-settings.php (added)
-
tags/1.0.1/src/Admin/class-coinsnapbif-admin-transactions-page.php (added)
-
tags/1.0.1/src/Admin/index.php (added)
-
tags/1.0.1/src/CPT (added)
-
tags/1.0.1/src/CPT/class-coinsnapbif-cpt-invoice-form-post-type.php (added)
-
tags/1.0.1/src/CPT/index.php (added)
-
tags/1.0.1/src/Database (added)
-
tags/1.0.1/src/Database/class-installer.php (added)
-
tags/1.0.1/src/Database/index.php (added)
-
tags/1.0.1/src/Providers (added)
-
tags/1.0.1/src/Providers/Payment (added)
-
tags/1.0.1/src/Providers/Payment/class-btcpayprovider.php (added)
-
tags/1.0.1/src/Providers/Payment/class-coinsnapprovider.php (added)
-
tags/1.0.1/src/Providers/Payment/class-paymentproviderinterface.php (added)
-
tags/1.0.1/src/Providers/Payment/index.php (added)
-
tags/1.0.1/src/Providers/index.php (added)
-
tags/1.0.1/src/Rest (added)
-
tags/1.0.1/src/Rest/class-coinsnapbif-rest-routes.php (added)
-
tags/1.0.1/src/Rest/index.php (added)
-
tags/1.0.1/src/Services (added)
-
tags/1.0.1/src/Services/class-coinsnapbif-services-payment-service.php (added)
-
tags/1.0.1/src/Services/index.php (added)
-
tags/1.0.1/src/Shortcode (added)
-
tags/1.0.1/src/Shortcode/class-coinsnapbif-shortcode-invoice-form-shortcode.php (added)
-
tags/1.0.1/src/Shortcode/index.php (added)
-
tags/1.0.1/src/Util (added)
-
tags/1.0.1/src/Util/class-coinsnapbif-log-levels.php (added)
-
tags/1.0.1/src/Util/class-coinsnapbif-logger.php (added)
-
tags/1.0.1/src/Util/class-coinsnapbif-util-provider-factory.php (added)
-
tags/1.0.1/src/Util/index.php (added)
-
tags/1.0.1/src/class-coinsnapbif-constants.php (added)
-
tags/1.0.1/src/class-coinsnapbif-plugin.php (added)
-
tags/1.0.1/src/index.php (added)
-
trunk/coinsnap-bitcoin-invoice-form.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/CPT/class-coinsnapbif-cpt-invoice-form-post-type.php (modified) (5 diffs)
-
trunk/src/Providers/Payment/class-coinsnapprovider.php (modified) (1 diff)
-
trunk/src/Services/class-coinsnapbif-services-payment-service.php (modified) (4 diffs)
-
trunk/src/Shortcode/class-coinsnapbif-shortcode-invoice-form-shortcode.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
coinsnap-bitcoin-invoice-form/trunk/coinsnap-bitcoin-invoice-form.php
r3439284 r3445785 2 2 /* 3 3 * Plugin Name: Bitcoin Invoice Form 4 * Plugin URI: https://coinsnap.io/ coinsnap-bitcoin-invoice-form/4 * Plugin URI: https://coinsnap.io/modules/bitcoin-invoice/ 5 5 * 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. 06 * Version: 1.0.1 7 7 * Author: Coinsnap 8 8 * Author URI: https://coinsnap.io/ … … 25 25 26 26 if(!defined('COINSNAPBIF_REFERRAL_CODE' ) ) { define( 'COINSNAPBIF_REFERRAL_CODE', 'D85536' );} 27 if(!defined('COINSNAPBIF_VERSION' ) ) { define( 'COINSNAPBIF_VERSION', '1.0. 0' );}27 if(!defined('COINSNAPBIF_VERSION' ) ) { define( 'COINSNAPBIF_VERSION', '1.0.1' );} 28 28 if(!defined('COINSNAPBIF_PHP_VERSION' ) ) { define( 'COINSNAPBIF_PHP_VERSION', '7.4' );} 29 29 if(!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 4 4 Tags: Lightning, bitcoin, invoice form, BTCPay 5 5 Tested up to: 6.9 6 Stable tag: 1.0. 06 Stable tag: 1.0.1 7 7 License: GPL2 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 230 230 = 1.0.0 :: 2026-01-14 = 231 231 * 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 105 105 'description_enabled' => '1', 106 106 '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' ), 108 108 'description_order' => '70', 109 109 'button_text' => __( 'Pay Invoice with Bitcoin', 'coinsnap-bitcoin-invoice-form' ), … … 181 181 echo '<h4 style="margin:0 0 10px 0;font-weight:bold;">' . esc_html__( 'Submit Button', 'coinsnap-bitcoin-invoice-form' ) . '</h4>'; 182 182 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>'; 184 184 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' ) . '" />'; 185 185 echo '</div>'; … … 207 207 echo '</div>'; 208 208 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 209 232 echo '<div class="bif-option-group" style="display:flex;flex-direction:column;gap:6px;margin-top:12px;">'; 210 233 echo '<label for="discount_notice" style="margin:0;font-weight:500;">' . esc_html__( 'Customer-facing discount notice (optional)', 'coinsnap-bitcoin-invoice-form' ) . ':</label>'; … … 240 263 echo '<fieldset class="bif-field-config" style="border:1px solid #ddd;padding:15px;margin:15px 0;border-radius:4px;background:#fafafa;">'; 241 264 $legend_text = ( 'description' === $field_name ) 242 ? __( 'Message to the Invoice receiver', 'coinsnap-bitcoin-invoice-form' )265 ? __( 'Message to us', 'coinsnap-bitcoin-invoice-form' ) 243 266 : ucwords( str_replace( '_', ' ', $field_name ) ); 244 267 echo '<legend style="font-weight:bold;padding:0 8px;background:#fff;border-radius:3px;">' . esc_html( $legend_text ) . '</legend>'; … … 302 325 echo '<p><label for="currency">' . esc_html__( 'Currency (per form)', 'coinsnap-bitcoin-invoice-form' ) . ':</label></p>'; 303 326 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 309 332 echo '</select>'; 310 333 -
coinsnap-bitcoin-invoice-form/trunk/src/Providers/Payment/class-coinsnapprovider.php
r3439284 r3445785 55 55 56 56 // Validate currency code 57 $supported_currencies = array( 'USD', 'EUR', 'CAD', 'JPY', 'GBP', 'CHF', 'BTC', 'SATS' );57 $supported_currencies = COINSNAP_CURRENCIES; 58 58 if ( ! in_array( $currency, $supported_currencies, true ) ) { 59 59 CoinsnapBIF_Logger::error( 'Unsupported currency for CoinSnap', array( -
coinsnap-bitcoin-invoice-form/trunk/src/Services/class-coinsnapbif-services-payment-service.php
r3439284 r3445785 46 46 47 47 // 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 ); 51 51 52 52 // Set defaults … … 132 132 $errors[] = sprintf( 133 133 /* translators: 1: Required value */ 134 __( '%s is required .', 'coinsnap-bitcoin-invoice-form' ), $label );134 __( '%s is required', 'coinsnap-bitcoin-invoice-form' ), $label ); 135 135 } elseif ( 'email' === $f && ! is_email( $val ) ) { 136 136 $errors[] = __( 'Please enter a valid email address.', 'coinsnap-bitcoin-invoice-form' ); … … 261 261 262 262 // 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 ); 264 264 $redirect_config = wp_parse_args( $redirect_config, array( 265 265 'success_page' => '', … … 517 517 ); 518 518 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 ); 521 521 522 522 // 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 95 95 'currency_enabled' => '1', 96 96 'currency_required' => '1', 97 'currency_label' => __( 'Currency Selection', 'coinsnap-bitcoin-invoice-form' ),97 'currency_label' => __( 'Currency', 'coinsnap-bitcoin-invoice-form' ), 98 98 'currency_order' => '40', 99 99 'email_enabled' => '1', … … 276 276 277 277 <?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> 292 307 <?php endif; ?> 293 308
Note: See TracChangeset
for help on using the changeset viewer.