PayPal REST API SDK: Payment.Get shipping_address deprecated? - c#

The documentation for the PayPal Rest API SDK for .NET indicates the payer_info.shipping_address is deprecated / obsolete.
https://github.com/paypal/PayPal-NET-SDK/blob/develop/Source/SDK/Api/PayerInfo.cs
Obsolete. Use shipping address present in purchase unit.
What would be the correct field to use to retrieve the payer's shipping address then, using the Get method? I don't see any field called purchase unit or the like returned in the Get method.
I should note, it seems the shipping_address is populated correctly still.

I just got a response from PayPal MTS and clarified the documentation is from an older version and is wrong.
https://github.com/paypal/PayPal-NET-SDK/issues/123

Related

How to call Microsoft Graph Beta API from C#

I tried to get the content of the user's profile picture and I found out that I had to call the Beta version because the current version gives the following error message:
"code": "GetUserPhoto",
"message": "The operation is not supported."
So, I tried to switch to Beta, and here is the code that I wrote in C# to do it, but it doesn't work:
Microsoft.Graph 1.6.2
List<QueryOption> options = new List<QueryOption>
{
new QueryOption("$api-version", "beta")
};
var pictureStream = await graphClient.Me.Photo.Content.Request(options).GetAsync();
I got the same error message.
I tried the same request in the Graph Explorer. The 1.0 doesn't work, but Beta works.
The api-version query parameter is used by the Azure AD Graph API. This is a different API than Microsoft Graph. There is a lot of functional overlap (Azure AD Graph is slowly being migrated over to Microsoft Graph) but they use entirely different entities and calling conventions.
In order to call the /beta endpoint using the Microsoft Graph .NET Client Library, you need to change the BaseUrl of the client:
graphClient.BaseUrl = "https://graph.microsoft.com/beta";
var pictureStream = await graphClient.Me.Photo.Content.Request().GetAsync();
Some important notes about the /beta endpoint:
It isn't supported and isn't suitable for production. So don't do that. Or at least don't tell anyone and don't call Support if it stops working. ;-)
The .NET Client uses objects constructed off the production metadata. This means that any entities, actions or properties that were added in /beta don't exist in the models shipped with the SDK.
The .NET Client will ignore any values returned by Microsoft Graph that it doesn't expect to see. So if an endpoint returns a property that wasn't included in the production metadata (see #2), it will simply be ignored.
So long as you're only using a /beta to gain functionality but still expecting /v1.0 results, it should work okay. Photos for example only look at Exchange in v1.0 but look in both Exchange and Active Directory but still return the same result. In theory this means you should be able to swap /beta for /v1.0 without a problem.
I think you are still calling V1 endpoint. In fact, the Beta endpoint is not currently supported in the Microsoft Graph .NET Client Library. More info here.
There is an official beta client for Graph API now:
https://github.com/microsoftgraph/msgraph-beta-sdk-dotnet

Cannot assign a payer_id when saving a card to the vault

According to the rest api documentation it is recommended to assign a payer_id when saving a card to the vault.
My problem is that there is no payer_id property to populate for the creditCard object in the first place.
creditCard.number = "4417119669820331";
creditCard.expire_month = "11";
creditCard.expire_year = "2018";
creditCard.first_name = "Joe";
creditCard.last_name = "Shopper";
creditCard.type = "visa";
**creditCard.payer_id = "123456789";**
As far as I am aware I am using the latest APIs updated by Nuget in VS2012.
Here's the response from the PayPal Vault API team:
The payer_id field was never removed. We've intended to deprecate/discourage its use because we determined that this field was misleading in the way it was named - it was being mistaken for a PayPal's internal identifier, where in reality, to PayPal, it was just an arbitrary string, intending to identify an externally managed customer id. The Vault team has since added a field named external_customer_id that better captures the intent.
The external_customer_id property (found here in the current version of the SDK) is what should be used instead. However, since the payer_id property will continue to be supported in the v1 version of the Vault REST services, the .NET SDK will continue to provide support for this (the upcoming v1.1 .NET SDK release will include it again).
The PayPal documentation team is working on getting the public documentation for the credit card object updated to include this information.
For future reference by other developers who may find this post, I'd like to add that if you do find a property missing from the PayPal .NET SDK, a better place to report this is to open an issue on the PayPal .NET SDK GitHub repository where the code for the SDK resides.

Remove Shipping Address Info in PayPal

I'd like to hide or remove the shipping details or info in PayPal because we provide only services, thus we don't require the Shipping details to show in PayPal checkout page. I am using PayPal RestAPISDK.
Unfortunately the RESTful APIs do not yet have support for the NOSHIPPING variable that is used in the Classic APIs. Address handling is something that is being discussed for future releases.
I was also facing the same problem and sorted it out to some extent.
You just add the following parameter
redirectUrl += "&shipping=0";
and shipping address will not get displayed.

eBay API: How do I specify "Standard Shipping (FedEx Ground or FedEx Home Delivery®)" as a shipping service?

I am wondering how I specify "Standard Shipping (FedEx Ground or FedEx Home Delivery®)" as a shipping service using the eBay API. Can anyone provide any pointers? All of the samples just use the "Standard Shipping" option.
You need to specify FedExHomeDelivery. A table of shipping services for most eBay sites can be found here. Simply use the values in the ID for importing column for your eBay API calls.
As the types of shipping services change over time you may wish to periodically retrieve the latest services via the API as follows.
For each eBay site that you are interested in make a call to GeteBayDetails with a DetailName value of ShippingServiceDetails.
In the results iterate over all the ShippingServiceDetails elements. Each one is a shipping service for the site that you specified.
Important properties for each service that you will need to check are,
ValidForSellingFlow - If this set to 'true' the service can be used in the Add/Revise/Relist API calls otherwise you can not use it.
Description - You can use this value when presenting services to a user. The text should match what users see when listing via eBay.
ShippingService - This is the value that you want to use in your API calls.
You can find all available shipping methods in the documentation of ShippingServiceCodeType.
Beware to use the correct ones of the site id where item will be placed.

C# Amazon Product Advertising API

As of August 15, Amazon made it compulsory to sign all requests made to their Product Advertising API. I thought I had got everything working just fine but when the 15th finally came around, my web application stopped working and pretty much ever since I have been trying to find out how to sign the SOAP requests.
Amazon has an outdated sample code for signing requests that doesn't appear to work here
Basically, I need to know how to add a signature to the my requests using the most current C# SOAP API and .NET 3.5.
I hope I have given enough details, if I haven't please feel free to ask me to elaborate.
Thank You
The_Lorax
UPDATE:
I am using MVC and need to know how to add the Signature to the the ItemLookup or AWSECommerceService object. Is there an attribute that contains the signature value? How does it get attached to the request?
On this page, they say that I must include the Signature and TimeStamp parameters but the intellisense does now show any such attributes.
Check out http://flyingpies.wordpress.com/2009/08/01/17/. It has a walkthrough and a sample visual studio solution using C#, SOAP, WCF on .NET 3.5.
This library automatic sign the requests (Install-Package Nager.AmazonProductAdvertising)
https://www.nuget.org/packages/Nager.AmazonProductAdvertising/
Example:
var authentication = new AmazonAuthentication("accesskey", "secretkey");
var client = new AmazonProductAdvertisingClient(authentication, AmazonEndpoint.US);
var result = await client.SearchItemsAsync("canon eos");

Categories

Resources