• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

8. The PayPal Web Services API > 97. Pay Affiliates and Suppliers on a Schedule

Pay Affiliates and Suppliers on a Schedule

Automate Mass Pay API calls to schedule mass payments at regular intervals.

When you have a lot of people to pay, setting up and executing online payments one at a time can quickly get tedious. Likewise, repeatedly setting up Mass Pay requests can get tedious if you have to do it every month or every week. Here is a great real-world example that shows you how to give away your money faster than you thought possible.

The Code

Start with the code from [Hack #96] and extend it with two new classes: MassPayee and MassPayeeTable (which supplements the ArrayList object):

//a class which holds the payee info
public class MassPayee{
        public string Note="";
        public string Email="";
        public string EmailSubject="";
        public string ReferenceID="";
        public double Amount=0;
}

//a class which holds the MassPayees
public class MassPayTable:ArrayList{

        public void AddPayee(MassPayee payee){
                //the API will only allow 250 payees
                if(Payess.Count=250){
                        throw new Execption("A maximum of 250 payees are allowed");
                }else{
                        Payees.Add(payee);
                }
        }
        public void ClearPayees( ){
                Payees.Clear( );
        }
        public int Count{
                g....

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint