Giter VIP home page Giter VIP logo

solidus_paypal_braintree's People

Contributors

adammathys avatar aitbw avatar aldesantis avatar alepore avatar blocknotes avatar cbrunsdon avatar cedum avatar dholdren avatar elia avatar fastjames avatar gmacdougall avatar gsmendoza avatar isaacfreeman avatar jacobherrington avatar jhawthorn avatar joeljackson avatar kennyadsl avatar luukveenis avatar mamhoff avatar mustiag avatar pelargir avatar ryanofwoods avatar seand7565 avatar senjai avatar skukx avatar spaghetticode avatar stewart avatar tvdeyen avatar vassalloandrea avatar waiting-for-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

solidus_paypal_braintree's Issues

Products invisible in Admin Order view / Crash in the log

The first real order just came in in my production shop using solidus_paypal_braintree. But in the admin interface, the "Cart" section of the order does not show any products. The products show up on the "cancel items", though.

The error in the log is ActionView::Template::Error (undefined method 'month' for #<SolidusPaypalBraintree::Source:0x007fa5b89db808>)

I attached the trace: month-crash.log

Versions:

gem 'solidus', '2.5.0.beta2'
gem 'deface'
gem 'solidus_auth_devise', '2.1.0'
gem 'solidus_paypal_braintree', github: 'solidusio/solidus_paypal_braintree', branch: :master

Address deprecation warnings

We have a couple of deprecation warnings to handle for Solidus 2.4:

DEPRECATION WARNING: Calling order.update! with no arguments as a way to invoke the OrderUpdater is deprecated, since it conflicts with AR::Base#update! Please use order.recalculate instead

and

DEPRECATION WARNING: Using Spree::Gateway as parent class of payment methods is deprecated. Please use Spree::PaymentMethod::CreditCard for credit card based payment methods or Spree::PaymentMethod for non credit card payment methods instead.

ReferenceError: braintree is not defined

I've got this issue in my js console. It appear when i try load paypal button and credit card form.

return SolidusPaypalBraintree.PromiseShim.convertBraintreePromise(braintree.client.create, [{...
What's wrong? where should i initialize braintree itself?
thanks!

Payments in backend not working

Payments are not working in backend currently:

  1. The JS only inits if previous cards are present
  2. The Braintree client JS is not loaded/included in the backend

Got a fix in my client app, will provide a PR soon.

Amount must be greater than zero. (81531)

Hi,
Firstly thank you for all your hard work and for providing this gem.

I'm having an issue getting the CC form to work, getting the error Amount must be greater than zero. (81531).

I was able to get the Paypal checkout button to work, and that sends out the right amount, but not the hosted fields form.

if I print the order and payment from the controller here’s what I get:

#<Spree::Order:0x00007f7899734718
  id: 10,                          
  number: "R358761214",            
  item_total: 0.75e2
  total: 0.8e2,                                                                    
  state: "payment",                                                  
  adjustment_total: 0.0,                                             
  user_id: 1,                                                        
  completed_at: nil,                                                 
  bill_address_id: 54,                                               
  ship_address_id: 54,                                               
  payment_total: 0.0,                                                
  shipment_state: nil,                                               
  payment_state: nil,                                                
  email: "[email protected]",                                        
  special_instructions: nil,                                         
  created_at: Sat, 15 Sep 2018 01:56:50 UTC +00:00,                  
  updated_at: Sat, 15 Sep 2018 02:34:48 UTC +00:00,                  
  currency: "USD",                                                   
  last_ip_address: "172.19.0.1",                                     
  created_by_id: 1,                                                  
  shipment_total: 0.5e1,                                             
  additional_tax_total: 0.0,                                         
  promo_total: 0.0,                                                  
  channel: "spree",                                                  
  included_tax_total: 0.0,                                           
  item_count: 1,                                                     
  approver_id: nil,                                                  
  approved_at: nil,                                                  
  confirmation_delivered: false,                                     
  guest_token: "mcoOGS6aDN40DwWaR_E_Aw",                             
  canceled_at: nil,                                                  
  canceler_id: nil,                                                  
  store_id: 1,                                                       
  approver_name: nil,                                                
  frontend_viewable: true
>                                           
[#<Spree::Payment:0x00007f78b4e02340                                
  id: 11,                                                           
  amount: 0.0,                                                
  order_id: 10,                                               
  source_type: "SolidusPaypalBraintree::Source",              
  source_id: 9,                                               
  payment_method_id: 2,                                       
  state: "failed",                                            
  response_code: nil,                                         
  avs_response: nil,                                          
  created_at: Sat, 15 Sep 2018 01:59:02 UTC +00:00,           
  updated_at: Sat, 15 Sep 2018 01:59:59 UTC +00:00,           
  number: "6TYGRKFG",                                         
  cvv_response_code: nil,                                     
  cvv_response_message: nil,                                  
  payable_id: nil,                                            
  payable_type: nil>
]

note that amount is 0 for the Spree::Payment object but total: 0.8e2 of the Spree::Order object

the logs also show this:

Redirected to http://localhost:3000/checkout/payment
Filter chain halted as :ensure_valid_state rendered or redirected

any help would be greatly appreciated.

ActiveRecord::SubclassNotFound after trying to save payment gateway record

I'm using solidus 2.4.2, and after installing gem from latest commit:

gem 'solidus_paypal_braintree', :git => 'https://github.com/solidusio/solidus_paypal_braintree.git', :ref => '898eb2cad5438f1540bf7cb636e90a24038ad4fb'

I ran

g = SolidusPaypalBraintree::Gateway.new(
  name: "Braintree",
  preference_source: "braintree_credentials"
)
g.save

and get:

ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Solidus::Gateway::BraintreeGateway'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Spree::PaymentMethod.inheritance_column to use another column for that information.

Inspecting the object I see that g.type is "SolidusPaypalBraintree::Gateway" not Solidus::Gateway::BraintreeGateway

Cancel PayPal order causes 500 error

When the admin tries to cancel an order, a 500 error is thrown. The reason is that SolidusPaypalBraintree::Gateway.cancel expects a response code string and is passed a Spree::Payment instance.

I have created a PR here: #154

Move from the deprecated paypal.js library to the current paypal-checkout.js library?

Background:

https://developers.braintreepayments.com/guides/paypal/vault/javascript/v3

The gem currently uses the old, deprecated paypal braintree library (https://js.braintreegateway.com/web/3.22.1/js/paypal.js). while current documentation only exists for the newer paypal-checkout library (https://js.braintreegateway.com/web/3.22.1/js/paypal-checkout.js).

Is someone at Solidus working on this already? Any insights as to when the deprecated library may actually stop working?

Handle changed address from Paypal

Related to issue #106 "Handle changed address from Apple Pay sheet" - it's possible for the user to select PayPal, bounce off to PayPal and change their address, potentially to an unsupported shipping location.

Creditcard fields are readonly

I have tried to integrate solidus_paypal_braintree to my shop but I can't enter values to the textboxes for creditcard. It works fine for the name but not for the rest.

Does anyone know this problem or had similar issues?

braintree_read_only

Undefined local variable or method `solidus_paypal_braintree'

I get the following error, while running this app when navigating to Admin page:

undefined local variable or method `solidus_paypal_braintree' for #<#Class:0x0000555c44c27b80:0x0000555c46c46218>

App is running inside Docker. Does anyone has any idea?

uninitialized constant AVSResult

I get the error uninitialized constant AVSResult if I use the paypal payment method (sandbox account), after the paypal authorization.
If I change this to use SolidusPaypalBraintree::AVSResult, it's fine.

Unable to set preference source

when I create new payment method:

I can set type to Braintree. However I cannot change "Preference Source" to Braintree_credentials as stated in the readme. the only option available is (custom).

Strip whitespace on payment methods form fields.

When visiting /admin/payment_methods/:id/edit and saving a BraintreeGateway payment method if the user makes an error in copying and pasting by including leading or trailing whitespace on any of the API key fields it isn't stripped.

This causes errors when trying to generate gateway tokens etc and could give the user a wtf moment. I propose either stripping the whitespace on save or adding a validation to check that the keys don't include leading or trailing whitespace.

Yes this happened to me.

Paypal payment return invalid address

Hello everyone! I want to start by thanking everyone who have put effort in this gem.
I am using the latest solidus for an Ecommerce website and my rails version is 5.2.0, ruby is 2.6.

I am being directed to PayPal successfully, but the payment isn’t going through and I’m getting a “address is invalid” error(tried different addresses)
This is the how the error on the server looks like
Started POST "/solidus_paypal_braintree/transactions" for 127.0.0.1 at 2019-02-14 01:45:11 +0200 Processing by SolidusPaypalBraintree::TransactionsController#create as JSON Parameters: {"payment_method_id"=>"7", "transaction"=>{"email"=>"[email protected]", "nonce"=>"436880e7-2097-06c6-5d2b-2ef724c55c91", "payment_type"=>"PayPalAccount", "address_attributes"=>{"first_name"=>"Ahmad", "last_name"=>"Msouty", "address_line_1"=>"1 E Main St", "address_line_2"=>"Suite 403", "city"=>"Chicago", "state_code"=>"Illinois", "zip"=>"60622", "country_code"=>"US"}}} Can't verify CSRF token authenticity. SolidusPaypalBraintree::Gateway Load (0.7ms) SELECT "spree_payment_methods".* FROM "spree_payment_methods" WHERE "spree_payment_methods"."type" IN ('SolidusPaypalBraintree::Gateway') AND "spree_payment_methods"."deleted_at" IS NULL AND "spree_payment_methods"."id" = $1 LIMIT $2 [["id", 7], ["LIMIT", 1]] ↳ /Users/AhmadM/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/bundler/gems/solidus_paypal_braintree-8b1b1c81e1a0/lib/controllers/frontend/solidus_paypal_braintree/transactions_controller.rb:59 Spree::Store Load (0.8ms) SELECT "spree_stores".* FROM "spree_stores" WHERE ("spree_stores"."url" = $1 OR "spree_stores"."default" = $2) ORDER BY "spree_stores"."default" ASC LIMIT $3 [["url", "localhost"], ["default", true], ["LIMIT", 1]] ↳ /Users/AhmadM/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/bundler/gems/solidus_paypal_braintree-8b1b1c81e1a0/lib/controllers/frontend/solidus_paypal_braintree/transactions_controller.rb:16 Spree::Order Load (2.0ms) SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."completed_at" IS NULL AND "spree_orders"."currency" = $1 AND "spree_orders"."guest_token" IS NULL AND "spree_orders"."store_id" = $2 AND "spree_orders"."user_id" IS NULL LIMIT $3 [["currency", "USD"], ["store_id", 1], ["LIMIT", 1]] ↳ /Users/AhmadM/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/bundler/gems/solidus_paypal_braintree-8b1b1c81e1a0/lib/controllers/frontend/solidus_paypal_braintree/transactions_controller.rb:16 Spree::Country Load (1.3ms) SELECT "spree_countries".* FROM "spree_countries" WHERE "spree_countries"."iso" = $1 LIMIT $2 [["iso", "US"], ["LIMIT", 1]] ↳ /Users/AhmadM/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/bundler/gems/solidus_paypal_braintree-8b1b1c81e1a0/app/models/solidus_paypal_braintree/transaction_address.rb:32 Spree::State Load (2.2ms) SELECT "spree_states".* FROM "spree_states" WHERE "spree_states"."country_id" = $1 AND ("spree_states"."name" ILIKE 'Illinois' OR "spree_states"."abbr" ILIKE 'Illinois') ORDER BY "spree_states"."name" ASC LIMIT $2 [["country_id", 233], ["LIMIT", 1]] ↳ /Users/AhmadM/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/bundler/gems/solidus_paypal_braintree-8b1b1c81e1a0/app/models/solidus_paypal_braintree/transaction_address.rb:40 Spree::Country Load (0.2ms) SELECT "spree_countries".* FROM "spree_countries" WHERE "spree_countries"."id" = $1 LIMIT $2 [["id", 233], ["LIMIT", 1]] ↳ /Users/AhmadM/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/bundler/gems/solidus_paypal_braintree-8b1b1c81e1a0/app/models/solidus_paypal_braintree/transaction_import.rb:10 Completed 422 Unprocessable Entity in 21ms (Views: 0.1ms | ActiveRecord: 7.4ms)
I have seen that #195 has had the same problem but didn't see any reply on it yet.
If anyone has faced this issue and could go around it, That would be a huge help.
Thanks!

Documentation improvements

Hi, I found the documentation in the README not very clear about the steps that must be made in order to properly configure the gem on the Solidus application. I think that a better step by step documentation, maybe using the Wiki, could save some time to developers that approach this gem for the first time.

Handle changed address from Apple Pay sheet

It's possible for customers to change the delivery address from the Apple Pay sheet. We should either lock this down to prevent changing the address, or respond to the change by updating the shipment.

The latter can be done in app/assets/javascripts/solidus_paypal_braintree/apple_pay_button.js by giving the session an onshippingcontactselected handler

  var session = new ApplePaySession(SolidusPaypalBraintree.APPLE_PAY_API_VERSION, paymentRequest);

  session.onshippingcontactselected = function (event) {
    // TODO: Update the order
  };

Silent failure after payment

I'm locally testing solidus_paypal_braintree and configured a payment method to use my Braintree sandbox account which in turn is linked to the Paypal sandbox.

I then add a product to my cart and click the "Paypal Check out" button. I log in with my sandbox account, which is based in Germany, and pay for the order. Then, the paypal popup window closes and nothing happens on the cart page.

When running web inspector, I can see that the request to /solidus_paypal_braintree/transactions failed with error 422:

{errors: {Address: ["is invalid"], address: ["spree_state can't be blank"]}, status: 422}

But no error message is displayed to the (fake) customer.

The parameters submitted where:

Processing by SolidusPaypalBraintree::TransactionsController#create as JSON
  Parameters: {"payment_method_id"=>"4", "transaction"=>{"email"=>"[email protected]", "nonce"=>"03485389-9766-0c0a-7883-a095b3e72f0e", "payment_type"=>"PayPalAccount", "address_attributes"=>{"first_name"=>"test", "last_name"=>"buyer", "address_line_1"=>"ESpachstr. 1", "city"=>"Freiburg", "state_code"=>"Empty", "zip"=>"79111", "country_code"=>"DE"}}}

In Germany, states are not relevant/normally not included in addresses. This might trigger the spree_state problem. But this bug report is more about the silent failure. Is there a workaround to at least show the error to the customer?

Invalid transactions, NoMethodError (strip) when cancelling order with invalid payment

I made some test orders with solidus_paypal_braintree and using the Paypal Checkout button. Everything works fine except that some of the orders have at least one invalid transaction under payments in addition to the valid transaction.

When cancelling an order like this, the "find" method in transaction_gateway.rb chokes on these invalid transactions.

Any advice?

Solidus is 2.5.0.beta2

F, [2018-03-14T11:53:56.312363 #9569] FATAL -- : [2ac1b19f-eba8-4f2c-8082-ad4480b9f7a1] NoMethodError (undefined method `strip' for #<Spree::Payment:0x000000095ecb40>):
F, [2018-03-14T11:53:56.312635 #9569] FATAL -- : [2ac1b19f-eba8-4f2c-8082-ad4480b9f7a1]   
F, [2018-03-14T11:53:56.312707 #9569] FATAL -- : [2ac1b19f-eba8-4f2c-8082-ad4480b9f7a1] vendor/bundle/ruby/2.3.0/gems/activemodel-5.1.5/lib/active_model/attribute_methods.rb:432:in `method_missing'
[2ac1b19f-eba8-4f2c-8082-ad4480b9f7a1] vendor/bundle/ruby/2.3.0/gems/braintree-2.82.0/lib/braintree/transaction_gateway.rb:57:in `find'
[2ac1b19f-eba8-4f2c-8082-ad4480b9f7a1] vendor/bundle/ruby/2.3.0/bundler/gems/solidus_paypal_braintree-898eb2cad543/app/models/solidus_paypal_braintree/gateway.rb:177:in `try_void'
[2ac1b19f-eba8-4f2c-8082-ad4480b9f7a1] vendor/bundle/ruby/2.3.0/gems/solidus_core-2.5.0.beta2/app/models/spree/payment/cancellation.rb:29:in `cancel'
[2ac1b19f-eba8-4f2c-8082-ad4480b9f7a1] vendor/bundle/ruby/2.3.0/gems/solidus_core-2.5.0.beta2/app/models/spree/payment/processing.rb:82:in `cancel!'
[2ac1b19f-eba8-4f2c-8082-ad4480b9f7a1] vendor/bundle/ruby/2.3.0/gems/solidus_core-2.5.0.beta2/app/models/spree/order.rb:887:in `block in after_cancel'
[2ac1b19f-eba8-4f2c-8082-ad4480b9f7a1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.5/lib/active_record/relation/delegation.rb:39:in `each'
[2ac1b19f-eba8-4f2c-8082-ad4480b9f7a1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.5/lib/active_record/relation/delegation.rb:39:in `each'
[2ac1b19f-eba8-4f2c-8082-ad4480b9f7a1] vendor/bundle/ruby/2.3.0/gems/solidus_core-2.5.0.beta2/app/models/spree/order.rb:887:in `after_cancel'

Solidus 2.6 requires spree/api/payments/source_views/_paypal_braintree.json.jbuilder

When using solidus 2.6.0rc1, when viewing the shipment tab of an order in the admin in generate an error:

ActionView::Template::Error (Missing partial spree/api/payments/source_views/_paypal_braintree with {:locale=>[:en], :formats=>[:json], :variants=>[], :handlers=>[:jbuilder]}
    34:     payment_source = payment.source.is_a?(Spree::Payment) ? payment.source.source : payment.source
    35: 
    36:     if payment_source
    37:       json.partial!(
    38:         "spree/api/payments/source_views/#{payment.payment_method.partial_name}",
    39:         payment_source: payment_source
    40:       )

It seems to be coming from this change to solidus: solidusio/solidus@6bbe885#diff-44ad61de10149fd0c31668436c9b273b

ActiveRecord::SubclassNotFound

I decided to delete solidus_paypal_braintree gem and used solidus_stripe instead but every time I tried to add a new payment from the Admin my production error logs keeps showing this error and preventing me from adding a new payment gateways:

ActiveRecord::SubclassNotFound (The single-table inheritance mechanism failed to locate the subclass: 'Solidus::Gateway::BraintreeGateway'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Spree::PaymentMethod.inheritance_column to use another column for that information.)

SOLUTION:
> rails console
irb> ActiveRecord::Base.connection.execute("DELETE FROM spree_payment_methods WHERE type='Solidus::Gateway::BraintreeGateway'")

Unable to pass specs locally when developing for gem

bundle install
bundle exec rake

This results in a couple failing specs with the error.

Selenium::WebDriver::Error::WebDriverError:
            unable to connect to chromedriver 127.0.0.1:9515

Possibly need more documentation on developing for this gem in the README

Respect Spree::Config[:address_requires_state] setting in frontend view rendering

Respect the shop admin setting in respect to usage of 'STATE' in address.

I did quite a while a pull request but it seems to got rejected or ignored.
For most European shops 'STATE' is not relevant. Right now the current implementation throws an error. Below find my proposed code change.

var address = { line1: '<%= address.address1 %>', line2: '<%= address.address2 %>', city: '<%= address.city %>', <% if Spree::Config[:address_requires_state] %> state: '<%= address.state.name %>', <% end %> postalCode: '<%= address.zipcode %>', countryCode: '<%= address.country.iso %>', phone: '<%= address.phone %>', recipientName: '<%= "#{address.firstname} #{address.lastname}" %>' }

Add Association for spree user to customer

An association exists from SolidusPaypalBraintree::Customer to Spree.user_class however there is no association on the user to the braintree customer.

Spree.user_class.class_eval do
  has_one :braintree_customer, class_name: 'SolidusPaypalBraintree::Customer'
end

Using Only PayPal

Would like to only be able to process PayPal transactions. Can someone advise whether gem can be used without being approved for Braintree credit card processing?

Missing partial spree/admin/shared/preference_fields/_hash

I just installed the gem and follow the documentation to add a new payment method, but when I first save the method I get this error in the admin:

Missing partial spree/admin/shared/preference_fields/_hash

Yes, the partial is missing. I don't know how to solve this.

Latest gem and solidus v2.4.0

Disable backend CC submit button until ready

JS handling the credit card form on the backend should ensure that the submit button is disabled until it's confirmed that the iframes are set up.

Without this, it's possible to submit the form before it's ready, especially during feature specs.

when only using PayPal invalid address on return

When I'm using PayPal only for checkout everything goes correctly until return then I receive a flash message stating "invalid address" and the order does not go through. Also, noticed in the database for spree_addresses table, the state field is always NULL. Not sure if this is related or not.

below is output from return that fails:

↳ /Users/crypt3ch/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/solidus_paypal_braintree-dbcee4ec1b09/app/controllers/solidus_paypal_braintree/client_tokens_controller.rb:17 Spree::PaymentMethod Exists (1.6ms) SELECT 1 AS one FROMspree_payment_methodsINNER JOINspree_store_payment_methodsONspree_payment_methods.id=spree_store_payment_methods.payment_method_idWHEREspree_payment_methods.deleted_atIS NULL ANDspree_store_payment_methods.store_id= 1 LIMIT 1 ↳ /Users/crypt3ch/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/solidus_paypal_braintree-dbcee4ec1b09/app/controllers/solidus_paypal_braintree/client_tokens_controller.rb:17 (1.0ms) SELECTspree_payment_methods.idFROMspree_payment_methodsINNER JOINspree_store_payment_methodsONspree_payment_methods.id=spree_store_payment_methods.payment_method_idWHEREspree_payment_methods.deleted_atIS NULL ANDspree_store_payment_methods.store_id= 1 ↳ /Users/crypt3ch/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/solidus_paypal_braintree-dbcee4ec1b09/app/controllers/solidus_paypal_braintree/client_tokens_controller.rb:17 SolidusPaypalBraintree::Gateway Load (0.5ms) SELECT spree_payment_methods.* FROM spree_payment_methodsWHEREspree_payment_methods.active= TRUE ANDspree_payment_methods.typeIN ('SolidusPaypalBraintree::Gateway') ANDspree_payment_methods.deleted_atIS NULL ANDspree_payment_methods.id= 4 ORDER BYspree_payment_methods.id` ASC LIMIT 1
↳ /Users/crypt3ch/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/solidus_paypal_braintree-dbcee4ec1b09/app/controllers/solidus_paypal_braintree/client_tokens_controller.rb:18
D, [2018-11-08T15:58:59.116393 #50061] DEBUG -- : [Braintree] [08/Nov/2018 21:58:59 UTC] POST /merchants/yk3qyqt2ygxhm6vx/client_token
D, [2018-11-08T15:58:59.116456 #50061] DEBUG -- : [Braintree]
[Braintree]
[Braintree] 2
[Braintree]

I, [2018-11-08T15:58:59.419133 #50061] INFO -- : [Braintree] [08/Nov/2018 21:58:59 UTC] POST /merchants/yk3qyqt2ygxhm6vx/client_token 201
D, [2018-11-08T15:58:59.419181 #50061] DEBUG -- : [Braintree] [08/Nov/2018 21:58:59 UTC] 201 Created
D, [2018-11-08T15:58:59.419314 #50061] DEBUG -- : [Braintree]
[Braintree]
[Braintree] eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiI1ZjA3MmQ1MGUxM2VjZGM4ZjE2YzA4YjQ3YTVjMzFjOWJjMWI3ODI4MDBlNjc3ZDhiYmI2MTM4ZjA1NjdhNTk5fGNyZWF0ZWRfYXQ9MjAxOC0xMS0wOFQyMTo1ODo1OS4yMzcxNzY0MDIrMDAwMFx1MDAyNm1lcmNoYW50X2lkPXlrM3F5cXQyeWd4aG02dnhcdTAwMjZwdWJsaWNfa2V5PWRiZGZwMm5iOWYyaGdyc3MiLCJjb25maWdVcmwiOiJodHRwczovL2FwaS5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tOjQ0My9tZXJjaGFudHMveWszcXlxdDJ5Z3hobTZ2eC9jbGllbnRfYXBpL3YxL2NvbmZpZ3VyYXRpb24iLCJncmFwaFFMIjp7InVybCI6Imh0dHBzOi8vcGF5bWVudHMuc2FuZGJveC5icmFpbnRyZWUtYXBpLmNvbS9ncmFwaHFsIiwiZGF0ZSI6IjIwMTgtMDUtMDgifSwiY2hhbGxlbmdlcyI6W10sImVudmlyb25tZW50Ijoic2FuZGJveCIsImNsaWVudEFwaVVybCI6Imh0dHBzOi8vYXBpLnNhbmRib3guYnJhaW50cmVlZ2F0ZXdheS5jb206NDQzL21lcmNoYW50cy95azNxeXF0MnlneGhtNnZ4L2NsaWVudF9hcGkiLCJhc3NldHNVcmwiOiJodHRwczovL2Fzc2V0cy5icmFpbnRyZWVnYXRld2F5LmNvbSIsImF1dGhVcmwiOiJodHRwczovL2F1dGgudmVubW8uc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbSIsImFuYWx5dGljcyI6eyJ1cmwiOiJodHRwczovL29yaWdpbi1hbmFseXRpY3Mtc2FuZC5zYW5kYm94LmJyYWludHJlZS1hcGkuY29tL3lrM3F5cXQyeWd4aG02dngifSwidGhyZWVEU2VjdXJlRW5hYmxlZCI6dHJ1ZSwicGF5cGFsRW5hYmxlZCI6dHJ1ZSwicGF5cGFsIjp7ImRpc3BsYXlOYW1lIjoiSklUVCBIb2xkaW5ncyBJbmMuIiwiY2xpZW50SWQiOiJBUUo4dnZ3MjQtMDZRMk5fM3dGWU14R1BaVGZXd3NmejRPMEx5Z1JOQ3lpNmp4a3dVNTRJNzZjZGVQb3MxNEpkWFNQZmhLQjVodUdZaWlSeSIsInByaXZhY3lVcmwiOiJodHRwOi8vZXhhbXBsZS5jb20vcHAiLCJ1c2VyQWdyZWVtZW50VXJsIjoiaHR0cDovL2V4YW1wbGUuY29tL3RvcyIsImJhc2VVcmwiOiJodHRwczovL2Fzc2V0cy5icmFpbnRyZWVnYXRld2F5LmNvbSIsImFzc2V0c1VybCI6Imh0dHBzOi8vY2hlY2tvdXQucGF5cGFsLmNvbSIsImRpcmVjdEJhc2VVcmwiOm51bGwsImFsbG93SHR0cCI6dHJ1ZSwiZW52aXJvbm1lbnROb05ldHdvcmsiOmZhbHNlLCJlbnZpcm9ubWVudCI6Im9mZmxpbmUiLCJ1bnZldHRlZE1lcmNoYW50IjpmYWxzZSwiYnJhaW50cmVlQ2xpZW50SWQiOiJtYXN0ZXJjbGllbnQzIiwiYmlsbGluZ0FncmVlbWVudHNFbmFibGVkIjp0cnVlLCJtZXJjaGFudEFjY291bnRJZCI6ImppdHRob2xkaW5nc2luYyIsImN1cnJlbmN5SXNvQ29kZSI6IlVTRCJ9LCJtZXJjaGFudElkIjoieWszcXlxdDJ5Z3hobTZ2eCIsInZlbm1vIjoib2ZmIn0=
[Braintree]

Completed 200 OK in 573ms (Views: 0.6ms | ActiveRecord: 8.7ms)`

Save and Continue button disabled for credit card payments - Rails 5.2.0

When using this gem in a project with Rails 5.2.0, I noticed that the "Save and Continue" button to submit credit card information using the Braintree hosted fields was disabled. This applies to the credit card payment method.

I tracked the issue to a call to $.rails.enableFormElement. This method likely exists for people that are using older versions of Rails and jquery-ujs. However, at Rails 5.1.0, jquery-ujs was "adapted" into the rails core as rails-ujs. rails-ujs has a slightly different way of enabling elements.

Thanks,
Jeff

Ambiguous behavior for generate token method

The SolidusPaypalBraintree::Gateway#generate_token method has ambiguous behavior. If token generation is disabled it returns a string acting as a "error message" as described in the documentation. If the generation is enabled it also returns a string.

https://github.com/solidusio/solidus_paypal_braintree/blob/master/app/models/solidus_paypal_braintree/gateway.rb#L236

Rather than returning a string which is also expected in on success, possibly raise an error with that string as a message. Then the app can handle that error in a way it sees fit. Otherwise it is not clear whether gernation is enabled or disabled unless using string comparison at every check

Page refreshes from payment -> confirm step

On the /checkout/payment page, after entering credit card details and upon clicking save and continue, the page simply refreshes. This is only a problem while testing live on heroku, while it works fine on my local machine. Can anyone point me in the right direction?

NoMethodError in Spree::Checkout#edit when address.state == nil

I'm testing the checkout with Braintree payment and running into this error as a German test customer. The state field of the address is nil, which is valid in this case (German addresses don't have a state):

`Showing /home/mntmn/.bundle/ruby/2.3.0/solidus_paypal_braintree-898eb2cad543/lib/views/frontend/spree/checkout/payment/_paypal_braintree.html.erb where line #40 raised:

undefined method name' for nil:NilClass

The offending line is:

state: '<%= address.state.name %>',

New Braintree Customer created for every payment method created

Similar to this issue here: solidusio/solidus_braintree#56

When creating a new payment method, @gateway.generate_token will create a nonce for a brand new customer. We should try to keep a one to one relationship between Braintree customers and Spree Users.

This may require another field or table to keep track of the gateway customer id. Then when requesting a token from braintree something like the following should be called if a user is logged in.

braintree.client_token.generate customer_id: user.gateway_customer_id

This ensures that the new payment method is added to the same braintree customer as all others in the past.

No route if the engine is not mounted in Solidus path

I f I have solidus at /store for example, the default installer mounts the gem in /solidus_paypal_braintree.
In the js it doesn't find the right url to submit, it expects to be /store/solidus_paypal_braintree, because it uses the Spree helper Spree.pathFor() here.
I solved mounting the engine in /store/solidus_paypal_braintree, maybe it could be useful to write a note in the README, or to change the default installer to mount the engine under the Solidus mount point, I don't know yet.

Can't render JSON about an order as SolidusPaypalBraintree::Source doesn't have a `expiration_month` method

solidus v2.4.2
solidus_paypal_braintree rev: ea093fa

On the http://localhost:3000/admin/orders/<order>/cart page, the js requests json about the order from the API at: http://localhost:3000/api/orders/<order>

This causes a 500 response, in the logs I get:

ActionView::Template::Error (undefined method `expiration_month' for #<Braintree::PayPalAccount:0x007f2ec6b59180>):
    25:   json.payment_method { json.(payment.payment_method, :id, :name) }
    26:   json.source do
    27:     if payment.source
    28:       json.(payment.source, *payment_source_attributes)
    29: 
    30:       if @current_user_roles.include?("admin")
    31:         json.(payment.source, :gateway_customer_profile_id, :gateway_payment_profile_id)

From looking at the code it looks like it's trying to call expiration_month on SolidusPaypalBraintree::Source , this method delegates the call to a Braintree::PayPalAccount object.

I'm guessing that an 'expiration_month' or date, doesn't make sense in the context of a paypal account so either it shouldn't ask for it - or - there should be method that at least returns null or something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.