Skip to content

Commit

Permalink
change: resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
papac committed Jul 24, 2020
2 parents de4ae27 + ee822d2 commit 8851370
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 222 deletions.
14 changes: 7 additions & 7 deletions src/MTNMobileMoney/MomoToken.php → src/Common/PaymentToken.php
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
<?php

namespace Bow\Payment\MTNMobileMoney;
namespace Bow\Payment\Common;

class MomoToken
class PaymentToken
{
/**
* The access token value
* Define the access token value
*
* @var string
*/
private $access_token;

/**
* The type of token who define how to call the API
* Define the type of token who define how to call the API
*
* @var string
*/
private $token_type;

/**
* The token expiration time
* Define the token expiration time
*
* @var int
*/
private $expires_in;

/**
* The realy time for token expiration
* Define the realy time for token expiration
*
* @var int
*/
private $expires_realy_in;

/**
* OrangeMoneyToken constructor
* PaymentToken constructor
*
* @param string $access_token
* @param string $token_type
Expand Down
4 changes: 2 additions & 2 deletions src/MTNMobileMoney/Collection/MomoPayment.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Bow\Payment\MTNMobileMoney\Collection;
namespace Bow\Payment\MTNMobileMoney\Collection

class MomoPayment
{

// Do something
}
8 changes: 8 additions & 0 deletions src/MTNMobileMoney/Collection/MomoPaymentStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Bow\Payment\MTNMobileMoney\Collection

class MomoPaymentStatus
{
// Do something
}
26 changes: 22 additions & 4 deletions src/MTNMobileMoney/MomoEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,29 @@
class MomoEnvironment
{
/**
* The environment flag
* Define the environment flag
*
* @var string
*/
private $environment = 'sandbox';

/**
* Define the basic auth value
*
* @var string
*/
private $basic_auth;

/**
* MomoEnvironment constructor
*
* @param string $subscription_key
* @return void
*/
public function __construct(string $subscription_key)
public function __construct(string $subscription_key. string $basic_auth)
{
$this->subscription_key = $subscription_key;
$this->basic_auth = $basic_auth;
}

/**
Expand All @@ -32,6 +40,16 @@ public function getSubscriptionKey()
return $this->subscription_key;
}

/**
* Get the basic authorization key
*
* @return string
*/
public function getBasicAuthorizationKey()
{
return $this->basic_auth;
}

/**
* Check the environment
*
Expand Down Expand Up @@ -69,7 +87,7 @@ public function switchToSandbox()
*/
public function switchToProduction()
{
$this->environment = 'sandbox';
$this->environment = 'production';
}

/**
Expand All @@ -96,7 +114,7 @@ public function getBaseUri()
public function getAuthorzition()
{
return [
'Authorization' => 'Basic ' . base64_encode('API URI and API Key'),
'Authorization' => 'Basic ' . $this->basic_auth,
'Ocp-Apim-Subscription-Key' => $this->subscription_key,
];
}
Expand Down
3 changes: 2 additions & 1 deletion src/MTNMobileMoney/MonoTokenGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

namespace Bow\Payment\MTMMobileMoney;

use \GuzzleHttp\Client as HttpClient;
use Bow\Payment\Common\PaymentToken as MomoToken;
use GuzzleHttp\Client as HttpClient;

class MomoEnvironment
{
Expand Down
99 changes: 0 additions & 99 deletions src/OrangeMoney/OrangeMoneyEnvironment.php

This file was deleted.

8 changes: 5 additions & 3 deletions src/OrangeMoney/OrangeMoneyPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Bow\Payment\OrangeMoney;

use Bow\Payment\Common\PaymentToken as OrangeMoneyToken;
use \GuzzleHttp\Client as HttpClient;

class OrangeMoneyPayment
Expand Down Expand Up @@ -60,19 +61,20 @@ class OrangeMoneyPayment
*
* @param OrangeMoneyToken $token
* @param string $merchant_key
* @param string $currency
* @return mixed
*/
public function __construct(OrangeMoneyToken $token, $merchant_key)
public function __construct(OrangeMoneyToken $token, $merchant_key, string $currency = 'OUV')
{
$this->token = $token;

$this->http = new HttpClient(['base_uri' => 'https://api.orange.com']);

$this->merchant_key = $merchant_key;

$this->currency = 'OUV';
$this->currency = $currency;
}

/**
* Make payment
*
Expand Down
102 changes: 0 additions & 102 deletions src/OrangeMoney/OrangeMoneyToken.php

This file was deleted.

1 change: 1 addition & 0 deletions src/OrangeMoney/OrangeMoneyTokenGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Bow\Payment\OrangeMoney;

use Bow\Payment\Common\PaymentToken as OrangeMoneyToken;
use \GuzzleHttp\Client as HttpClient;

class OrangeMoneyTokenGenerator
Expand Down
1 change: 1 addition & 0 deletions src/OrangeMoney/OrangeMoneyTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Bow\Payment\OrangeMoney;

use Bow\Payment\Common\PaymentToken as OrangeMoneyToken;
use \GuzzleHttp\Client as HttpClient;

class OrangeMoneyTransaction
Expand Down
Loading

0 comments on commit 8851370

Please sign in to comment.