-
Notifications
You must be signed in to change notification settings - Fork 108
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 #56 from Andrenzo17/master
Add gopay tokenization & api subscription
- Loading branch information
Showing
6 changed files
with
385 additions
and
21 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
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
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,49 @@ | ||
<?php | ||
namespace Midtrans; | ||
|
||
require_once dirname(__FILE__) . '/../../Midtrans.php'; | ||
//Set Your server key | ||
Config::$serverKey = "<your server key>"; | ||
|
||
// define variables and set to empty values | ||
$number = ""; | ||
|
||
if ($_SERVER["REQUEST_METHOD"] == "POST") { | ||
$number = ($_POST["number"]); | ||
} | ||
|
||
// required | ||
$params = array( | ||
"payment_type" => "gopay", | ||
"gopay_partner" => array( | ||
"phone_number" => $number, | ||
"redirect_url" => "https://www.google.com" | ||
) | ||
); | ||
|
||
$response = CoreApi::linkPaymentAccount($params); | ||
?> | ||
|
||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
|
||
<h2>Simple Gopay Tokenization</h2> | ||
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> | ||
Phone number: <input type="text" name="number"> | ||
<br><br> | ||
<input type="submit" name="submit" value="Submit"> | ||
</form> | ||
|
||
|
||
<?php | ||
echo "<h2>Result get pay account:</h2>"; | ||
echo json_encode($response, JSON_UNESCAPED_SLASHES); | ||
echo "<br>"; | ||
?> | ||
|
||
|
||
</body> | ||
</html> |
Oops, something went wrong.