Changeset 2074713
- Timestamp:
- 04/25/2019 01:43:12 PM (7 years ago)
- Location:
- coinbase-commerce/trunk
- Files:
-
- 3 edited
-
README.md (modified) (4 diffs)
-
class-wc-gateway-coinbase.php (modified) (3 diffs)
-
coinbase-commerce.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
coinbase-commerce/trunk/README.md
r1949700 r2074713 4 4 5 5 ## Installation 6 7 ### From WordPress.org 8 9 This plugin is available on the [WordPress.org plugin repository], and can be installed either directly from there or from the admin dashboard within your website. 10 11 #### Within your WordPress dashboard 12 1. Visit ‘Plugins > Add New’ 13 2. Search for ‘Coinbase Commerce’ 14 3. Activate Coinbase Commerce from your Plugins page. 15 16 #### From WordPress.org plugin repository 17 1. Download Coinbase Commerce from <https://wordpress.org/plugins/coinbase-commerce/> 18 2. Upload to your ‘/wp-content/plugins/’ directory, using your favorite method (ftp, sftp, scp, etc…) 19 3. Activate Coinbase Commerce from your Plugins page. 6 20 7 21 ### From this repository … … 75 89 The plugin supports all cryptocurrencies available at [Coinbase Commerce] 76 90 91 **Does Coinbase Commerce have integrations with other commerce platforms?** 92 93 Yes, the list of all integrations can be found here: [Coinbase Commerce Integrations](https://commerce.coinbase.com/integrate). 94 77 95 ## License 78 96 … … 80 98 81 99 ## Changelog 100 101 ## 1.1.1 ## 102 * Add support for OVERPAID 103 * Update Woo order statuses 104 * Add Coinbase meta data to backend order details 105 106 ## 1.1.0 ## 107 * Added support for charge cancel url. 108 * Handle cancelled events from API. 109 * Add option to disable icons on checkout page. 110 * Add Coinbase Commerce transaction ID to WooCommerce order output (Admin order page, Customer order page, email confirmation). 111 * Updated README.md 112 113 ## 1.0.2 ## 114 * Tested against WordPress 4.9.4 82 115 83 116 ## 1.0.1 ## … … 96 129 [WooCommerce]: <https://woocommerce.com/> 97 130 [WordPress]: <https://wordpress.org/> 98 131 [WordPress.org plugin repository]: <https://wordpress.org/plugins/coinbase-commerce/> -
coinbase-commerce/trunk/class-wc-gateway-coinbase.php
r1965004 r2074713 215 215 'order_id' => $order->get_id(), 216 216 'order_key' => $order->get_order_key(), 217 'source' => 'woocommerce' 217 218 ); 218 219 $result = Coinbase_API_Handler::create_charge( … … 355 356 $order->update_status( 'cancelled', __( 'Coinbase payment cancelled.', 'coinbase' ) ); 356 357 } elseif ( 'UNRESOLVED' === $status ) { 357 // translators: Coinbase error status for "unresolved" payment. Includes error status. 358 $order->update_status( 'failed', sprintf( __( 'Coinbase payment unresolved, reason: %s.', 'coinbase' ), $last_update['context'] ) ); 358 if ($last_update['context'] === 'OVERPAID') { 359 $order->update_status( 'processing', __( 'Coinbase payment was successfully processed.', 'coinbase' ) ); 360 $order->payment_complete(); 361 } else { 362 // translators: Coinbase error status for "unresolved" payment. Includes error status. 363 $order->update_status( 'failed', sprintf( __( 'Coinbase payment unresolved, reason: %s.', 'coinbase' ), $last_update['context'] ) ); 364 } 359 365 } elseif ( 'PENDING' === $status ) { 360 366 $order->update_status( 'blockchainpending', __( 'Coinbase payment detected, but awaiting blockchain confirmation.', 'coinbase' ) ); … … 362 368 // We don't know the resolution, so don't change order status. 363 369 $order->add_order_note( __( 'Coinbase payment marked as resolved.', 'coinbase' ) ); 364 } elseif ( 'COMPLETED' === $status ) { 365 $order->payment_complete(); 366 } 370 } elseif ( 'COMPLETED' === $status ) { 371 $order->update_status( 'processing', __( 'Coinbase payment was successfully processed.', 'coinbase' ) ); 372 $order->payment_complete(); 373 } 367 374 } 368 375 -
coinbase-commerce/trunk/coinbase-commerce.php
r1965004 r2074713 4 4 Plugin URI: https://github.com/coinbase/coinbase-commerce-woocommerce/ 5 5 Description: A payment gateway that allows your customers to pay with cryptocurrency via Coinbase Commerce (https://commerce.coinbase.com/) 6 Version: 1.1. 06 Version: 1.1.1 7 7 Author: Coinbase Commerce 8 8 Author URI: https://commerce.coinbase.com/ … … 122 122 * @param WC_Order $order WC order instance 123 123 */ 124 function cb_order_meta_general( $order ){ ?> 124 function cb_order_meta_general( $order ) 125 { 126 if ($order->get_payment_method() == 'coinbase') { 127 ?> 125 128 126 <br class="clear"/>127 <h3>Coinbase Commerce Data</h3>128 <div class="">129 <p>Coinbase Commerce Reference # <?php echo esc_html( $order->get_meta( '_coinbase_charge_id' )); ?></p>130 </div>129 <br class="clear"/> 130 <h3>Coinbase Commerce Data</h3> 131 <div class=""> 132 <p>Coinbase Commerce Reference # <?php echo esc_html($order->get_meta('_coinbase_charge_id')); ?></p> 133 </div> 131 134 132 <?php 135 <?php 136 } 133 137 } 134 138 … … 145 149 */ 146 150 function cb_custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) { 147 $fields['coinbase_commerce_reference'] = array( 148 'label' => __( 'Coinbase Commerce Reference #' ), 149 'value' => $order->get_meta( '_coinbase_charge_id' ), 150 ); 151 if ($order->get_payment_method() == 'coinbase') { 152 $fields['coinbase_commerce_reference'] = array( 153 'label' => __( 'Coinbase Commerce Reference #' ), 154 'value' => $order->get_meta( '_coinbase_charge_id' ), 155 ); 156 } 151 157 152 158 return $fields;
Note: See TracChangeset
for help on using the changeset viewer.