ruby-brightpearl 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7812b15f9e154a4f456e4f240064d16fa996f28dd4b7de7db71c0755251fb3ac
4
- data.tar.gz: '0733425239130ce0c62fc11467a7b5b285f7bc0838421aa3acf680b2ed959c78'
3
+ metadata.gz: b9e05da1a90bbe24c05beed8a083e43a77c4c22376af84e12f37d8ea3e6eeba8
4
+ data.tar.gz: 5f06f50c457a8be89f53181353c77c91dccbcf7d782de0096af6183eaae4358f
5
5
  SHA512:
6
- metadata.gz: 2d449c53b725ee84d975c72cce202952b729a8448ff2860863657a0bddf4b71a7895beeb7d0815404ba7413fe537173e24213cc525145f19b39450856b6aedc5
7
- data.tar.gz: 8fd551ae744bfca7f9e2ca1f73087edda0ea7a32d89ccd6f0fa467672cc139e9c271757480dcca99f912e3fec63597e1c64177274b4fd71e8d36c7b6793df081
6
+ metadata.gz: 5053255b92df81af25092d34b469b85bdf8a989c365f5654e018889b8de5e73aab963d5c7b6425849edcccab488ecab2d92f1bef2aa8c7a954d6bf96ab570e51
7
+ data.tar.gz: 9e377fe15a59fa1db5593521f5ac56f9d138c6e8cd823dca0b83d821f28fdfb6c81bfc8f7bd230f339dddc40a3b6918e968747416e683705c5d3d94e8d78b112
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.10.0] - 2026-04-17
4
+
5
+ ### Added
6
+
7
+ - New resource `CustomerPayment`
8
+ - Available operations: `SEARCH`, `POST`, `DELETE`
9
+
3
10
  ## [0.9.0] - 2025-12-10
4
11
 
5
12
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-brightpearl (0.9.0)
4
+ ruby-brightpearl (0.10.0)
5
5
  httparty (~> 0.20)
6
6
 
7
7
  GEM
@@ -10,7 +10,7 @@ GEM
10
10
  addressable (2.8.0)
11
11
  public_suffix (>= 2.0.2, < 5.0)
12
12
  base64 (0.3.0)
13
- bigdecimal (3.3.1)
13
+ bigdecimal (4.1.1)
14
14
  byebug (11.1.3)
15
15
  coderay (1.1.3)
16
16
  crack (0.4.5)
@@ -19,14 +19,14 @@ GEM
19
19
  diff-lcs (1.5.0)
20
20
  dotenv (3.1.8)
21
21
  hashdiff (1.0.1)
22
- httparty (0.23.2)
22
+ httparty (0.24.2)
23
23
  csv
24
24
  mini_mime (>= 1.0.0)
25
25
  multi_xml (>= 0.5.2)
26
26
  method_source (1.1.0)
27
27
  mini_mime (1.1.5)
28
- multi_xml (0.7.2)
29
- bigdecimal (~> 3.1)
28
+ multi_xml (0.8.1)
29
+ bigdecimal (>= 3.1, < 5)
30
30
  pry (0.15.2)
31
31
  coderay (~> 1.1)
32
32
  method_source (~> 1.0)
@@ -54,6 +54,7 @@ GEM
54
54
  hashdiff (>= 0.4.0, < 2.0.0)
55
55
 
56
56
  PLATFORMS
57
+ arm64-darwin-25
57
58
  x86_64-linux
58
59
 
59
60
  DEPENDENCIES
@@ -0,0 +1,47 @@
1
+ module Brightpearl
2
+ # https://api-docs.brightpearl.com/accounting/customer-payment/index.html
3
+ class CustomerPayment < Resource
4
+ extend Brightpearl::APIOperations::Post
5
+ extend Brightpearl::APIOperations::Delete
6
+
7
+ attr_accessor :payment_id, :transaction_ref, :transaction_code, :payment_method_code,
8
+ :payment_type, :order_id, :currency_id, :currency_code,
9
+ :amount_authorized, :amount_paid, :expires, :payment_date,
10
+ :created_on, :journal_id
11
+
12
+ class << self
13
+ def resource_path
14
+ "accounting-service/customer-payment"
15
+ end
16
+
17
+ # https://api-docs.brightpearl.com/accounting/customer-payment/post.html
18
+ # https://api-docs.brightpearl.com/accounting/customer-payment/delete.html
19
+
20
+ # https://api-docs.brightpearl.com/accounting/customer-payment/search.html
21
+ def search(query_params = {})
22
+ response = send_request(path: "accounting-service/customer-payment-search?#{to_query(query_params)}", method: :get)
23
+ return response.merge({
24
+ records: response[:payload]["response"]["results"].map { |item| CustomerPayment.new(item) },
25
+ })
26
+ end
27
+ end
28
+
29
+ # ARA => API Record Array
30
+ def initialize(ara)
31
+ @payment_id = ara[0]
32
+ @transaction_ref = ara[1]
33
+ @transaction_code = ara[2]
34
+ @payment_method_code = ara[3]
35
+ @payment_type = ara[4]
36
+ @order_id = ara[5]
37
+ @currency_id = ara[6]
38
+ @currency_code = ara[7]
39
+ @amount_authorized = ara[8]
40
+ @amount_paid = ara[9]
41
+ @expires = ara[10]
42
+ @payment_date = ara[11]
43
+ @created_on = ara[12]
44
+ @journal_id = ara[13]
45
+ end
46
+ end
47
+ end
@@ -21,4 +21,5 @@ require 'brightpearl/resources/product_availability'
21
21
  require 'brightpearl/resources/webhook'
22
22
 
23
23
  # Accounting
24
- require 'brightpearl/resources/tax_code'
24
+ require 'brightpearl/resources/tax_code'
25
+ require 'brightpearl/resources/customer_payment'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Brightpearl
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-brightpearl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vicvans20
@@ -154,6 +154,7 @@ files:
154
154
  - lib/brightpearl/resources.rb
155
155
  - lib/brightpearl/resources/contact.rb
156
156
  - lib/brightpearl/resources/contact_custom_field.rb
157
+ - lib/brightpearl/resources/customer_payment.rb
157
158
  - lib/brightpearl/resources/goods_out_note.rb
158
159
  - lib/brightpearl/resources/order.rb
159
160
  - lib/brightpearl/resources/order_custom_field.rb