nova-pay-grpc 1.0.0 → 1.1.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: 3ea929047d15cce58bde5426cc965ce9b90ca634ff5caa48fd0374c634a36eab
4
- data.tar.gz: 70b6b4a208019b46c070f40f384945bab9f74bb37ae986a5a011256870a3c603
3
+ metadata.gz: 85a1e178605ac02155a951fd37aff0b21d9698a438d1a57c3a70238a6e3cd936
4
+ data.tar.gz: 034e55e56daef19dd8f782ae0af04fc4021adab3686ffcff090c0ad90b5bf624
5
5
  SHA512:
6
- metadata.gz: df2a394158b4e4d6fb12d83e26f81122b3df09f3a21d276b921daf840150d871033fde967100e4d10f05e34b3cb28dd7535412cc746dfe0c9cc2be963b927a2a
7
- data.tar.gz: 7f5df26fc0e0390686c0d056df7ddc5788bf2712a0d11498661f9591f5802ec22f9a761586ddc742f8e27f46e31ab3fe4ce4fec7de6f4f0d09eec2ba62e95993
6
+ metadata.gz: 3dcdc1136a9fd0e96d83909571b127a080e874839839bf862f03c243342c634a752e5559e11bb69e3a40f48145dd53de1fd30aaf3666e68c4b92589b2c92a2e9
7
+ data.tar.gz: 715577897905450a8c02459956b076631b70e9cbe0d669deb0bbfb7a1124b9d04a7135d3dccbf2e14556a90e6aca18bf7fd94c7a491788b0765270490c99fb0a
data/CHANGELOG.md CHANGED
@@ -5,11 +5,21 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## Unreleased
8
+ ## [Unreleased]
9
9
 
10
- ## 1.0.0 - 2026-01-06
10
+ ## [1.1.0] - 2026-01-15
11
+
12
+ ### Added
13
+
14
+ - `PaymentPlansService` with `list` RPC to fetch available payment plans.
15
+
16
+ ## [1.0.0] - 2026-01-06
11
17
 
12
18
  ### Added
13
19
 
14
20
  - Initial release of the `nova-pay-grpc` gem, providing shared gRPC proto definitions and Ruby stubs for Nova Pay services.
15
21
  - `CheckoutService` with `perform` RPC for handling checkout requests.
22
+
23
+ [unreleased]: https://github.com/coyosoftware/nova-pay-grpc/compare/v1.1.0...HEAD
24
+ [1.1.0]: https://github.com/coyosoftware/nova-pay-grpc/compare/v1.0.0...v1.1.0
25
+ [1.0.0]: https://github.com/coyosoftware/nova-pay-grpc/releases/tag/v1.0.0
data/README.md CHANGED
@@ -71,6 +71,35 @@ rescue GRPC::BadStatus => e
71
71
  end
72
72
  ```
73
73
 
74
+ You can also use the `PaymentPlansService` to list available payment plans:
75
+
76
+ ```ruby
77
+ require 'nova/pay/v1/payment_plans_services_pb'
78
+
79
+ # Create a stub for the PaymentPlansService
80
+ stub = Nova::Pay::V1::PaymentPlansService::Stub.new('localhost:50051', :this_channel_is_insecure)
81
+
82
+ # Create a request object
83
+ request = Nova::Pay::V1::PaymentPlansRequest.new(
84
+ checkout_page_id: 'your-checkout-page-id',
85
+ amount_in_cents: 1000,
86
+ products: [
87
+ Nova::Pay::V1::Product.new(
88
+ id: 1,
89
+ quantity: 1
90
+ )
91
+ ]
92
+ )
93
+
94
+ # Make the RPC call
95
+ begin
96
+ response = stub.list(request)
97
+ p response
98
+ rescue GRPC::BadStatus => e
99
+ puts "Error: #{e.details}"
100
+ end
101
+ ```
102
+
74
103
  ## Contributing
75
104
 
76
105
  Bug reports and pull requests are welcome on GitHub at https://github.com/coyosoftware/nova-pay-grpc.
@@ -3,7 +3,7 @@
3
3
  module Nova
4
4
  module Pay
5
5
  module Grpc
6
- VERSION = "1.0.0"
6
+ VERSION = "1.1.0"
7
7
  end
8
8
  end
9
9
  end
data/lib/nova/pay/grpc.rb CHANGED
@@ -8,3 +8,6 @@ require 'google/protobuf/well_known_types'
8
8
 
9
9
  require "nova/pay/v1/checkout_pb"
10
10
  require "nova/pay/v1/checkout_services_pb"
11
+
12
+ require "nova/pay/v1/payment_plans_pb"
13
+ require "nova/pay/v1/payment_plans_services_pb"
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: nova/pay/v1/payment_plans.proto
4
+
5
+ require 'google/protobuf'
6
+
7
+
8
+ descriptor_data = "\n\x1fnova/pay/v1/payment_plans.proto\x12\x0bnova.pay.v1\"\x83\x01\n\x13PaymentPlansRequest\x12\x18\n\x10\x63heckout_page_id\x18\x01 \x01(\t\x12\x19\n\x0c\x61mount_cents\x18\x02 \x01(\x03H\x00\x88\x01\x01\x12&\n\x08products\x18\x03 \x03(\x0b\x32\x14.nova.pay.v1.ProductB\x0f\n\r_amount_cents\"\'\n\x07Product\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x10\n\x08quantity\x18\x02 \x01(\x05\"\\\n\x14PaymentPlansResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x33\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32%.nova.pay.v1.PaymentPlansResponseData\"\xa3\x01\n\x18PaymentPlansResponseData\x12-\n\tbank_slip\x18\x01 \x03(\x0b\x32\x1a.nova.pay.v1.PaymentOption\x12/\n\x0b\x63redit_card\x18\x02 \x03(\x0b\x32\x1a.nova.pay.v1.PaymentOption\x12\'\n\x03pix\x18\x03 \x03(\x0b\x32\x1a.nova.pay.v1.PaymentOption\"\xe2\x01\n\rPaymentOption\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0e\n\x06number\x18\x03 \x01(\x05\x12\x13\n\x0bvalue_cents\x18\x04 \x01(\x03\x12\x12\n\nfine_cents\x18\x05 \x01(\x03\x12\x16\n\x0e\x66ine_tax_cents\x18\x06 \x01(\x03\x12(\n\tfine_type\x18\x07 \x01(\x0e\x32\x15.nova.pay.v1.FineType\x12\x1b\n\x13late_interest_cents\x18\x08 \x01(\x03\x12\x1f\n\x17late_interest_tax_cents\x18\t \x01(\x03*%\n\x08\x46ineType\x12\t\n\x05PRICE\x10\x00\x12\x0e\n\nPERCENTAGE\x10\x01\x32\x62\n\x13PaymentPlansService\x12K\n\x04list\x12 .nova.pay.v1.PaymentPlansRequest\x1a!.nova.pay.v1.PaymentPlansResponseb\x06proto3"
9
+
10
+ pool = ::Google::Protobuf::DescriptorPool.generated_pool
11
+ pool.add_serialized_file(descriptor_data)
12
+
13
+ module Nova
14
+ module Pay
15
+ module V1
16
+ PaymentPlansRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("nova.pay.v1.PaymentPlansRequest").msgclass
17
+ Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("nova.pay.v1.Product").msgclass
18
+ PaymentPlansResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("nova.pay.v1.PaymentPlansResponse").msgclass
19
+ PaymentPlansResponseData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("nova.pay.v1.PaymentPlansResponseData").msgclass
20
+ PaymentOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("nova.pay.v1.PaymentOption").msgclass
21
+ FineType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("nova.pay.v1.FineType").enummodule
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,26 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: nova/pay/v1/payment_plans.proto for package 'nova.pay.v1'
3
+
4
+ require 'grpc'
5
+ require 'nova/pay/v1/payment_plans_pb'
6
+
7
+ module Nova
8
+ module Pay
9
+ module V1
10
+ module PaymentPlansService
11
+ class Service
12
+
13
+ include ::GRPC::GenericService
14
+
15
+ self.marshal_class_method = :encode
16
+ self.unmarshal_class_method = :decode
17
+ self.service_name = 'nova.pay.v1.PaymentPlansService'
18
+
19
+ rpc :list, ::Nova::Pay::V1::PaymentPlansRequest, ::Nova::Pay::V1::PaymentPlansResponse
20
+ end
21
+
22
+ Stub = Service.rpc_stub_class
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,48 @@
1
+ syntax = "proto3";
2
+
3
+ package nova.pay.v1;
4
+
5
+ service PaymentPlansService {
6
+ rpc list (PaymentPlansRequest) returns (PaymentPlansResponse);
7
+ }
8
+
9
+ enum FineType {
10
+ PRICE = 0;
11
+ PERCENTAGE = 1;
12
+ }
13
+
14
+ message PaymentPlansRequest {
15
+ string checkout_page_id = 1;
16
+ optional int64 amount_cents = 2;
17
+ repeated Product products = 3;
18
+ }
19
+
20
+ message Product {
21
+ int64 id = 1;
22
+ int32 quantity = 2;
23
+ }
24
+
25
+ message PaymentPlansResponse {
26
+ bool success = 1;
27
+ PaymentPlansResponseData data = 2;
28
+ }
29
+
30
+ message PaymentPlansResponseData {
31
+ repeated PaymentOption bank_slip = 1;
32
+ repeated PaymentOption credit_card = 2;
33
+ repeated PaymentOption pix = 3;
34
+ }
35
+
36
+ message PaymentOption {
37
+ string name = 1;
38
+ string id = 2;
39
+ int32 number = 3;
40
+ int64 value_cents = 4;
41
+
42
+ int64 fine_cents = 5;
43
+ int64 fine_tax_cents = 6;
44
+ FineType fine_type = 7;
45
+
46
+ int64 late_interest_cents = 8;
47
+ int64 late_interest_tax_cents = 9;
48
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nova-pay-grpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coyô Software
@@ -51,7 +51,10 @@ files:
51
51
  - lib/nova/pay/grpc/version.rb
52
52
  - lib/nova/pay/v1/checkout_pb.rb
53
53
  - lib/nova/pay/v1/checkout_services_pb.rb
54
+ - lib/nova/pay/v1/payment_plans_pb.rb
55
+ - lib/nova/pay/v1/payment_plans_services_pb.rb
54
56
  - proto/nova/pay/v1/checkout.proto
57
+ - proto/nova/pay/v1/payment_plans.proto
55
58
  - sig/nova/pay/grpc.rbs
56
59
  homepage: https://github.com/coyosoftware/nova-pay-grpc
57
60
  licenses: []