Có cách nào để lấy ID giao dịch của giao dịch bán hàng mà tôi vừa thực hiện hay không. Dưới đây là những gì tôi có cho đến thời điểm này:Cách nhận ID giao dịch trong bán hàng braintree
>>> sale=braintree.Transaction.sale({'amount': '0.05', 'customer_id': '17419473'})
>>> sale.transaction
<Transaction {amount: Decimal('0.05'), credit_card: {u'bin': u'411111', u'expiration_month': u'12', u'unique_number_identifier': u'a05f827ae3578b49d685ee2200dfaa97', u'prepaid': u'Unknown', u'expiration_year': u'2024', u'durbin_regulated': u'Unknown', u'payroll': u'Unknown', u'debit': u'Unknown', u'commercial': u'Unknown', u'issuing_bank': u'Unknown', u'last_4': u'1111', u'card_type': u'Visa', u'cardholder_name': None, u'token': u'9k5jxr', u'customer_location': u'US', u'image_url': u'https://assets.braintreegateway.com/payment_method_logo/visa.png?environment=sandbox', u'country_of_issuance': u'Unknown', u'healthcare': u'Unknown', u'venmo_sdk': False, u'product_id': u'Unknown'}} at 4510688208>
Thật không may, tôi không thấy số TransactionID
ở đầu ra ở trên. Trên thực tế, tôi chỉ thấy thông tin amount
và credit_card
. Làm cách nào để tôi nhận được TransactionID từ việc bán hàng? Trường hợp sử dụng của tôi là sau khi người dùng thanh toán cho một thứ gì đó, tôi muốn lưu trữ ID giao dịch đó cho giao dịch mua.