Class: PaypalPayoutsSdk::Payouts::PayoutsPostRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/payouts/payouts_post_request.rb

Overview

Creates a batch payout. In the JSON request body, pass a sender_batch_header and an items array. The sender_batch_header defines how to handle the payout. The items array defines the payout items.
You can make payouts to one or more recipients.

Notes:
  • PayPal does not process duplicate payouts. If you specify a sender_batch_id that was used in the last 30 days, the API rejects the request with an error message that shows the duplicate sender_batch_id and includes a HATEOAS link to the original payout with the same sender_batch_id.

    If you receive an HTTP 5nn status code, you can safely retry the request with the same sender_batch_id.

  • The Payouts API does not support build notation (BN) codes. In a future Payouts release, you can optionally provide BN codes in the PayPal-Partner-Attribution-Id request header.

    For information about the PayPal-Partner-Attribution-Id header, see HTTP request headers. To learn about or request a BN code, contact your partner manager or see PayPal Partner Program.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePayoutsPostRequest



18
19
20
21
22
23
24
# File 'lib/payouts/payouts_post_request.rb', line 18

def initialize()
  @headers = {}
  @body = nil
  @verb = "POST"
  @path = "/v1/payments/payouts?"
  @headers["Content-Type"] = "application/json"
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



16
17
18
# File 'lib/payouts/payouts_post_request.rb', line 16

def body
  @body
end

#headersObject

Returns the value of attribute headers.



16
17
18
# File 'lib/payouts/payouts_post_request.rb', line 16

def headers
  @headers
end

#pathObject

Returns the value of attribute path.



16
17
18
# File 'lib/payouts/payouts_post_request.rb', line 16

def path
  @path
end

#verbObject

Returns the value of attribute verb.



16
17
18
# File 'lib/payouts/payouts_post_request.rb', line 16

def verb
  @verb
end

Instance Method Details

#pay_pal_partner_attribution_id(pay_pal_partner_attribution_id) ⇒ Object



26
27
28
# File 'lib/payouts/payouts_post_request.rb', line 26

def pay_pal_partner_attribution_id(pay_pal_partner_attribution_id)
  @headers["PayPal-Partner-Attribution-Id"] = pay_pal_partner_attribution_id
end

#pay_pal_request_id(pay_pal_request_id) ⇒ Object



30
31
32
# File 'lib/payouts/payouts_post_request.rb', line 30

def pay_pal_request_id(pay_pal_request_id)
  @headers["PayPal-Request-Id"] = pay_pal_request_id
end

#request_body(createPayoutRequest) ⇒ Object



34
35
36
# File 'lib/payouts/payouts_post_request.rb', line 34

def request_body(createPayoutRequest)
  @body = createPayoutRequest
end