You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/core_api/core_api_credit_card_example.py
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
1
importmidtransclient
2
-
# initialize core api client object
2
+
# This is just for very basic implementation reference, in production, you should validate the incoming requests and implement your backend more securely.
3
+
4
+
# Initialize core api client object
5
+
# You can find it in Merchant Portal -> Settings -> Access keys
3
6
core=midtransclient.CoreApi(
4
7
is_production=False,
5
8
server_key='YOUR_SERVER_KEY',
@@ -20,10 +23,13 @@
20
23
# core.api_config.server_key='YOUR_SERVER_KEY'
21
24
# core.api_config.client_key='YOUR_CLIENT_KEY'
22
25
23
-
# IMPORTANT NOTE: You should do credit card get token via frontend using `midtrans.min.js`, to avoid card data breach risks on your backend
24
-
# ( refer to: https://api-docs.midtrans.com )
26
+
# IMPORTANT NOTE: You should do credit card get token via frontend using `midtrans-new-3ds.min.js`, to avoid card data breach risks on your backend
27
+
# ( refer to: https://docs.midtrans.com/en/core-api/credit-card?id=_1-getting-the-card-token )
28
+
# For full example on Credit Card 3DS transaction refer to:
29
+
# (/examples/flask_app) that implement Snap & Core Api
25
30
26
31
# prepare CORE API parameter to get credit card token
32
+
# another sample of card number can refer to https://docs.midtrans.com/en/technical-reference/sandbox-test?id=card-payments
27
33
params= {
28
34
'card_number': '5264 2210 3887 4659',
29
35
'card_exp_month': '12',
@@ -34,7 +40,7 @@
34
40
card_token_response=core.card_token(params)
35
41
cc_token=card_token_response['token_id']
36
42
37
-
# prepare CORE API parameter to charge credit card ( refer to: https://api-docs.midtrans.com )
43
+
# prepare CORE API parameter to charge credit card ( refer to: https://docs.midtrans.com/en/core-api/credit-card?id=_2-sending-transaction-data-to-charge-api )
Copy file name to clipboardExpand all lines: examples/core_api/core_api_simple_example.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,15 @@
1
1
importmidtransclient
2
-
# initialize core api client object
2
+
# This is just for very basic implementation reference, in production, you should validate the incoming requests and implement your backend more securely.
3
+
4
+
# Initialize core api client object
5
+
# You can find it in Merchant Portal -> Settings -> Access keys
3
6
core=midtransclient.CoreApi(
4
7
is_production=False,
5
8
server_key='YOUR_SERVER_KEY',
6
9
client_key='YOUR_CLIENT_KEY'
7
10
)
8
11
9
-
# prepare CORE API parameter ( refer to: https://api-docs.midtrans.com ) charge bank_transfer parameter example
12
+
# prepare CORE API parameter ( refer to: https://docs.midtrans.com/en/core-api/bank-transfer?id=sample-request-and-request-body ) charge bank_transfer parameter example
Copy file name to clipboardExpand all lines: examples/flask_app/templates/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ <h4>Advanced usage:</h4>
11
11
<ul>
12
12
<li><ahref="/simple_core_api_checkout">/simple_core_api_checkout</a> via Core Api - Credit Card</li>
13
13
<li><ahref="/simple_core_api_checkout_permata">/simple_core_api_checkout_permata</a> via Core Api - Permata VA</li>
14
-
<li><ahref="/core_api_credit_card_frontend_sample">/core_api_credit_card_frontend_sample</a> Core Api - Credit Card to demonstrate how Midtrans.min.js will be used</li>
14
+
<li><ahref="/core_api_credit_card_frontend_sample">/core_api_credit_card_frontend_sample</a> Core Api - Credit Card to demonstrate how midtrans-new-3ds.min.js will be used</li>
Copy file name to clipboardExpand all lines: examples/flask_app/web.py
+29-7Lines changed: 29 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,16 @@
1
+
# This is just for very basic implementation reference, in production, you should validate the incoming requests and implement your backend more securely.
Copy file name to clipboardExpand all lines: examples/snap/snap_advanced_example.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,13 @@
1
1
importmidtransclient
2
-
# initialize snap client object
2
+
# This is just for very basic implementation reference, in production, you should validate the incoming requests and implement your backend more securely.
Copy file name to clipboardExpand all lines: examples/snap/snap_simple_example.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,13 @@
1
1
importmidtransclient
2
-
# initialize snap client object
2
+
# This is just for very basic implementation reference, in production, you should validate the incoming requests and implement your backend more securely.
Copy file name to clipboardExpand all lines: examples/transaction_actions/notification_example.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,10 @@
1
1
importmidtransclient
2
+
# This is just for very basic implementation reference, in production, you should validate the incoming requests and implement your backend more securely.
3
+
# Please refer to this docs for sample HTTP POST notifications:
0 commit comments