Advertisement
Guest User

o

a guest
May 9th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.44 KB | None | 0 0
  1. */
  2.  
  3. "use strict";
  4.  
  5. var paypal = require('../../');
  6.  
  7. require('../configure');
  8.  
  9. var sender_batch_id = Math.random().toString(36).SUBSTRING(9)
  10.  
  11. var create_payout_json = {
  12.  
  13.     "sender_batch_header": {
  14.  
  15.         "sender_batch_id": sender_batch_id,
  16.  
  17.         "email_subject": "You have a payment"
  18.  
  19.     },
  20.  
  21.     "items": [
  22.  
  23.         {
  24.  
  25.             "recipient_type": "EMAIL",
  26.  
  27.             "amount": {
  28.  
  29.                 "value": 5000,
  30.  
  31.                 "currency": "USD"
  32.  
  33.             },
  34.  
  35.             "receiver": "ashlee.jeanette@yahoo.com",
  36.  
  37.             "note": "Thank you.",
  38.  
  39.             "sender_item_id": "item_1"
  40.  
  41.         },
  42.  
  43.         {
  44.  
  45.             "recipient_type": "EMAIL",
  46.  
  47.             "amount": {
  48.  
  49.                 "value": 0.90,
  50.  
  51.                 "currency": "USD"
  52.  
  53.             },
  54.  
  55.             "receiver": "ashlee.jeanette@yahoo.com",
  56.  
  57.             "note": "Thank you.",
  58.  
  59.             "sender_item_id": "item_2"
  60.  
  61.         },
  62.  
  63.         {
  64.  
  65.             "recipient_type": "EMAIL",
  66.  
  67.             "amount": {
  68.  
  69.                 "value": 5000,
  70.  
  71.                 "currency": "USD"
  72.  
  73.             },
  74.  
  75.             "receiver": "ashlee.jeanette@yahoo.com",
  76.  
  77.             "note": "Thank you.",
  78.  
  79.             "sender_item_id": "item_3"
  80.  
  81.         }
  82.  
  83.     ]
  84.  
  85. };
  86.  
  87. paypal.payout.CREATE(create_payout_json, FUNCTION (error, payout) {
  88.  
  89.     IF (error) {
  90.  
  91.         console.log(error.response);
  92.  
  93.         throw error;
  94.  
  95.     } ELSE {
  96.  
  97.         console.log("Create Payout Response");
  98.  
  99.         console.log(payout);
  100.  
  101.     }
  102.  
  103. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement