Plugin Directory

Changeset 2074713


Ignore:
Timestamp:
04/25/2019 01:43:12 PM (7 years ago)
Author:
pragbarrett
Message:

v.1.1.1 Support overpaid. Display order meta on backend. Update order statuses.

Location:
coinbase-commerce/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • coinbase-commerce/trunk/README.md

    r1949700 r2074713  
    44
    55## Installation
     6
     7### From WordPress.org
     8
     9This 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
     121. Visit ‘Plugins > Add New’
     132. Search for ‘Coinbase Commerce’
     143. Activate Coinbase Commerce from your Plugins page.
     15
     16#### From WordPress.org plugin repository
     171. Download Coinbase Commerce from <https://wordpress.org/plugins/coinbase-commerce/>
     182. Upload to your ‘/wp-content/plugins/’ directory, using your favorite method (ftp, sftp, scp, etc…)
     193. Activate Coinbase Commerce from your Plugins page.
    620
    721### From this repository
     
    7589The plugin supports all cryptocurrencies available at [Coinbase Commerce]
    7690
     91**Does Coinbase Commerce have integrations with other commerce platforms?**
     92
     93Yes, the list of all integrations can be found here: [Coinbase Commerce Integrations](https://commerce.coinbase.com/integrate).
     94
    7795## License
    7896
     
    8098
    8199## 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
    82115
    83116## 1.0.1 ##
     
    96129[WooCommerce]: <https://woocommerce.com/>
    97130[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  
    215215            'order_id'  => $order->get_id(),
    216216            'order_key' => $order->get_order_key(),
     217                    'source' => 'woocommerce'
    217218        );
    218219        $result   = Coinbase_API_Handler::create_charge(
     
    355356                $order->update_status( 'cancelled', __( 'Coinbase payment cancelled.', 'coinbase' ) );
    356357            } 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                        }   
    359365            } elseif ( 'PENDING' === $status ) {
    360366                $order->update_status( 'blockchainpending', __( 'Coinbase payment detected, but awaiting blockchain confirmation.', 'coinbase' ) );
     
    362368                // We don't know the resolution, so don't change order status.
    363369                $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                    }
    367374        }
    368375
  • coinbase-commerce/trunk/coinbase-commerce.php

    r1965004 r2074713  
    44Plugin URI:   https://github.com/coinbase/coinbase-commerce-woocommerce/
    55Description:  A payment gateway that allows your customers to pay with cryptocurrency via Coinbase Commerce (https://commerce.coinbase.com/)
    6 Version:      1.1.0
     6Version:      1.1.1
    77Author:       Coinbase Commerce
    88Author URI:   https://commerce.coinbase.com/
     
    122122 * @param WC_Order $order WC order instance
    123123 */
    124 function cb_order_meta_general( $order ){ ?>
     124function cb_order_meta_general( $order )
     125{
     126    if ($order->get_payment_method() == 'coinbase') {
     127        ?>
    125128
    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>
    131134
    132     <?php
     135        <?php
     136    }
    133137}
    134138
     
    145149 */
    146150function 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    }
    151157
    152158    return $fields;
Note: See TracChangeset for help on using the changeset viewer.