spree_braintree_vzero icon indicating copy to clipboard operation
spree_braintree_vzero copied to clipboard

Truncate Product Description and Name

Open victoria-lo opened this issue 3 years ago • 7 comments

Hi development team,

I am writing regarding some small issues I have encountered when integrating this gem onto Spree. When the product name or description is greater than 127 characters, the Braintree API would reject the transaction and the payment would instantly fail. Can I please request this Braintree v.zero gem to truncate the fields before sending the data to the API?

My team also discovered that the gem did not pass all details to PayPal, so when viewing the invoice, it appears incomplete. Please fix this issue too.

Thank you, I will be happy to provide more details and clarification if you have any.

victoria-lo avatar Aug 31 '21 07:08 victoria-lo

Hi development team,

I am writing regarding some small issues I have encountered when integrating this gem onto Spree. When the product name or description is greater than 127 characters, the Braintree API would reject the transaction and the payment would instantly fail. Can I please request this Braintree v.zero gem to truncate the fields before sending the data to the API?

My team also discovered that the gem did not pass all details to PayPal, so when viewing the invoice, it appears incomplete. Please fix this issue too.

Thank you, I will be happy to provide more details and clarification if you have any.

Hi @victoria-lo

Thanks for pointing out the truncate issue, we'll take care of it 💪

Could you elaborate on the missing data sent to PP? Which fields are getting lost?

damianlegawiec avatar Aug 31 '21 08:08 damianlegawiec

Hi @damianlegawiec

Thanks for the prompt response. The missing fields are: https://developer.paypal.com/braintree/docs/reference/request/transaction/sale/ruby#line_items.description https://developer.paypal.com/braintree/docs/reference/request/transaction/sale/ruby#options.paypal.description

We want to pass custom description in these fields to send in the email when a customer checks out with Braintree or PayPal.

victoria-lo avatar Aug 31 '21 08:08 victoria-lo

Hi @damianlegawiec

Thanks for the prompt response. The missing fields are: https://developer.paypal.com/braintree/docs/reference/request/transaction/sale/ruby#line_items.description https://developer.paypal.com/braintree/docs/reference/request/transaction/sale/ruby#options.paypal.description

We want to pass custom description in these fields to send in the email when a customer checks out with Braintree or PayPal.

victoria-lo avatar Aug 31 '21 08:08 victoria-lo

@damianlegawiec

FYI, My team are currently fixing many of the issues that we found with this gem in relation to submitting payments to PayPal via BrainTree. We will be submitting a patch to you guys shortly (next 1-2 days). Hopefully that will help and reduce the turnaround time on the fix.

In short we will address the following issues:

  1. Product name text limitation (truncate anything > 127 chars), including using double byte character sets
  2. Product description text limitation (truncate anything > 127 chars), including using double byte character sets
  3. Line items are not submitted as part of the sales order
  4. Delivery Fee not submitted as part of the sales order
  5. Promotions not submitted as part of the sales order

Items 3-5 have a flow on effect with the invoice issued by PayPal to the end customer. Currently with the line items missing, the invoice issued by PayPal does not contain the product names.

bjsion avatar Aug 31 '21 11:08 bjsion

@damianlegawiec FYI we have submitted the patch. Let us know if you need more details.

bjsion avatar Sep 10 '21 01:09 bjsion

@damianlegawiec FYI we have submitted the patch. Let us know if you need more details.

Thank you! Just merged it, we need to push out the release to RubyGems which will happen in a day or two

damianlegawiec avatar Sep 10 '21 07:09 damianlegawiec

Awesome, thanks @damianlegawiec

bjsion avatar Sep 10 '21 07:09 bjsion