FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
gojek-api-php-native/Example.php at main · decoderid/gojek-api-php-native · GitHub
This repository was archived by the owner on Sep 29, 2024. It is now read-only.
decoderid
/
gojek-api-php-native
Public archive
Notifications
You must be signed in to change notification settings
Fork
4
Star
13
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
gojek-api-php-native
/
Example.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (33 loc) · 971 Bytes
Breadcrumbs
gojek-api-php-native
/
Example.php
Copy path
File metadata and controls
45 lines (33 loc) · 971 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
require_once
'
vendor/autoload.php
'
;
use
Decoderid
\
GojekApi
;
$
gojek
=
new
GojekApi
();
/** SET UUID */
$
uuid
=
$
gojek
->
generateUuid
();
$
gojek
->
setUuid
(
$
uuid
);
/** LOGIN */
$
phone
=
'
[PHONE]
'
;
$
pin
=
'
[PIN]
'
;
$
login
=
$
gojek
->
login
(
$
phone
,
$
pin
);
/**
* VERIFY OTP
*/
$
verifyOtp
=
$
gojek
->
verifyOtp
(
'
[OTP]
'
,
$
login
->
data
->
otp_token
);
if
(
$
verifyOtp
->
access_token
) {
print_r
(
$
verifyOtp
);
}
if
(
$
verifyOtp
->
success
) {
print_r
(
$
verifyOtp
);
}
/**
* IF PIN AUTHENTICATION AFTER OTP
*/
if
(
$
verifyOtp
->
errors
[
0
]->
code
===
'
mfa:customer_send_challenge:challenge_required
'
) {
$
challengeToken
=
$
verifyOtp
->
errors
[
0
]->
details
->
challenge_token
;
$
challengeId
=
$
verifyOtp
->
errors
[
0
]->
details
->
challenges
[
0
]->
gopay_challenge_id
;
$
verifyMFA
=
$
gojek
->
verifyMFA
(
$
challengeId
,
$
pin
);
if
(
$
verifyMFA
->
success
) {
$
verifyMFAToken
=
$
gojek
->
verifyMFAToken
(
$
challengeToken
,
$
verifyMFA
->
data
->
token
);
print_r
(
$
verifyMFAToken
);
}
}
Back
|
FazBrowse Home
|
New Git URL