Add Wallet Type with the connection in User Type#69
Merged
rainerdema merged 8 commits intomasterfrom Mar 13, 2020
Merged
Conversation
4b47222 to
589429c
Compare
e803240 to
6b90eab
Compare
00ca460 to
c0da8c8
Compare
11e1627 to
f659120
Compare
50d8d9d to
206dc4e
Compare
206dc4e to
5b3f64b
Compare
It adds the `PaymentMethod` type, based on `Spree::PaymentMethod`.
It adds the `CreditCard` type, based on `Spree::CreditCard`.
By adding `attr_accessor` instance variables in the `Configuration` class, it's possible to insert configurations through the `configure` method that uses `yield`. In this way, it's not necessary to initialize the attribute but it's possible to set it externally. Ex. ``` SolidusGraphqlApi.configure do |config| config.foo = 'bar' end ```
It adds the `PaymentSource` interface with the common Payment Source fields. And implements the interface in the type that represents the default Solidus Payment Source (Spree::CreditCard). For more information about the implementation of the interfaces: https://github.com/rmosolgo/graphql-ruby/blob/90474a965062820673c0c596ec0e55236b83dfd2/guides/type_definitions/interfaces.md
It's necessary to allow to set the payment sources externally. In this way, when is need to add a new payment method, simply: 1) Add the new type that implements the `Types::Interfaces::PaymentSource` interface; 2) Add the new type to the configuration.
It adds the `WalletPaymentSource` type, based on `Spree::WalletPaymentSource`. The `payment_source` field is indicated through the `Types::Interfaces::PaymentSource` interface and can represent any type of payment source.
It adds the `wallet` connection field, which returns the wallet payment sources associated to the current user.
Using command "bundle exec rake schema:idl"
5b3f64b to
e58bdf7
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quick Info
PaymentMethodType:spree_payment_methodstable;CreditCardType:spree_credit_cardstable;PaymentSourceInterface:PaymentSourceinterface with the common Payment Source fields. And implements the interface in the type that represents the default Solidus Payment Source (Spree::CreditCard);WalletPaymentSourceType:Spree::WalletPaymentSourceclass attributes;WalletPaymentSourceconnection inUserType:walletconnection field, which returns the wallet payment sources associated to the current user. The method that represents this field iswallet_payment_sources.