-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from segsalerty2013/dev
Upgrade implementation
- Loading branch information
Showing
49 changed files
with
1,449 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/vendor/ | ||
composer.lock | ||
/.idea | ||
/.idea | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
3 changes: 1 addition & 2 deletions
3
http_example/callback.php → http_example/accept_payment/callback.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
require_once('../init.php'); | ||
|
||
use Opay\Payload\OrderCloseRequest; | ||
|
||
$_orderCloseRequest = new OrderCloseRequest($orderNumberInSession, $reference); | ||
$merchantCashier->orderClose($_orderCloseRequest); | ||
|
||
$response = $merchantCashier->getOrderCloseApiResult(); | ||
|
||
dump("status : ". $response->getCode()); | ||
if ($response->getCode() === "00000") { | ||
dump($response->getData()); | ||
} else { | ||
dump($response); | ||
} | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
require_once('../init.php'); | ||
|
||
use Opay\Payload\OrderStatusRequest; | ||
|
||
$_orderStatusRequest = new OrderStatusRequest($orderNumberInSession, $reference); | ||
|
||
$merchantCashier->orderStatus($_orderStatusRequest); | ||
|
||
$response = $merchantCashier->getOrderStatusApiResult(); | ||
|
||
dump("status : ". $response->getCode()); | ||
if($response->getCode() === "00000") { | ||
dump($response->getData()); | ||
} else { | ||
dump($response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
<?php | ||
|
||
require_once('./vendor/autoload.php'); | ||
session_start(); | ||
require_once __DIR__ .'/../vendor/autoload.php'; | ||
|
||
use Opay\MerchantCashier; | ||
use Opay\MerchantTransfer; | ||
|
||
$reference = "test_2019122709408400"; // update/change this when creating a new order | ||
$hostBaseUrl = "https://1da67619a3b4.ngrok.io"; | ||
$orderNumberInSession = isset($_SESSION['orderNumberInSession'])?$_SESSION['orderNumberInSession']:null; | ||
|
||
$endpointBaseUrl = 'http://sandbox-cashierapi.opayweb.com'; | ||
$pubKey = 'OPAYPUBxxxxxxxxxxxxx.xxxxxxxxxxxxx'; | ||
$prvKey = 'OPAYPRVxxxxxxxxxxxxx.xxxxxxxxxxxxx'; | ||
$merchantId = '256620xxxxxxxxxxxxx'; | ||
|
||
$merchantCashier = new MerchantCashier( | ||
"http://api.test.opaydev.com:8081", | ||
"qazwert12345!@#$", | ||
"fKJ8jwsj1nHNkKon", | ||
"256619112122000"); | ||
$merchantCashier = new MerchantCashier($endpointBaseUrl, $pubKey, $prvKey, $merchantId); | ||
$merchantTransfer = new MerchantTransfer($endpointBaseUrl, $pubKey, $prvKey, $merchantId); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
use Opay\Payload\BanksRequest; | ||
|
||
require_once('../../init.php'); | ||
|
||
$getBanksRequest = new BanksRequest("NG"); | ||
$merchantTransfer->getBanks($getBanksRequest); | ||
$response = $merchantTransfer->getBanksApiResult(); | ||
|
||
dump("status : ". $response->getCode()); | ||
|
||
if($response->getCode() === "00000") { | ||
dump($response->getData()); | ||
} else { | ||
dump($response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
require_once('../../init.php'); | ||
|
||
$merchantTransfer->getCountries(); | ||
$response = $merchantTransfer->getCountriesApiResult(); | ||
|
||
dump("status : ". $response->getCode()); | ||
|
||
if($response->getCode() === "00000") { | ||
dump($response->getData()); | ||
} else { | ||
dump($response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
use Opay\Payload\BankTransferRequest; | ||
|
||
require_once('../../init.php'); | ||
|
||
$bankTransferRequest = new BankTransferRequest($reference, '100', 'NGN', 'NG', | ||
'Andy Lee', '050', '22222222222222', 'transfer reason message'); | ||
$merchantTransfer->bankTransfer($bankTransferRequest); | ||
$response = $merchantTransfer->bankTransferApiResult(); | ||
|
||
dump("status : ". $response->getCode()); | ||
|
||
if($response->getCode() === "00000") { | ||
$_SESSION['orderNumberInSession'] = $response->getData()->getOrderNo(); | ||
dump($response->getData()); | ||
} else { | ||
dump($response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
require_once('../../init.php'); | ||
|
||
use Opay\Payload\OrderStatusRequest; | ||
|
||
$_orderStatusRequest = new OrderStatusRequest("201120020221116097", $reference); | ||
|
||
$merchantTransfer->transferStatus($_orderStatusRequest); | ||
$response = $merchantTransfer->bankTransferStatusApiResult(); | ||
|
||
dump("status : ". $response->getCode()); | ||
|
||
if($response->getCode() === "00000") { | ||
$_SESSION['orderNumberInSession'] = $response->getData()->getOrderNo(); | ||
dump($response->getData()); | ||
} else { | ||
dump($response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
use Opay\Payload\ValidateBankAccountRequest; | ||
|
||
require_once('../../init.php'); | ||
|
||
$validateBankAccountRequest = new ValidateBankAccountRequest('NG', '108', '45345343434'); | ||
$merchantTransfer->validateAccount($validateBankAccountRequest); | ||
$response = $merchantTransfer->validateBankAccountApiResult(); | ||
|
||
dump("status : ". $response->getCode()); | ||
|
||
if($response->getCode() === "00000") { | ||
dump($response->getData()); | ||
} else { | ||
dump($response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
use Opay\Payload\OpayTransferRequest; | ||
use Opay\Utility\OpayConstants; | ||
|
||
require_once('../../init.php'); | ||
|
||
$opayTransferRequest = new OpayTransferRequest($reference, 100, 'NGN', 'NG', | ||
'Andy Lee', OpayConstants::TRANSFER_RECEIVER_TYPE_USER, | ||
'transfer reason message', '+2348036952110'); | ||
|
||
// to send to a merchant: *uncomment below and comment above | ||
//$opayTransferRequest = new OpayTransferRequest($reference, 100, 'NGN', 'NG', | ||
// 'Andy Lee', OpayConstants::TRANSFER_RECEIVER_TYPE_MERCHANT, | ||
// 'transfer reason message', '256620111818011'); | ||
|
||
$merchantTransfer->opayTransfer($opayTransferRequest); | ||
$response = $merchantTransfer->opayTransferApiResult(); | ||
|
||
dump("status : ". $response->getCode()); | ||
|
||
if($response->getCode() === "00000") { | ||
$_SESSION['orderNumberInSession'] = $response->getData()->getOrderNo(); | ||
dump($response->getData()); | ||
} else { | ||
dump($response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
require_once('../../init.php'); | ||
|
||
use Opay\Payload\OrderStatusRequest; | ||
|
||
$_orderStatusRequest = new OrderStatusRequest($orderNumberInSession, $reference); | ||
|
||
$merchantTransfer->transferStatus($_orderStatusRequest); | ||
$response = $merchantTransfer->opayTransferStatusApiResult(); | ||
|
||
dump("status : ". $response->getCode()); | ||
|
||
if($response->getCode() === "00000") { | ||
$_SESSION['orderNumberInSession'] = $response->getData()->getOrderNo(); | ||
dump($response->getData()); | ||
} else { | ||
dump($response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
use Opay\Payload\ValidateOpayMerchantRequest; | ||
|
||
require_once('../../init.php'); | ||
|
||
$validateOpayMerchantRequest = new ValidateOpayMerchantRequest('segsalerty@gmail.com'); | ||
$merchantTransfer->validateOpayMerchant($validateOpayMerchantRequest); | ||
$response = $merchantTransfer->validateOpayMerchantApiResult(); | ||
|
||
dump("status : ". $response->getCode()); | ||
|
||
if($response->getCode() === "00000") { | ||
dump($response->getData()); | ||
} else { | ||
dump($response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
use Opay\Payload\ValidateOpayUserRequest; | ||
|
||
require_once('../../init.php'); | ||
|
||
$validateOpayUserRequest = new ValidateOpayUserRequest('+2348036952110'); | ||
$merchantTransfer->validateOpayUser($validateOpayUserRequest); | ||
$response = $merchantTransfer->validateOpayUserApiResult(); | ||
|
||
dump("status : ". $response->getCode()); | ||
|
||
if($response->getCode() === "00000") { | ||
dump($response->getData()); | ||
} else { | ||
dump($response); | ||
} |
Oops, something went wrong.