简体   繁体   中英

PayPal rest c#: how to Attach pdf file to invoice?

i want to attach a pdf file to a invoice i created with the paypal rest api but somehow the pdf just disappear while creating the invoice without throwing any exception.

var uri = new Uri("http://www.pdf995.com/samples/pdf.pdf"); //edited
var converted = uri.AbsoluteUri;

var invoice = new Invoice()
{
 ....
 attachments = new List<FileAttachment>()
 {
     new FileAttachment
     {
          name = "pdf.pdf",
          url = converted
     },
 }
}

I also tried to use a pdf file thats available online didnt work as well. The invoice is created but without any attachments.

Without any errors from paypal response iam not able to figure out whats the issue.

Note: I use the sandbox(maybe here is the problem?)

The issue also appears in live version

Based on the definition of Paypal's invoicing API file attachment , the url must be in Uri format.

url string

The URL of the attached file, which can be downloaded.

Format: uri.

Obviously a file located in your local drive won't suffice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM