-
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.
* bnpl payment integration * bnpl payment integration * updates based on comments * updates based on comments * updates based on comments * rename file name * updates based on comments --------- Co-authored-by: Burak Baldırlıoğlu <[email protected]>
- Loading branch information
1 parent
fda4260
commit 90ef3f2
Showing
6 changed files
with
149 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,8 @@ | ||
<?php | ||
|
||
require_once('config/sample_config.php'); | ||
|
||
|
||
$response = SampleConfig::craftgate()->payment()->approveBnplPayment(1); | ||
|
||
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,35 @@ | ||
<?php | ||
|
||
require_once('config/sample_config.php'); | ||
|
||
use Craftgate\Model\ApmType; | ||
use Craftgate\Model\BnplCartItemType; | ||
use Craftgate\Model\Currency; | ||
|
||
$request = array( | ||
'apmType' => ApmType::MASLAK, | ||
'price' => 10000, | ||
'currency' => Currency::TL, | ||
'items' => array( | ||
array( | ||
'id' => '200', | ||
'name' => 'Test Elektronik 2', | ||
'brandName' => 'iphone', | ||
'type' => BnplCartItemType::OTHER, | ||
'unitPrice' => 3000, | ||
'quantity' => 2, | ||
), | ||
array( | ||
'id' => '100', | ||
'name' => 'Test Elektronik 1', | ||
'brandName' => 'Samsung', | ||
'type' => BnplCartItemType::MOBILE_PHONE_OVER_5000_TRY, | ||
'unitPrice' => 4000, | ||
'quantity' => 1, | ||
) | ||
) | ||
); | ||
|
||
$response = SampleConfig::craftgate()->payment()->retrieveBnplOffers($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,56 @@ | ||
<?php | ||
|
||
require_once('config/sample_config.php'); | ||
|
||
use Craftgate\Model\ApmType; | ||
use Craftgate\Model\BnplCartItemType; | ||
use Craftgate\Model\Currency; | ||
use Craftgate\Model\PaymentGroup; | ||
use Craftgate\Util\Guid; | ||
|
||
$request = array( | ||
'price' => 10000, | ||
'paidPrice' => 10000, | ||
'currency' => Currency::TL, | ||
'apmType' => ApmType::MASLAK, | ||
'apmOrderId' => Guid::generate(), | ||
'paymentGroup' => PaymentGroup::PRODUCT, | ||
'externalId' => Guid::generate(), | ||
'conversationId' => '456d1297-908e-4bd6-a13b-4be31a6e47d5', | ||
'callbackUrl' => 'callbackUrl', | ||
'bankCode' => '103', | ||
'items' => array( | ||
array( | ||
'externalId' => '38983903', | ||
'name' => 'Item 1', | ||
'price' => 6000, | ||
), | ||
array( | ||
'externalId' => '92983294', | ||
'name' => 'Item 2', | ||
'price' => 4000, | ||
) | ||
), | ||
'cartItems' => array( | ||
array( | ||
'id' => '200', | ||
'name' => 'Test Elektronik 2', | ||
'brandName' => 'iphone', | ||
'type' => BnplCartItemType::OTHER, | ||
'unitPrice' => 3000, | ||
'quantity' => 2, | ||
), | ||
array( | ||
'id' => '100', | ||
'name' => 'Test Elektronik 1', | ||
'brandName' => 'Samsung', | ||
'type' => BnplCartItemType::MOBILE_PHONE_OVER_5000_TRY, | ||
'unitPrice' => 4000, | ||
'quantity' => 1, | ||
) | ||
) | ||
); | ||
|
||
$response = SampleConfig::craftgate()->payment()->initBnplPayment($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
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,30 @@ | ||
<?php | ||
|
||
namespace Craftgate\Model; | ||
|
||
class BnplCartItemType | ||
{ | ||
const MOBILE_PHONE_OVER_5000_TRY = 'MOBILE_PHONE_OVER_5000_TRY'; | ||
const MOBILE_PHONE_BELOW_5000_TRY = 'PAYONEER'; | ||
const TABLET = 'TABLET'; | ||
const COMPUTER = 'COMPUTER'; | ||
const CONSTRUCTION_MARKET = 'CONSTRUCTION_MARKET'; | ||
const GOLD = 'GOLD'; | ||
const DIGITAL_PRODUCTS = 'DIGITAL_PRODUCTS'; | ||
const SUPERMARKET = 'SUPERMARKET'; | ||
const WHITE_GOODS = 'WHITE_GOODS'; | ||
const WEARABLE_TECHNOLOGY = 'WEARABLE_TECHNOLOGY'; | ||
const SMALL_HOME_APPLIANCES = 'SMALL_HOME_APPLIANCES'; | ||
const TV = 'TV'; | ||
const GAMES_CONSOLES = 'GAMES_CONSOLES'; | ||
const AIR_CONDITIONER_AND_HEATER = 'AIR_CONDITIONER_AND_HEATER'; | ||
const ELECTRONICS = 'ELECTRONICS'; | ||
const MOM_AND_BABY_AND_KIDS = 'MOM_AND_BABY_AND_KIDS'; | ||
const SHOES = 'SHOES'; | ||
const CLOTHING = 'CLOTHING'; | ||
const COSMETICS_AND_PERSONAL_CARE = 'COSMETICS_AND_PERSONAL_CARE'; | ||
const FURNITURE = 'FURNITURE'; | ||
const HOME_LIVING = 'HOME_LIVING'; | ||
const AUTOMOBILE_MOTORCYCLE = 'AUTOMOBILE_MOTORCYCLE'; | ||
const OTHER = 'OTHER'; | ||
} |