-
Notifications
You must be signed in to change notification settings - Fork 10
Description
We've version 0.6.1 of the paypal-server-sdk installed in our Python Flask Docker containers that are using the paypal-server-sdk to process payments. Here is the boilerplate code for our capture order route in one of our Flask containers.
@app.route('/api/orders/<order_id>/capture', methods=['POST'])
def capture_order(order_id):order = orders_controller.orders_capture({ 'id': order_id, 'prefer': 'return=representation' }) return ApiHelper.json_serialize(order.body)
Sometimes, a POST request to the /api/orders/<order_id>/capture route in our Flask app returns JSON that contains a network_transaction_reference id, something like this.
{ "id": "123456789012345", "network": "VISA" }
Other times, a POST request to the /api/orders/<order_id>/capture route in our Flask app returns JSON that does not contains a network_transaction_reference id, something like this.
{ "network": "VISA" }
If network_transaction_reference does not contain id, an exception is raised that says the value for id in network_transaction_reference cannot be None, ultimately causing unexpected results as the transaction continues to process. Worst case scenario, we have customers getting charged multiple times.
ValueError: The value for id can not be None for <paypalserversdk.models.network_transaction_reference.NetworkTransactionReference object at 0x7fb345664050>
This seems awfully similar to the following issue reported with the PHP paypal SDK and may only occur for debit card transactions and may not occur for credit card transactions.
It looks like the latest version of the Python Flask paypal-server-sdk is version 1.1.0. We are currently running version 0.6.1 of the Python Flask paypal-server-sdk. I am curious if this issue was identified and fixed in a release after version 0.6.1?