Making WordPress.org

Changeset 6707


Ignore:
Timestamp:
02/21/2018 07:24:16 PM (7 years ago)
Author:
coreymckrill
Message:

WordCamp: Set Stripe credentials based on environment

Use the live set of credentials for production, and the test set for sandboxes
local development.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wcorg-misc.php

    r6663 r6707  
    268268// Sponsorship payments (Stripe) credentials.
    269269add_filter( 'wcorg_sponsor_payment_stripe', function( $options ) {
     270    $environment = ( defined('WORDCAMP_ENVIRONMENT') ) ? WORDCAMP_ENVIRONMENT : 'development';
     271
     272    switch ( $environment ) {
     273        case 'production' :
     274            $options['publishable'] = WORDCAMP_PAYMENT_STRIPE_PUBLISHABLE_LIVE;
     275            $options['secret']      = WORDCAMP_PAYMENT_STRIPE_SECRET_LIVE;
     276            break;
     277
     278        case 'development':
     279        default :
     280            $options['publishable'] = WORDCAMP_PAYMENT_STRIPE_PUBLISHABLE;
     281            $options['secret']      = WORDCAMP_PAYMENT_STRIPE_SECRET;
     282            break;
     283    }
     284
    270285    $options['hmac_key'] = WORDCAMP_PAYMENT_STRIPE_HMAC;
    271     $options['publishable'] = WORDCAMP_PAYMENT_STRIPE_PUBLISHABLE_LIVE;
    272     $options['secret'] = WORDCAMP_PAYMENT_STRIPE_SECRET_LIVE;
    273286
    274287    return $options;
    275 });
     288} );
    276289
    277290/*
Note: See TracChangeset for help on using the changeset viewer.