Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 29 additions & 9 deletions config/payment.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Bow\Payment\Payment;

return [
/**
* Define the model used my gateway
Expand All @@ -9,25 +11,43 @@
/**
* The default gateway
*/
'default' => 'orange_ci',
'default' => [
'gateway' => Payment::ORANGE,
'country' => 'ci',
],

/**
* List of available gateway
*/
'gateways' => [
'orange_ci' => [
'ivoiry_cost' => [
'orange' => [
'client_key' => '',
'client_secret' => '',
'webhook_secret' => ''
],

'mtn' => [
'client_key' => '',
'client_secret' => '',
'webhook_secret' => ''
],

'moov' => [
'client_key' => '',
'merchant_key' => ''
'client_secret' => '',
'webhook_secret' => ''
],

'mtn_ci' => [
'wave' => [
'client_key' => '',
'merchant_key' => ''
'client_secret' => '',
'webhook_secret' => ''
],

'moov_ci' => [
'djamo' => [
'client_key' => '',
'merchant_key' => ''
'client_secret' => '',
'webhook_secret' => ''
]
]
],
];
40 changes: 0 additions & 40 deletions src/Bowcasher.php

This file was deleted.

61 changes: 0 additions & 61 deletions src/Common/PaymentManagerContract.php

This file was deleted.

34 changes: 34 additions & 0 deletions src/Common/ProcessorGatewayInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace Bow\Payment\Common;

interface ProcessorGatewayInterface
{
/**
* Make payment
*
* @return mixed
*/
public function payment(...$args);

/**
* Make transfer
*
* @return mixed
*/
public function transfer(...$args);

/**
* Get balance
*
* @return mixed
*/
public function balance(...$args);

/**
* Verify payment
*
* @return void
*/
public function verify();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,40 @@

namespace Bow\Payment\Common;

interface TransactionStatusContract
interface ProcessorTransactionStatusInterface
{
/**
* Get the notification token
*
* @return string
*/
public function getNotificationToken();

/**
* Define if transaction fail
*
* @return bool
*/
public function fail();
public function isFail();

/**
* Define if transaction initiated
*
* @return bool
*/
public function initiated();
public function isInitiated();

/**
* Define if transaction expired
*
* @return bool
*/
public function expired();
public function isExpired();

/**
* Define if transaction success
*
* @return bool
*/
public function success();
public function isSuccess();

/**
* Define if transaction pending
*
* @return bool
*/
public function pending();
public function isPending();
}
40 changes: 0 additions & 40 deletions src/Common/TokenGeneratorContract.php

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,16 @@ class MomoEnvironment
*/
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, string $basic_auth)
{
$this->subscription_key = $subscription_key;
$this->basic_auth = $basic_auth;
public function __construct(
private string $subscription_key,
private string $basic_auth
) {
}

/**
Expand Down Expand Up @@ -55,17 +48,17 @@ public function getBasicAuthorizationKey()
*
* @return bool
*/
public function production()
public function production(): bool
{
return $this->environment = 'production';
return $this->environment == 'production';
}

/**
* Check the environment
*
* @return bool
*/
public function sandbox()
public function sandbox(): bool
{
return $this->environment == 'sandbox';
}
Expand Down Expand Up @@ -95,7 +88,7 @@ public function switchToProduction()
*
* @return string
*/
public function getBaseUri()
public function getBaseUri(): string
{
if ($this->sandbox()) {
$base_uri = 'https://sandbox.momodeveloper.mtn.com/v1_0/';
Expand All @@ -111,7 +104,7 @@ public function getBaseUri()
*
* @return array
*/
public function getAuthorization()
public function getAuthorization(): array
{
return [
'Authorization' => 'Basic ' . $this->basic_auth,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,15 @@ class MomoEnvironment
*/
private $http;

/**
* The environment system
*
* @var MomoEnvironment
*/
private $environment;

/**
* The name of payment action interface
*
* @var string
*/
private $interface_name;

/**
* MomoEnvironment constructor
*
* @param MomoEnvironment $environment
* @return mixed
*/
public function __construct(MomoEnvironment $environment, $interface_name = 'collection')
public function __construct(private MomoEnvironment $environment, private string $interface_name = 'collection')
{
$this->environment = $environment;

$this->http = new HttpClient(['base_uri' => $this->environment->getBaseUri()]);

$this->interface_name = $interface_name;
}

/**
Expand Down
File renamed without changes.
Loading