Class: Airwallex::FundsSplit

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List, APIOperations::Retrieve
Defined in:
lib/airwallex/resources/funds_split.rb

Overview

Represents a Funds Split — how a single PaymentIntent/inbound transaction is divided between the platform and a Connected Account at collection time (the Scale-product mechanism for splitting deposits).

Examples:

Create a split

split = Airwallex::FundsSplit.create(
  payment_intent_id: intent.id,
  splits: [{ account_id: .id, amount: 50.00 }]
)

Release the split funds

split.release

Instance Attribute Summary

Attributes inherited from APIResource

#attributes, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::Retrieve

retrieve

Methods included from APIOperations::List

list

Methods inherited from APIResource

#changed_attributes, #dirty?, #initialize, #inspect, #method_missing, #refresh, #refresh_from, resource_name, #respond_to_missing?, #to_hash, #to_json, #to_s

Constructor Details

This class inherits a constructor from Airwallex::APIResource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Airwallex::APIResource

Class Method Details

.resource_pathString

Returns API resource path for funds splits.

Returns:

  • (String)

    API resource path for funds splits



22
23
24
# File 'lib/airwallex/resources/funds_split.rb', line 22

def self.resource_path
  "/api/v1/pa/funds_splits"
end

Instance Method Details

#release(params = {}) ⇒ FundsSplit

Release this funds split (make the split amount available to the connected account)

Parameters:

  • params (Hash) (defaults to: {})

    additional params

Returns:



31
32
33
34
35
# File 'lib/airwallex/resources/funds_split.rb', line 31

def release(params = {})
  response = Airwallex.client.post("#{self.class.resource_path}/#{id}/release", params)
  refresh_from(response)
  self
end