-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* BKM Express Integration * Abb BKM Express Integration
- Loading branch information
1 parent
2772c49
commit 832cf42
Showing
6 changed files
with
86 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
require_once('config/sample_config.php'); | ||
|
||
$request = array( | ||
'status' => true, | ||
'message' => 'İşlem Başarılı', | ||
'ticketId' => 'dcfdc163-0545-46d7-8f86-5a11718e56ec' | ||
); | ||
|
||
$response = SampleConfig::craftgate()->bkmExpress()->complete($request); | ||
|
||
print_r($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,36 @@ | ||
<?php | ||
|
||
require_once('config/sample_config.php'); | ||
|
||
use Craftgate\Model\Currency; | ||
use Craftgate\Model\PaymentGroup; | ||
use Craftgate\Util\Guid; | ||
|
||
$request = array( | ||
'price' => 100, | ||
'paidPrice' => 100, | ||
'currency' => Currency::TL, | ||
'paymentGroup' => PaymentGroup::LISTING_OR_SUBSCRIPTION, | ||
'conversationId' => '456d1297-908e-4bd6-a13b-4be31a6e47d5', | ||
'items' => array( | ||
array( | ||
'externalId' => Guid::generate(), | ||
'name' => 'Item 1', | ||
'price' => 30 | ||
), | ||
array( | ||
'externalId' => Guid::generate(), | ||
'name' => 'Item 2', | ||
'price' => 50 | ||
), | ||
array( | ||
'externalId' => Guid::generate(), | ||
'name' => 'Item 3', | ||
'price' => 20 | ||
) | ||
) | ||
); | ||
|
||
$response = SampleConfig::craftgate()->bkmExpress()->init($request); | ||
|
||
print_r($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,7 @@ | ||
<?php | ||
|
||
require_once('config/sample_config.php'); | ||
|
||
$response = SampleConfig::craftgate()->bkmExpress()->retrievePayment("dcfdc163-0545-46d7-8f86-5a11718e56ec"); | ||
|
||
print_r($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,24 @@ | ||
<?php | ||
|
||
namespace Craftgate\Adapter; | ||
|
||
class BkmExpressPaymentAdapter extends BaseAdapter | ||
{ | ||
public function init(array $request) | ||
{ | ||
$path = "/payment/v1/bkm-express/init"; | ||
return $this->httpPost($path, $request); | ||
} | ||
|
||
public function complete(array $request) | ||
{ | ||
$path = "/payment/v1/bkm-express/complete"; | ||
return $this->httpPost($path, $request); | ||
} | ||
|
||
public function retrievePayment($ticketId) | ||
{ | ||
$path = "/payment/v1/bkm-express/payments/" . $ticketId; | ||
return $this->httpGet($path); | ||
} | ||
} |
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