diff --git a/.gitignore b/.gitignore index 4e4bab5..01f3a95 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ dist/ build/ push_to_twine.sh ./Pipfile +env/ +.DS_STORE diff --git a/examples/core_api/core_api_credit_card_example.py b/examples/core_api/core_api_credit_card_example.py index 2803d07..0640c5f 100644 --- a/examples/core_api/core_api_credit_card_example.py +++ b/examples/core_api/core_api_credit_card_example.py @@ -1,5 +1,8 @@ import midtransclient -# initialize core api client object +# This is just for very basic implementation reference, in production, you should validate the incoming requests and implement your backend more securely. + +# Initialize core api client object +# You can find it in Merchant Portal -> Settings -> Access keys core = midtransclient.CoreApi( is_production=False, server_key='YOUR_SERVER_KEY', @@ -20,10 +23,13 @@ # core.api_config.server_key='YOUR_SERVER_KEY' # core.api_config.client_key='YOUR_CLIENT_KEY' -# IMPORTANT NOTE: You should do credit card get token via frontend using `midtrans.min.js`, to avoid card data breach risks on your backend -# ( refer to: https://api-docs.midtrans.com ) +# 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 +# ( refer to: https://docs.midtrans.com/en/core-api/credit-card?id=_1-getting-the-card-token ) +# For full example on Credit Card 3DS transaction refer to: +# (/examples/flask_app) that implement Snap & Core Api # prepare CORE API parameter to get credit card token +# another sample of card number can refer to https://docs.midtrans.com/en/technical-reference/sandbox-test?id=card-payments params = { 'card_number': '5264 2210 3887 4659', 'card_exp_month': '12', @@ -34,7 +40,7 @@ card_token_response = core.card_token(params) cc_token = card_token_response['token_id'] -# prepare CORE API parameter to charge credit card ( refer to: https://api-docs.midtrans.com ) +# 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 ) param = { "payment_type": "credit_card", "transaction_details": { diff --git a/examples/core_api/core_api_simple_example.py b/examples/core_api/core_api_simple_example.py index 0a07b3a..072996a 100644 --- a/examples/core_api/core_api_simple_example.py +++ b/examples/core_api/core_api_simple_example.py @@ -1,12 +1,15 @@ import midtransclient -# initialize core api client object +# This is just for very basic implementation reference, in production, you should validate the incoming requests and implement your backend more securely. + +# Initialize core api client object +# You can find it in Merchant Portal -> Settings -> Access keys core = midtransclient.CoreApi( is_production=False, server_key='YOUR_SERVER_KEY', client_key='YOUR_CLIENT_KEY' ) -# prepare CORE API parameter ( refer to: https://api-docs.midtrans.com ) charge bank_transfer parameter example +# 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 param = { "payment_type": "bank_transfer", "transaction_details": { diff --git a/examples/flask_app/templates/index.html b/examples/flask_app/templates/index.html index 682cef3..fab1dfb 100644 --- a/examples/flask_app/templates/index.html +++ b/examples/flask_app/templates/index.html @@ -11,7 +11,7 @@