Paypal and the payments api

Hi everyone,

I am trying to understand how the payment api handles the checkout process for payments by paypal.

For credit card payments which get a 200 status code we can grab the ID to use for the bbps_transaction_id value to create the gift.

As I understand it a successful Paypal payment returns a status code of 201 which returns no data but is a successful transaction. My questions are

  • how do you get the id
  • How do we detect the payment was paypal so we can do some other logic

Thanks in advance


Comments

  • Mina Mistry
    Mina Mistry Blackbaud Employee
    Seventh Anniversary Kudos 2 Name Dropper Participant

    Hi @Qamar Ramzan

    To get the transaction ID: the Checkout Transaction endpoint will return a 201 response for all successful PayPal transactions. In the 201 response header, there is a Location property that will contain the transaction ID. However, as noted in the documentation, using the GET Transaction endpoint for any PayPal transaction returns a 404 because those transactions are processed with PayPal directly.

    96ab24ef6a52fdbd123400a89fcac121-huge-im

    To know when PayPal has been used: unfortunately, there is no explicit transaction type that will tell you it's a PayPal transaction, but if you get a 201 response as mentioned above, plus a 404 when trying to get transaction details, it is most likely a PayPal transaction.

    Hope this helps!