Skip to content

Commit

Permalink
Merge pull request #5 from jeremy5189/master
Browse files Browse the repository at this point in the history
將所有 env() 改為 config()
  • Loading branch information
s950329 authored Nov 28, 2018
2 parents 5ad9b0b + fdf89d5 commit 99f4e64
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Charge

public function __construct(Helpers $helpers)
{
if (env('APP_ENV') === 'production') {
if (config('app.env') === 'production') {
$this->apiUrl['MPG_API']
= 'https://core.spgateway.com/MPG/mpg_gateway';
$this->apiUrl['QUERY_TRADE_INFO_API']
Expand Down
4 changes: 2 additions & 2 deletions src/MPG.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MPG
public function __construct()
{
$this->apiUrl = [];
if (env('APP_ENV') === 'production') {
if (config('app.env') === 'production') {
$this->apiUrl['MPG_API']
= 'https://core.spgateway.com/MPG/mpg_gateway';
$this->apiUrl['QUERY_TRADE_INFO_API']
Expand Down Expand Up @@ -126,7 +126,7 @@ public function encrypt()
$tradeSha = $this->createMpgSHA256Encrypt($tradeInfo);

$this->postDataEncrypted = [
'MerchantID' => env('SPGATEWAY_MERCHANT_ID'),
'MerchantID' => config('spgateway.mpg.MerchantID'),
'TradeInfo' => $tradeInfo,
'TradeSha' => $tradeSha,
'Version' => '1.4',
Expand Down
2 changes: 1 addition & 1 deletion src/Receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Receipt

public function __construct()
{
if (env('APP_ENV') === 'production') {
if (config('app.env') === 'production') {
$this->apiUrl['CREATE_RECEIPT_API']
= 'https://inv.pay2go.com/API/invoice_issue';
$this->apiUrl['INVALID_RECEIPT_API']
Expand Down
2 changes: 1 addition & 1 deletion src/Refund.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Refund
public function __construct()
{
$this->apiUrl = [];
if (env('APP_ENV') === 'production') {
if (config('app.env') === 'production') {
$this->apiUrl['CREDIT_CARD_CANCEL_API']
= 'https://core.spgateway.com/API/CreditCard/Cancel';
$this->apiUrl['CREDIT_CARD_REFUND_API']
Expand Down
2 changes: 1 addition & 1 deletion src/Transfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Transfer

public function __construct()
{
if (env('APP_ENV') === 'production') {
if (config('app.env') === 'production') {
$this->apiUrl['CHARGE_INSTRUCT_API']
= 'https://core.spgateway.com/API/ChargeInstruct';
} else {
Expand Down

0 comments on commit 99f4e64

Please sign in to comment.