paypal / PayPal-PHP-SDK

PHP SDK for PayPal RESTful APIs
https://developer.paypal.com/docs/api/
Other
27 stars 100 forks source link

Nothing in "agreement_transaction_list" after checking the transaction had been completed #1352

Open Raphoon opened 4 years ago

Raphoon commented 4 years ago

General information

Issue description

this is sandbox data

image

I checked that transaction had been completed but when I get the transaction lists by using

Agreement::searchTransactions function I got nothing in array "agreement_transaction_list".

Agreement::searchTransactions( "I-2V5TB3SA2DYT", array( 'start_date' => date('Y-m-d', strtotime('-15 days')), 'end_date' => date('Y-m-d', strtotime('+15 days')) ), $this->ApiContext );

viktorivanov commented 4 years ago

This happened to me, too. Executing Agreement::searchTransactions method is returning empty agreement_transaction_list array.

Raphoon commented 4 years ago

This happened to me, too. Executing Agreement::searchTransactions method is returning empty agreement_transaction_list array.

I found that this function is related to api

/v1/payments/billing-agreements/{agreement_id}/transactions https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_transactions

There is a notice that "/v1/payments/billing-agreements" endpoints are deprecated and they recommend to use "/v1/billing/subscriptions" instead. But after using that url still got "RESOURCE_NOT_FOUND" error

viktorivanov commented 4 years ago

They are deprecated, but I'm supporting an app with legacy code which is not ready to be upgraded. And as far as I know, the Subscriptions API is not compatible with Billing Plans and Billing Agreements APIs.

Raphoon commented 4 years ago

Does It mean that getting Transaction Id by using Agreement Id is impossible for now?

viktorivanov commented 4 years ago

@Raphoon I think they finally fixed it! This morning I was able to retrieve agreement_transaction_list data. Maybe you could try to see if it works on your side as well.

Raphoon commented 4 years ago

@Raphoon I think they finally fixed it! This morning I was able to retrieve agreement_transaction_list data. Maybe you could try to see if it works on your side as well.

Are you still able to get right data?

viktorivanov commented 4 years ago

@Raphoon I think they finally fixed it! This morning I was able to retrieve agreement_transaction_list data. Maybe you could try to see if it works on your side as well.

Are you still able to get right data?

Yes, it works as expected.

Raphoon commented 4 years ago

Yes, it works as expected.

I think there should be some delay between payment and retrieving. request right after the payment still bring empty array. But after some seconds(almost a minute) it works right.

viktorivanov commented 4 years ago

Yes, it works as expected.

I think there should be some delay between payment and retrieving. request right after the payment still bring empty array. But after some seconds(almost a minute) it works right.

For me on sandbox mode it has always been like this - around 4-5 minutes delay before the payment becomes available and the billing agreement state transitions from pending to complete. And I think during production transactions are almost immediately available and Billing Agreement doesn't have a pending status.