-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35d07cc
commit 4d77e94
Showing
8 changed files
with
246 additions
and
10 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 |
---|---|---|
|
@@ -19,6 +19,8 @@ class OVOID | |
*/ | ||
const BASE_ENDPOINT = 'https://api.ovo.id/'; | ||
|
||
const AWS = 'https://apigw01.aws.ovo.id/'; | ||
|
||
/** | ||
* Authorization Token | ||
* | ||
|
@@ -244,4 +246,116 @@ public function getWalletTransaction($page, $limit = 10) | |
$this->_aditionalHeader() | ||
)->getResponse(); | ||
} | ||
|
||
/** | ||
* Billpay | ||
* | ||
* @return \Stelin\Response\BillpayResponse | ||
*/ | ||
public function getBillers() | ||
{ | ||
$ch = new Curl; | ||
|
||
return $ch->get(OVOID::AWS . 'gpdm/ovo/ID/v2/billpay/get-billers?categoryID=5C6', null, $this->_aditionalHeader())->getResponse(); | ||
} | ||
|
||
/** | ||
* get denomination | ||
* | ||
* @param int $product_id product_id can be found from getBillers() endpoint | ||
* @return \Stelin\Response\DenominationsReponse | ||
*/ | ||
public function getDenominationByProductId($product_id) | ||
{ | ||
$ch = new Curl; | ||
|
||
return $ch->get(OVOID::AWS . 'gpdm/ovo/ID/v1/billpay/get-denominations/' . $product_id, null, $this->_aditionalHeader())->getResponse(); | ||
} | ||
|
||
/** | ||
* bayar | ||
* | ||
* @param string $billerId get this from getBillers() | ||
* @param string $customerId phone number | ||
* @param string $denomId get this from getDenominationByProductId() | ||
* @param string $productId get this from getBillers() | ||
* @return \Stelin\Response\InquiryResponse | ||
*/ | ||
public function inquiry($billerId, $customerId, $denomId, $productId) | ||
{ | ||
$ch = new Curl; | ||
$data = [ | ||
'biller_id' => (string)$billerId, | ||
'customer_id' => $customerId, | ||
'denomination_id' => $denomId, | ||
'payment_method' => [ | ||
'001' | ||
], | ||
'phone_number'=> $customerId, | ||
'product_id' => (string)$productId, | ||
'period' => 0 | ||
]; | ||
|
||
return $ch->post(OVOID::AWS . 'gpdm/ovo/ID/v1/billpay/inquiry', $data, $this->_aditionalHeader())->getResponse(); | ||
} | ||
|
||
/** | ||
* setelah menjalankan fungsi inquiry() lakukan fungsi customerUnlock | ||
* | ||
* @param string $securityCode | ||
* @return void | ||
*/ | ||
public function customerUnlock($securityCode) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
lintangtimur
Author
Owner
|
||
{ | ||
$ch = new Curl; | ||
$data = [ | ||
'appVersion' => '2.8.0', | ||
'securityCode'=> $securityCode | ||
]; | ||
|
||
return $ch->post(OVOID::BASE_ENDPOINT . 'v1.0/api/auth/customer/unlock', $data, $this->_aditionalHeader())->getResponse(); | ||
} | ||
|
||
/** | ||
* pay | ||
* | ||
* @param string $billerId | ||
* @param string $customerId | ||
* @param string $oder_id | ||
* @param string $productId | ||
* @return \Stelin\Response\PayResponse | ||
*/ | ||
public function pay($billerId, $customerId, $order_id, $productId) | ||
{ | ||
$ch = new Curl; | ||
$data = [ | ||
'biller_id' => $billerId, | ||
'customer_id' => $customerId, | ||
'order_id' => $order_id, | ||
'payment_method'=> [ | ||
'001' | ||
], | ||
'phone_number'=> $customerId, | ||
'product_id' => $productId | ||
]; | ||
|
||
return $ch->post(OVOID::AWS . 'gpdm/ovo/ID/v1/billpay/pay', $data, $this->_aditionalHeader())->getResponse(); | ||
} | ||
|
||
/** | ||
* get PayCheckStatusResponse | ||
* | ||
* @param string $oderId orderId reference | ||
* @return \Stelin\Response\PayCheckStatusResponse | ||
*/ | ||
public function payCheckStatus($orderId) | ||
{ | ||
$ch = new Curl; | ||
|
||
$data = [ | ||
'order_reference' => $orderId | ||
]; | ||
|
||
return $ch->post(OVOID::AWS . 'gpdm/ovo/ID/v1/billpay/checkstatus', $data, $this->_aditionalHeader())->getResponse(); | ||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace Stelin\Response; | ||
|
||
class BillpayResponse | ||
{ | ||
/** | ||
* | ||
* | ||
* @var array | ||
*/ | ||
private $biller_list; | ||
|
||
public function __construct($data) | ||
{ | ||
$this->biller_list = $data; | ||
} | ||
|
||
/** | ||
* list of bill | ||
* | ||
* @return array | ||
*/ | ||
public function getBillerList() | ||
{ | ||
return $this->biller_list; | ||
} | ||
} |
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,10 @@ | ||
<?php | ||
namespace Stelin\Response; | ||
|
||
class CustomerUnlockResponse | ||
{ | ||
public function __construct($data) | ||
{ | ||
|
||
} | ||
} |
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 | ||
namespace Stelin\Response; | ||
|
||
class DenominationsReponse | ||
{ | ||
private $denominations; | ||
|
||
public function __construct($data) | ||
{ | ||
$this->denominations = $data; | ||
} | ||
|
||
public function getDenominations() | ||
{ | ||
return $this->denominations; | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
namespace Stelin\Response; | ||
|
||
class InquiryResponse | ||
{ | ||
|
||
private $response; | ||
|
||
public function __construct($data) | ||
{ | ||
$this->response= $data; | ||
} | ||
|
||
/** | ||
* Undocumented function | ||
* | ||
* @return array | ||
*/ | ||
public function getResponse() | ||
{ | ||
return $this->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 | ||
namespace Stelin\Response; | ||
|
||
class PayCheckStatusResponse | ||
{ | ||
private $PayCheckStatusResponse; | ||
public function __construct($data) | ||
{ | ||
$this->PayCheckStatusResponse = $data; | ||
} | ||
|
||
public function getPayCheckStatusResponse() | ||
{ | ||
return $this->PayCheckStatusResponse; | ||
} | ||
} |
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 | ||
namespace Stelin\Response; | ||
|
||
class PayResponse | ||
{ | ||
private $response; | ||
public function __construct($data) | ||
{ | ||
$this->response = $data; | ||
} | ||
|
||
/** | ||
* response | ||
* | ||
* @return void | ||
*/ | ||
public function getPayResponse() | ||
{ | ||
return $this->response; | ||
} | ||
} |
Where does
$securityCode
come from?