midtrans / midtrans-python-client Goto Github PK
View Code? Open in Web Editor NEWOfficial Midtrans Payment API Client for Python | https://midtrans.com
License: MIT License
Official Midtrans Payment API Client for Python | https://midtrans.com
License: MIT License
saya agak kesulisan untuk meneruskan informasi Error
ketika melakukan try
except
pada class MidtransAPIError
karena data yang diperoleh adalah string
.
Agar saya memperoleh raw data, mungkin response_dict
http_client.py line 53 bisa dimasukkan ke MidtransAPIError
.
Mungkin bisa jadi seperti ini
class MidtransAPIError(Exception):
def __init__(self, message, response_dict=None):
self.message = message
self.response_dict = response_dict
raise MidtransAPIError(
'Midtrans API is returning API error. API status code:'
' `{0}`. API response: `{1}`'.format(response_dict['status_code'], response_object.text),
response_dict=response_dict
)
Hal ini bisa jadi peningkatan berarti bagi saya. Terima kasih.
Saat mencoba Midtrans Sandbox untuk generate QR Code, error dengan response:
{
"status_code":"402",
"status_message":"One or more merchant settings is invalid.",
"id":"5e5c67fd-1639-4763-90c5-692df8e57509"
}
Dengan request:
core_api = midtransclient.CoreApi(
is_production=True,
server_key=f'{YOUR_SERVER_KEY}',
client_key=f'{YOUR_CLIENT_KEY}'
)
param = {
"payment_type": "qris",
"transaction_details": {
"gross_amount": 1,
"order_id": "ID-Test-Trans-00001",
},
"qris": {
"acquirer": "gopay"
}
}
charge_response = core_api.charge(param)
print(charge_response)
Saya mengikuti param pada contoh ini
NB:
Dengan contoh ini saya sudah berhasil menggenerate QR Code. Saya sudah mengikuti arahan untuk menggunakan QRIS Simulator dan GoPay QR Simulator. Namun, hasilnya: "GoPay Payment failure" padahal status masih pending, dan yang saya pilih adalah pilihan success. Pada status pembayaran di dashboard sanbox pun masih "pending"
Hi! itu yang dokumentasi flask_app instruksinya cuma gitu aja? run di local kok simple checkout nya ga bisa?
saya mencoba untuk menggunakan metode pembayaran credit card
dari contoh yang sudah disediakan disini tapi mendapati error seperti ini
Midtrans API is returning API error. API status code: `402`. API response: `{"status_code":"402","status_message":"No MID/TID for this transaction","id":"7415f081-638c-4b0a-bd84-265e2ec369b5"}`
saya mengalami gagal install paket. versi python yang digunakan yaitu 3.6.4
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-ny7wiyn3/midtransclient/setup.py", line 4, in <module>
long_description = fh.read()
File "/usr/share/nginx/html/projects/env/lib64/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 312: ordinal not in range(128)
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ny7wiyn3/midtransclient/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.