Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Unintended truncation of State Code on eWay screen and receipt

  • austega
  • austega
  • OFFLINE
  • Posts: 94
  • Thanks: 0
  • Karma: 1
11 years 1 month ago - 11 years 1 month ago #234223 by austega
My client has a Joomla 2.5.14 site with Community Builder 1.9 and Community Builder Subscriptions 3.0.0, with the CB eWay plugin installed as a payment gateway.

The state code for NSW (correctly recorded in Community Builder's user record) appears on the eWay screen and on the eWay receipt as SW. Can you suggest where the translation problem might be?

I have attached some screen shots.




Attachments:
Last edit: 11 years 1 month ago by austega. Reason: Unsuccessful attachments

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago #234233 by krileon
Strange, didn't know CBSubs stored 3 letter states. All except it seams 5 for Australia are 2 letter. The below change should allow 2 and 3 letter to work fine.

IN: /components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/processors/eway/cbpaidsubscriptions.eway.php
ON: Line 504
FROM:
Code:
$addressFields['CustomerState'] = array( substr( $paymentBasket->address_state, -2 ), 2 );
TO:
Code:
$addressFields['CustomerState'] = array( substr( $paymentBasket->address_state, ( strpos( $paymentBasket->address_state, '-' ) + 1 ) ), 3 );


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: austega

Please Log in or Create an account to join the conversation.

  • austega
  • austega
  • OFFLINE
  • Posts: 94
  • Thanks: 0
  • Karma: 1
11 years 1 month ago #234384 by austega
Mmmm... doesn't seemed to have changed anything. I have showing lines 503-5 in case I have stuffed up the change. Can you see anything?
Code:
if ( $paymentBasket->address_state != 'other' ) { $addressFields['CustomerState'] = array( substr( $paymentBasket->address_state, ( strpos( $paymentBasket->address_state, '-' ) + 1 ) ), 3 ); }

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago #234404 by krileon
Looks correct. Don't know what more to advise, sorry. It is maybe being cut short earlier in the payment process. That usage is the same as the below example (note do not use the below code! it is an example usage!).

Code:
cbIsoUtf_substr( substr( 'AU-NSW', ( strpos( 'AU-NSW', '-' ) + 1 ) ), 0, 3 )

Which gives "NSW". So there's no reason for it to cut it short. It maybe due to the value you've sent CBSubs. It should be stored in the database as AU-NSW and not just NSW. Try editing the invoice address and re-selecting then saving it and see if it'll work fine.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • austega
  • austega
  • OFFLINE
  • Posts: 94
  • Thanks: 0
  • Karma: 1
11 years 1 month ago #234478 by austega
This one is proving elusive.

Let me run through my latest test and see if you can spot something:

1. I created a new user and purchased a one day sub, entering NSW along the way.
2. I tried to pay by eWay and the eWay screen (attached) showed SW. I cancelled the eWay payment.
3. I tried then to pay by an offline method (cheque) and (before changing the status to Paid via the backend) the invoice showed NSW.
4. I checked the record in the payment_baskets table and it shows NSW under address_state (not AU-NSW). There is no other field with a state value in it.
5. I checked the user record in comprofiler and it shows NSW under my defined cb_mailstate (not AU-NSW) and NULL under cb_state (my defined field for different residential address) and NULL under cb_subs_invoice_address_state. cb_mailcountry shows Australia, and NULL for the other two relevant country address fields.
6. None of these table values changed when I marked the basket as paid via the backend.

I am guessing the problem lies with the capture and recording of the state info. I have attached screenshots of the CB field settings for the State and Country fields.

Does this help isolate the issue?





Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago #234498 by krileon

4. I checked the record in the payment_baskets table and it shows NSW under address_state (not AU-NSW). There is no other field with a state value in it.

This is where it's messing up. It should be AU-NSW. Try forcing it to AU-NSW and retry.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum