yappy

Untitled

Apr 24th, 2017
1,461
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. */
  2.  
  3. "use strict";
  4.  
  5. var paypal = require('../../');
  6.  
  7. require('../configure');
  8.  
  9.  
  10. var sender_batch_id = Math.random().toString(36).substring(9);
  11.  
  12.  
  13. var create_payout_json = {
  14.  
  15.     "sender_batch_header": {
  16.  
  17.         "sender_batch_id": sender_batch_id,
  18.  
  19.         "email_subject": "You have a payment"
  20.  
  21.     },
  22.  
  23.     "items": [
  24.  
  25.         {
  26.  
  27.             "recipient_type": "EMAIL",
  28.  
  29.             "amount": {
  30.  
  31.                 "value": 0.99,
  32.  
  33.                 "currency": "USD"
  34.  
  35.             },
  36.  
  37.             "receiver": "shirt-supplier-one@mail.com",
  38.  
  39.             "note": "Thank you.",
  40.  
  41.             "sender_item_id": "item_1"
  42.  
  43.         },
  44.  
  45.         {
  46.  
  47.             "recipient_type": "EMAIL",
  48.  
  49.             "amount": {
  50.  
  51.                 "value": 0.90,
  52.  
  53.                 "currency": "USD"
  54.  
  55.             },
  56.  
  57.             "receiver": "shirt-supplier-two@mail.com",
  58.  
  59.             "note": "Thank you.",
  60.  
  61.             "sender_item_id": "item_2"
  62.  
  63.         },
  64.  
  65.         {
  66.  
  67.             "recipient_type": "EMAIL",
  68.  
  69.             "amount": {
  70.  
  71.                 "value": 2.00,
  72.  
  73.                 "currency": "USD"
  74.  
  75.             },
  76.  
  77.             "receiver": "shirt-supplier-three@mail.com",
  78.  
  79.             "note": "Thank you.",
  80.  
  81.             "sender_item_id": "item_3"
  82.  
  83.         }
  84.  
  85.     ]
  86.  
  87. };
  88.  
  89.  
  90. paypal.payout.create(create_payout_json, function (error, payout) {
  91.  
  92.     if (error) {
  93.  
  94.         console.log(error.response);
  95.  
  96.         throw error;
  97.  
  98.     } else {
  99.  
  100.         console.log("Create Payout Response");
  101.  
  102.         console.log(payout);
  103.  
  104.     }
  105.  
  106. });
RAW Paste Data