diff --git a/paypal/paypal.transaction.details.xml b/paypal/paypal.transaction.details.xml index 0a6ddc07..fb9e8724 100644 --- a/paypal/paypal.transaction.details.xml +++ b/paypal/paypal.transaction.details.xml @@ -1,35 +1,34 @@ - select * from {table} WHERE APIUsername="your_api_username" AND APIPassword="your_api_password" AND Signature="your_api_aignature" AND TransactionID="-transaction-id-from-transaction-search-result-or-IPN-" AND Endpoint="sandbox" + select * from {table} WHERE APIUsername="your_api_username" AND APIPassword="your_api_password" AND Signature="your_api_aignature" AND TransactionID="-transaction-id-from-transaction-search-result-or-IPN-" AND Environment="sandbox"The PayPal Transaction Details API allows you to obtain details about a specific transaction. The details include information from Payer, shipping address to the amount charged. Please note that inorder to be able to use the API to obtain the details of a transaction, you must either be the owner of the business account that's marked as the receiver of the payment or have obtained API access from the corresponding receiver account owner. Please refer to the GetTransactionDetails API documentation on x.com to understand the data returned by the API. - www.x.com/developers/paypal/products/transactional-information + https://www.x.com/community/ppx/transaction_information - - + {APIUsername}{APIPassword}{Signature}58.0{TransactionID} + + + + if(inputs['Environment'] == 'live') { + response.object = y.rest("https://api..paypal.com/2.0/").contentType("text/xml").header("SOAPAction", '""').post(txn_details_req).response; - var responseObj = {}; - var temp; - if(inputs['Endpoint'] == 'sandbox') { - temp = y.rest("https://api-3t.sandbox.paypal.com/nvp?" + txn_details_req).get().response; } else { - temp = y.rest("https://api-3t.paypal.com/nvp?" + txn_details_req).get().response; + response.object = y.rest("https://api.sandbox.paypal.com/2.0/").contentType("text/xml").header("SOAPAction", '""').post(txn_details_req).response; + } - responseObj = temp.split("&"); - - response.object = {'details': responseObj}; - + ]]> diff --git a/paypal/paypal.transactions.xml b/paypal/paypal.transactions.xml index a6b2e73a..93d174f8 100644 --- a/paypal/paypal.transactions.xml +++ b/paypal/paypal.transactions.xml @@ -1,134 +1,163 @@ -
- - select * from {table} WHERE APIUsername="your_api_username" AND APIPassword="your_api_password" AND Signature="your_api_aignature AND StartDate="YYYY-MM-DDThh:MM:ss.mmmZ" AND Endpoint="sandbox" - select * from {table} WHERE APIUsername="your_api_username" AND APIPassword="your_api_password" AND Signature="your_api_aignature AND StartDate="YYYY-MM-DDThh:MM:ss.mmmZ" AND Payer="your-payer-email-that-youwant-to-narrow-down-results" AND Endpoint="sandbox" - SELECT * FROM paypal.transaction.details WHERE APIUsername="your_api_username" AND APIPassword="your_api_password" AND Signature="your_api_aignature" AND Endpoint="sandbox" AND TransactionID in (SELECT PaymentTransactions.TransactionID FROM {table} WHERE StartDate="YYYY-MM-DDThh:MM:ss.mmmZ" AND Payer="your-payer-email-that-youwant-to-narrow-down-results" AND APIUsername="your_api_username" AND APIPassword="your_api_password" AND Signature="your_api_aignature") - - The PayPal Transaction Details API allows you to obtain details about a specific transaction. The details include information from Payer, shipping address to the amount charged. Please note that inorder to be able to use the API to obtain the details of a transaction, you must either be the owner of the business account that's marked as the receiver of the payment or have obtained API access from the corresponding receiver account owner. Please refer to the GetTransactionDetails API documentation on x.com to understand the data returned by the API. - www.x.com/developers/paypal/products/transactional-information +
+ + select * from {table} WHERE APIUsername="your_api_username" AND APIPassword="your_api_password" AND Signature="your_api_aignature AND StartDate="YYYY-MM-DDThh:MM:ss.mmmZ" AND Environment="sandbox" + select * from {table} WHERE APIUsername="your_api_username" AND APIPassword="your_api_password" AND Signature="your_api_aignature AND StartDate="YYYY-MM-DDThh:MM:ss.mmmZ" AND Payer="your-payer-email-that-youwant-to-narrow-down-results" AND Environment="sandbox" + SELECT * FROM paypal.transaction.details WHERE APIUsername="your_api_username" AND APIPassword="your_api_password" AND Signature="your_api_aignature" AND TransactionID in (SELECT PaymentTransactions.TransactionID FROM {table} WHERE StartDate="YYYY-MM-DDThh:MM:ss.mmmZ" AND Payer="your-payer-email-that-youwant-to-narrow-down-results" AND APIUsername="your_api_username" AND APIPassword="your_api_password" AND Signature="your_api_aignature") AND Environment="sandbox" + The PayPal Transaction Search API allows you to search through a PayPal business account's transaction history to create compelling reporting apps. Please note that inorder to be able to use the API to search a PayPal business account's transaction history, you must either be the owner of the account or have obtained API access from the corresponding account owner. Please refer to the TransactionSearch API documentation on x.com to understand how each of the input parameters help in navigating through the transaction history. You can as well combine results from this table with PayPal Transaction Details table to obtain information specific to each transaction (Eg. Address, Payer, etc.) and use that information with other tables (Geo, Maps, etc.) to produce useful data for building cool reporting tools. + https://www.x.com/community/ppx/transaction_information + + + - - - - - - - - - - - - - - - - - - - - - - - - - - ' + StartDate + ''; + + +if (EndDate) { + txn_req += '' + EndDate + ''; +} +if (Payer) { + txn_req += '' + Payer + ''; +} +if (Receiver) { + txn_req += '' + Receiver + ''; +} +if (ReceiptID) { + txn_req += '' + ReceiptID + ''; +} +if (TransactionID) { + txn_req += '' + TransactionID + ''; +} +if (InvoiceID) { + txn_req += '' + InvoiceID + ''; +} +if (CardNumber) { + txn_req += '' + CardNumber + ''; +} + +if (PayerFirstName || PayerLastName) { + txn_req += ''; + if (PayerSalutation) { + txn_req += '' + PayerSalutation + ''; + } + if (PayerFirstName) { + txn_req += '' + PayerFirstName + ''; + } + if (PayerMiddleName) { + txn_req += '' + PayerMiddleName + ''; + } + if (PayerLastName) { + txn_req += '' + PayerLastName + ''; + } + if (PayerSuffix) { + txn_req += '' + PayerSuffix + ''; + } + txn_req += ''; +} + +if (AuctionItemNumber) { + txn_req += '' + AuctionItemNumber + ''; +} +if (TransactionClass) { + txn_req += '' + TransactionClass + ''; +} +if (Amount) { + txn_req += '' + Amount + ''; +} +if (CurrencyCode) { + txn_req += '' + CurrencyCode + ''; +} +if (Status) { + txn_req += '' + Status + ''; +} +txn_req += ''; + + + if(inputs['Environment'] == 'live') { + + try { + response.object = y.rest("https://api.paypal.com/2.0/").contentType("text/xml").header("SOAPAction", '""').timeout(30000).post(txn_req).response; + } + catch (e){ + y.log(e); + } + } else { - temp = y.rest("https://api-3t.paypal.com/nvp?" + txn_details_req).get().response; - } - - responseObj = temp.split("&"); - - response.object = {'details': responseObj}; - -]]> - - + + + try { + response.object = y.rest("https://api.sandbox.paypal.com/2.0/").contentType("text/xml").header("SOAPAction", '""').timeout(30000).post(txn_req).response; + } + catch (e){ + y.log(e); + } + + + } + + + ]]> + + +
\ No newline at end of file