-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 385f811 Author: Ivan Novosad <[email protected]> Date: Thu Jan 23 17:21:04 2025 +0100 feat(manual-payments): Add payment resolver, and filter by customer external_id commit 00781e2 Author: Ivan Novosad <[email protected]> Date: Thu Jan 23 14:55:38 2025 +0100 feat(manual-payments): Refactor payment model commit 07af881 Author: Ivan Novosad <[email protected]> Date: Wed Jan 22 09:34:38 2025 +0100 feat(manual-payments): Add more resolver specs commit b4fee07 Author: Ivan Novosad <[email protected]> Date: Wed Jan 22 08:52:04 2025 +0100 feat(manual-payments): Add premium integration types enum spec commit ac22ef4 Author: Ivan Novosad <[email protected]> Date: Tue Jan 21 17:31:14 2025 +0100 feat(manual-payments): Add positive_due_amount to invoices resolver commit 7c2b00f Author: Ivan Novosad <[email protected]> Date: Tue Jan 21 15:26:02 2025 +0100 feat(manual-payments): Add customer to Payment object commit 1087f64 Author: Ivan Novosad <[email protected]> Date: Mon Jan 20 17:36:59 2025 +0100 feat(manual-payments): Add paymentProviderType to Payment object commit ba5c623 Author: Ivan Novosad <[email protected]> Date: Mon Jan 20 11:14:37 2025 +0100 feat(manual-payments): Fix rubocop warnings and specs commit b890f28 Author: Miguel Pinto <[email protected]> Date: Fri Jan 17 11:27:16 2025 +0000 feat: merge pr commit 65f0c61 Author: Ivan Novosad <[email protected]> Date: Fri Jan 3 11:45:57 2025 +0100 feat(manual-payments): WIP - Add GQL enums, inputs and types commit 8e9e11d Author: Vincent Pochet <[email protected]> Date: Fri Jan 24 16:46:44 2025 +0100 fix(payment): Ensure payment status is checkd as a string (#3104) ## Description This PR is related to #3088 it ensure that none of the payment `status`, `payable_payment_status` and related payables's `payment_status` are updated if an unknown status is received from a payment provider commit ec8ef1f Author: Anna Velentsevich <[email protected]> Date: Fri Jan 24 16:15:29 2025 +0100 Fix(rev-share): fix bugs found during QA (#3098) ## Context There were small issues found during the QA ## Description Fixed invoice numbering switching from customer-based to per-organization Do not allow edit customers via API if they are not editable commit 4bbb63b Author: Anna Velentsevich <[email protected]> Date: Fri Jan 24 15:30:06 2025 +0100 add rescue when failing to update charge filters and charges (#3103) ## Context When an organization have charges or charge filters with wrong properties, the migration fails and it's hard to indicate what exactly went wrong ## Description Added rescue to migration that fixes double properties for charges and charges filters commit 3881346 Author: brunomiguelpinto <[email protected]> Date: Fri Jan 24 13:56:37 2025 +0000 fix: filter payments based on visible invoices (#3102) ## Context This changes the scope `for_organization` in the `Payment` model, allowing payments only for visible invoices to be considered. ## Description only let the Invoices with statuses defined in `Invoice::VISIBLE_STATUS`. commit 035cea3 Author: Jérémy Denquin <[email protected]> Date: Fri Jan 24 12:14:33 2025 +0100 fix(tasks): Fix signup task env var (#3101)
- Loading branch information
1 parent
fb2f4a6
commit f5a225c
Showing
46 changed files
with
1,563 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module Mutations | ||
module Payments | ||
class Create < BaseMutation | ||
include AuthenticableApiUser | ||
include RequiredOrganization | ||
|
||
REQUIRED_PERMISSION = "payments:create" | ||
|
||
graphql_name "CreatePayment" | ||
description "Creates a manual payment" | ||
|
||
input_object_class Types::Payments::CreateInput | ||
type Types::Payments::Object | ||
|
||
def resolve(**args) | ||
result = ::ManualPayments::CreateService.call(organization: current_organization, params: args) | ||
result.success? ? result.payment : result_error(result) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
module Resolvers | ||
class PaymentResolver < Resolvers::BaseResolver | ||
include AuthenticableApiUser | ||
include RequiredOrganization | ||
|
||
REQUIRED_PERMISSION = 'payments:view' | ||
|
||
description 'Query a single Payment' | ||
|
||
argument :id, ID, required: true, description: 'Uniq ID of the payment' | ||
|
||
type Types::Payments::Object, null: true | ||
|
||
def resolve(id:) | ||
Payment.for_organization(current_organization).find(id) | ||
rescue ActiveRecord::RecordNotFound | ||
not_found_error(resource: 'payment') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
module Resolvers | ||
class PaymentsResolver < Resolvers::BaseResolver | ||
include AuthenticableApiUser | ||
include RequiredOrganization | ||
|
||
REQUIRED_PERMISSION = "payments:view" | ||
|
||
description "Query payments of an organization" | ||
|
||
argument :external_customer_id, ID, required: false | ||
argument :invoice_id, ID, required: false | ||
argument :limit, Integer, required: false | ||
argument :page, Integer, required: false | ||
|
||
type Types::Payments::Object.collection_type, null: false | ||
|
||
def resolve(page: nil, limit: nil, invoice_id: nil, external_customer_id: nil) | ||
result = PaymentsQuery.call( | ||
organization: current_organization, | ||
filters: { | ||
invoice_id:, | ||
external_customer_id: | ||
}, | ||
pagination: { | ||
page:, | ||
limit: | ||
} | ||
) | ||
|
||
result.payments | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
module Types | ||
module Payables | ||
class Object < Types::BaseUnion | ||
graphql_name 'Payable' | ||
|
||
possible_types Types::Invoices::Object, Types::PaymentRequests::Object | ||
|
||
def self.resolve_type(object, _context) | ||
case object.class.to_s | ||
when 'Invoice' | ||
Types::Invoices::Object | ||
when 'PaymentRequest' | ||
Types::PaymentRequests::Object | ||
else | ||
raise "Unexpected payable type: #{object.inspect}" | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Types | ||
module Payments | ||
class CreateInput < Types::BaseInputObject | ||
graphql_name "CreatePaymentInput" | ||
|
||
argument :amount_cents, GraphQL::Types::BigInt, required: true | ||
argument :created_at, GraphQL::Types::ISO8601DateTime, required: true | ||
argument :invoice_id, ID, required: true | ||
argument :reference, String, required: true | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
module Types | ||
module Payments | ||
class Object < Types::BaseObject | ||
graphql_name "Payment" | ||
|
||
field :id, ID, null: false | ||
|
||
field :amount_cents, GraphQL::Types::BigInt, null: false | ||
field :amount_currency, Types::CurrencyEnum, null: false | ||
|
||
field :customer, Types::Customers::Object, null: false | ||
field :payable, Types::Payables::Object, null: false | ||
field :payable_payment_status, Types::Payments::PayablePaymentStatusEnum, null: true | ||
field :payment_provider_type, Types::PaymentProviders::ProviderTypeEnum, null: true | ||
field :payment_type, Types::Payments::PaymentTypeEnum, null: false | ||
field :provider_payment_id, GraphQL::Types::String, null: true | ||
field :reference, GraphQL::Types::String, null: true | ||
|
||
field :created_at, GraphQL::Types::ISO8601DateTime, null: false | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module Types | ||
module Payments | ||
class PayablePaymentStatusEnum < Types::BaseEnum | ||
Payment::PAYABLE_PAYMENT_STATUS.each do |type| | ||
value type | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module Types | ||
module Payments | ||
class PaymentTypeEnum < Types::BaseEnum | ||
Payment::PAYMENT_TYPES.keys.each do |type| | ||
value type | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,10 @@ def environment | |
:test | ||
end | ||
end | ||
|
||
def payment_type | ||
'adyen' | ||
end | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,10 @@ def environment | |
:sandbox | ||
end | ||
end | ||
|
||
def payment_type | ||
'gocardless' | ||
end | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.