Skip to content

network_transaction_reference id missing in capture #27

@JeremyCanfield

Description

@JeremyCanfield

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.

paypal/PayPal-PHP-Server-SDK#10

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions