Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payment.get or Payment.list #78

Closed
jhallam3 opened this issue Feb 11, 2015 · 9 comments
Closed

Payment.get or Payment.list #78

jhallam3 opened this issue Feb 11, 2015 · 9 comments
Labels

Comments

@jhallam3
Copy link

Hi There.

Im wanting to get the payment information for a particular transaction All I have is this code.

'PayPal Express Checkout Payment Received (Unique Transaction ID 7Y101347N5101833S)'

Ive hunted and hunted for two days now and cant see how to get this information.

Basiclly All I want is to get the details of that transaction in the c#.

Please help.

@jziaja
Copy link
Contributor

jziaja commented Feb 11, 2015

Hi @jhallam3, was that payment made using a REST or Classic (Merchant API) call?

@jhallam3
Copy link
Author

Was from our booking system that is Wordpress plugging. Probably classic...

Our newer solution moving forward would use your new API. However we
get payments from the classic api from other sites.

Basicly I'm wanting to get details like address and amount in to our
internal system to create a PDF of the transaction.

Hopefully that can be done 😀

Fast response too that's great! Thanks! Good to know there's people
out there who can help! 😀

@jziaja
Copy link
Contributor

jziaja commented Feb 11, 2015

If it's Classic, then you'll have to use the Merchant SDK and call TransactionSearch() to get the transaction details. I've received confirmation from the Payments team that they don't plan to include transactions made with Classic calls in the results for the REST API (see PHP SDK issue #244).

Once you get the newer solution working that uses REST, you can use Payment.List() and search for payment transactions that match the ID. Depending on which ID you're working with (payment resource ID or a specific sale, order, authorization, etc. ID), you may need to look in the related_resources of each Payment object returned to find the resource that matches the ID you're looking for. See Issue #70 for more information on how to accomplish this.

Hope that helps! Let me know over on the Merchant SDK repo if you have any trouble finding the transaction details for that ID using that SDK.

@jziaja jziaja closed this as completed Feb 11, 2015
@jhallam3
Copy link
Author

Thanks! I'll give that a go!

Regards

Jon Hallam

On 11 Feb 2015, at 20:01, Jason Ziaja notifications@github.com wrote:

If it's Classic, then you'll have to use the Merchant SDK
https://github.com/paypal/merchant-sdk-dotnet and call TransactionSearch()
https://developer.paypal.com/docs/classic/api/merchant/TransactionSearch_API_Operation_NVP/
to get the transaction details. I've received confirmation from the
Payments team that they don't plan to include transactions made with
Classic calls in the results for the REST API (see PHP SDK issue #244
paypal/PayPal-PHP-SDK#244).

Once you get the newer solution working that uses REST, you can use
Payment.List()
https://github.com/paypal/PayPal-NET-SDK/blob/master/Source/SDK/Api/Payment.cs#L215
and search for payment transactions that match the ID. Depending on which
ID you're working with (payment resource ID or a specific sale, order,
authorization, etc. ID), you may need to look in the related_resources of
each Payment object returned to find the resource that matches the ID
you're looking for. See Issue #70
#70 for more information
on how to accomplish this.

Hope that helps! Let me know over on the Merchant SDK repo if you have any
trouble finding the transaction details for that ID using that SDK.


Reply to this email directly or view it on GitHub
#78 (comment).

@jhallam3
Copy link
Author

Is it possible to put the API Keys inside the code rather than xml? I'm
writing a .net class and want to pull them variables from our internal
database? I see it in xml however moving forward in a class would be better
if possible.

Regards

Jon Hallam

On 11 Feb 2015, at 20:01, Jason Ziaja notifications@github.com wrote:

If it's Classic, then you'll have to use the Merchant SDK
https://github.com/paypal/merchant-sdk-dotnet and call TransactionSearch()
https://developer.paypal.com/docs/classic/api/merchant/TransactionSearch_API_Operation_NVP/
to get the transaction details. I've received confirmation from the
Payments team that they don't plan to include transactions made with
Classic calls in the results for the REST API (see PHP SDK issue #244
paypal/PayPal-PHP-SDK#244).

Once you get the newer solution working that uses REST, you can use
Payment.List()
https://github.com/paypal/PayPal-NET-SDK/blob/master/Source/SDK/Api/Payment.cs#L215
and search for payment transactions that match the ID. Depending on which
ID you're working with (payment resource ID or a specific sale, order,
authorization, etc. ID), you may need to look in the related_resources of
each Payment object returned to find the resource that matches the ID
you're looking for. See Issue #70
#70 for more information
on how to accomplish this.

Hope that helps! Let me know over on the Merchant SDK repo if you have any
trouble finding the transaction details for that ID using that SDK.


Reply to this email directly or view it on GitHub
#78 (comment).

@jziaja
Copy link
Contributor

jziaja commented Feb 11, 2015

Yup! And now that you bring it up, it'd be nice if there was a blurb on the main README that showed this an alternative to using the web.config or app.config.

When you call OAuthTokenCredential.GetAccessToken() to get an access token, you'll need to supply the class with a configuration object containing your credentials and other information. The configuration is just a Dictionary<string, string> object and can be easily defined in the code:

using PayPal.Api;

var config = new Dictionary<string, string>
{
    {"mode", "sandbox"},
    {"clientId",     /* call to get clientId from database here */},
    {"clientSecret", /* call to get clientSecret from database here */}
};
var accessToken = new OAuthTokenCredential(config).GetAccessToken();
var apiContext = new APIContext(accessToken);

You can even mix and match if you'd like to have some properties stored in the web.config or app.config and others sourced from a database:

using PayPal.Api;

var config = ConfigManager.Instance.GetProperties();
config["clientId"] = /* call to get clientId from database here */;
config["clientSecret"] = /* call to get clientSecret from database here */;

var accessToken = new OAuthTokenCredential(config).GetAccessToken();
var apiContext = new APIContext(accessToken);

@jhallam3
Copy link
Author

Hi there,

Im looking at doing some work with PayPal and wanted to check which type of the SDK to use for subscriptions and what option is best with asp.net http://asp.net/ MVC page.

Im lost with all the options available added complexity of MVC I’m really really lost and not sure where to go.

Any support would be amazing!

Thanks in advance.

Regards
Jon Hallam

On 11 Feb 2015, at 21:35, Jason Ziaja notifications@github.com wrote:

Yup! And now that you bring it up, it'd be nice if there was a blurb on the main README that showed this an alternative to using the web.config or app.config.

When you call OAuthTokenCredential.GetAccessToken() to get an access token, you'll need to supply the class with a configuration object containing your credentials and other information. The configuration is just a Dictionary<string, string> object and can be easily defined in the code:

using PayPal.Api;

var config = new Dictionary<string, string>
{
{"mode", "sandbox"},
{"clientId", /* call to get clientId from database here /},
{"clientSecret", /
call to get clientSecret from database here */},
};
var accessToken = new OAuthTokenCredential(config).GetAccessToken();
var apiContext = new APIContext(accessToken);
You can even mix and match if you'd like to have some properties stored in the web.config or app.config and others sourced from a database:

using PayPal.Api;

var config = ConfigManager.Instance.GetProperties();
config["clientId"] = /* call to get clientId from database here /;
config["clientSecret"] = /
call to get clientSecret from database here */;

var accessToken = new OAuthTokenCredential(config).GetAccessToken();
var apiContext = new APIContext(accessToken);

Reply to this email directly or view it on GitHub #78 (comment).

@jziaja
Copy link
Contributor

jziaja commented May 20, 2015

@jhallam3 , access to the Subscriptions API is available in this SDK via the Plan and Agreement classes. There are also samples available for subscriptions that show how to set one up. The samples are currently only available as a WebForms project, but the logic for getting everything setup should be easily translatable to an MVC project.

@InteXX
Copy link

InteXX commented Jun 15, 2016

I'm casting my vote for the ability to search for and locate ANY transaction via the REST API (and the .NET SDK), not just those created by an API.

In other words, the REST API (and the .NET SDK) should be able to locate transactions that were created manually via the website user interface. A returned list of merely API-created transactions (any API) is simply not sufficient—manually-created transactions should be included as well.

This is a very serious issue. I haven't seen discussion regarding the problem that's dated newer than over a year ago, so I hope attention to it hasn't waned.

Thanks,
Jeff Bowman
Fairbanks, Alaska

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants