paypal expresscheckout in oscommerce get this error The totals of the cart item amounts do not match order amounts - oscommerce

I am working with the PayPal express checkout and am having issues in discount code. Below are my parameters:
PAYMENTREQUEST_0_CURRENCYCODE=CAD
&L_PAYMENTREQUEST_0_NAME0=test
&L_PAYMENTREQUEST_0_NUMBER0=
&L_PAYMENTREQUEST_0_AMT0=125.00
&L_PAYMENTREQUEST_0_QTY0=1
&PAYMENTREQUEST_0_ITEMAMT=125.00
&PAYMENTREQUEST_0_TAXAMT=0.00
&PAYMENTREQUEST_0_SHIPPINGAMT=0.00
&PAYMENTREQUEST_0_SHIPDISCAMT=0.00
&PAYMENTREQUEST_0_HANDLINGAMT=12.50
&PAYMENTREQUEST_0_AMT=112.50
Its returning the following error
Array ( [TIMESTAMP] => 2013-09-02T08:45:26Z [CORRELATIONID] => b5acd1c6276c4
[ACK] => Failure
[VERSION] => 85.0
[BUILD] => 7539191
[L_ERRORCODE0] => 10413
[L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details.
[L_LONGMESSAGE0] => The totals of the cart item amounts do not match order amounts. [L_SEVERITYCODE0] => Error )
Can anyone help?

PAYMENTREQUEST_0_CURRENCYCODE=CAD
&L_PAYMENTREQUEST_0_NAME0=test
&L_PAYMENTREQUEST_0_NUMBER0=
&L_PAYMENTREQUEST_0_AMT0=125.00
&L_PAYMENTREQUEST_0_QTY0=1
&PAYMENTREQUEST_0_ITEMAMT=125.00
&PAYMENTREQUEST_0_TAXAMT=0.00
&PAYMENTREQUEST_0_SHIPPINGAMT=0.00
&PAYMENTREQUEST_0_SHIPDISCAMT=0.00
&PAYMENTREQUEST_0_HANDLINGAMT=12.50
&PAYMENTREQUEST_0_AMT=137.50

Related

Regex rich the limit?

I have some code to routing my url (every user has is own addres like: domain.com/username)
The problem is I get some errors because my regex is too large(?)
How can I solve this?
$user_nick=user::getAllUserNick();//this return string like: username1|username2 etc.
$user_url_firstpage = new Zend_Controller_Router_Route_Regex(
'('.$user_nick.'+)',
array('controller' => 'ads', 'action' => 'category', 'page' => 1), array(1 => 'nick', 2 => 'page'), '%s/'
);
error log:
[28-Sep-2020 07:18:10 UTC] PHP Warning: preg_match(): Compilation failed: regular expression is too large at offset 83837 in D:\netbeans-projects\mysite\library\Zend\Controller\Router\Route\Regex.php on line 83

Where is location of renderView function that used in Opencart Journal 3 theme Quick Checkout controller

I am trying to auto add a specific product to cart when visitors added an other specific product to cart on Opencart 3.0.2.0 and Journal 3 theme in Quick Checkout.
I could do it in cart.twig but I couldn't do it in Quick Checkout because I can't find where is renderView function that rendering cart_block in checkout controller.
Related code is bellow;
This code from catalog>controller>journal3>checkout.php.
From line 204 to 215.
$data['cart_block'] = $this->renderView('journal3/checkout/cart', array(
'column_image' => $this->language->get('column_image'),
'column_name' => $this->language->get('column_name'),
'column_model' => $this->language->get('column_model'),
'column_quantity' => $this->language->get('column_quantity'),
'column_price' => $this->language->get('column_price'),
'column_total' => $this->language->get('column_total'),
'text_recurring_item' => $this->language->get('text_recurring_item'),
'button_update' => $this->language->get('button_update'),
'button_remove' => $this->language->get('button_remove'),
'error_warning' => $this->language->get('error_stock'),
));
One simple but not optimal solution can be like this:
Go to catalog/controller/checkout/cart.php, find the add method public function add() { then in that add method find the following line of code:
$this->cart->add($this->request->post['product_id'], $quantity, $option, $recurring_id);
Just below that line of code, you can add the following line of code:
if($this->request->post['product_id'] ==43){
$this->cart->add('28',1);
}
** Please make changes as per your requirement. The above code means if product id 43 is added then product id 28 gets added automatically, but keep in mind if someone adds two 43 then there will be two 28 products.

Oracle APEX how do I populate cascading select lists without page submit

I have an APEX page with a few select lists, using collections to save and refresh the page. The "System" select list is dependent upon the "Brand" selected value. I have the page working how I want, but it requires the page to be submitted after a "Brand" value is chosen so that the "System" lov is properly populated.
I am trying to make it so that when the "Brand" value is changed or selected, the "System" lov is changed immediately without needing a page submit. I've been reading and it seems you need to use jQuery and AJAX callback, but I just cannot get my head around that and make any progress.
Hoping someone can help me. I am certainly a rookie with web coding in general.
Added: my local APEX version is 5.0.3.
https://apex.oracle.com/pls/apex/f?p=4550
Workspace: UNCLE_BUCK_WS
User: developer1
Pwd: developer1
Application 83513 - Tooth Selector
Page 5: Page that works using submit page
Page 6: Page I started trying to use jQuery, but did not get very far
Added:
There is no cascading LOV for manual tabular form. See my region definition below. Hoping someone can still help, maybe copy my page and make the required changes.
select apex_item.select_list_from_query(p_idx => 1,
p_value => n001,
p_query => 'SELECT tooth_number display_value, tooth_number return_value FROM psp_teeth WHERE tooth_numbering_method = :P5_TOOTH_NUMBER_METHOD
ORDER BY tooth_number',
p_null_text => '- Choose Tooth -')
|| apex_item.hidden(p_idx => 50, p_value => seq_id) Tooth_Number
, apex_item.select_list_from_lov(p_idx => 10, p_value => c001, p_lov => 'BRAND', p_null_text => '- Choose Brand -') brand
, apex_item.select_list_from_lov(p_idx => 12, p_value => c002, p_lov => 'TYPE', p_null_text => '- Choose Type -') type
, apex_item.select_list (p_idx => 14,
p_value => c003,
p_list_values => CASE c001
WHEN 'BRAND_A' THEN 'SYSTEM_A1,SYSTEM_A2'
WHEN 'BRAND_B' THEN 'SYSTEM_B1,SYSTEM_B2'
END,
p_show_null => 'YES',
p_null_text => '- Choose System -') system
, apex_item.checkbox2(p_idx => 16, p_value => seq_id, p_checked_values => CASE c004 WHEN '1' THEN seq_id END) delete_row
from apex_collections
where collection_name = 'TEMPCOL'
Don't use tabular forms, they are archaic! Use an Interactive Grid instead, which supports cascading LOVs declaratively (you don't need to write any code, just specify that column TYPE cascades from column BRAND):
See page 9 in your app where I have created one (I didn't bother creating the master region). My LOV definition for TYPE is a bit cumbersome, you may be able to improve on that (i.e. get back to the "dynamic static" LOV that you had before).

Missing creative spec facebook

I'm trying to create an ad using the php sdk.
I can create the campaign, targeting, adset, and the creative (which returns a creative_id that I can validate using the graph explorer).
But when I finally run the code to create the ad itself, I get an exception that looks like this:
"error_user_title" => "Missing creative spec"
"error_user_msg" => "No creative spec found for given adgroup."
I just can't find anything referring to this error.
Below is the relevant portion of my code:
$link_data = new AdCreativeLinkData();
$link_data->setData(array(
AdCreativeLinkDataFields::LINK => $route,
AdCreativeLinkDataFields::MESSAGE => $petition_statement,
AdCreativeLinkDataFields::NAME => $banner_title,
AdCreativeLinkDataFields::IMAGE_HASH => $image_hash,
));
$object_story_spec = new AdCreativeObjectStorySpec();
$object_story_spec->setData(array(
AdCreativeObjectStorySpecFields::PAGE_ID => $pageid,
AdCreativeObjectStorySpecFields::INSTAGRAM_ACTOR_ID=>$instagram_id,
AdCreativeObjectStorySpecFields::LINK_DATA=>$link_data
));
$creative = new AdCreative(null,$account_id);
$creative->setData(array(
AdCreativeFields::TITLE => $banner_title,
AdCreativeFields::BODY => $banner_subtitle,
AdCreativeFields::IMAGE_HASH => $image_hash,
AdCreativeFields::OBJECT_TYPE => 'SHARE',
AdCreativeFields::OBJECT_STORY_SPEC=>$object_story_spec
));
$creative->create();
echo 'Creative ID: '.$creative->id . "\n";
$ad = new Ad(null, $account_id);
$ad->setData(array(
AdFields::NAME => $short_name,
AdFields::ADSET_ID => $adset->id,
AdFields::CREATIVE => $creative,
AdFields::TRACKING_SPECS => array(array(
'action.type' => 'offsite_conversion',
'fb_pixel' => $pixel_code,
))
));
$ad->create(array(Ad::STATUS_PARAM_NAME => Ad::STATUS_PAUSED));
Appreciate any help.
I've often said that the only skill you need to be a successful developer is the ability to agonize over a problem for days, read through source code, google it, refactor, rewrite and then realize you forgot something fucking obvious.
AdFields::CREATIVE => $creative,
should read
AdFields::CREATIVE => $creative->id,
But the ability to persist isn't the skill you need. The real skill is to somehow resist the overwhelming urge to chuck your computer out the window and do something productive with your life instead.
After hours of testing it seems Trevor's answer is incorrect. This is the right syntax:
AdFields::CREATIVE => array('creative_id'=>$creative->id)

Google Charts Axis Label Issues Line Chart

I am creating google charts to show Google Analytics data from the past 7 days. I have an issue with the X-Axis labels stacking on top of each other when I have certain data (or at least that's all I can tell is different.)
I am generating the API call using this gem: https://github.com/mattetti/googlecharts and I've looked at what each part of the URL is doing and can't find the issue, but I'm sure I'm missing something.
Here is an example of two sites data over the same time period, the first one shows the issue and the second one is a working example:
Here is the URL, these are text encoded for readability, but it has the same issues when switched to simple or extended encoding:
BROKEN VERSION:
https://chart.apis.google.com/chart?chxl=0:|11-22|11-23|11-24|11-25|11-26|11-27&chxt=x&chco=58838C,BF996B,BF5841,A61C1C&chf=bg,s,ffffff&chd=t:979,807,681,653,580,509|822,724,602,562,519,455|540,409,381,375,336,301|307,156,173,176,155,133&chds=0,979&chdl=Visits|Visitors|New+Visits|Organic+Searches&chtt=Google+Analytics+-+Last+7+Days&cht=lc&chs=600x200&chxr=0,979,979|1,822,822|2,540,540|3,307,307
WORKING VERSION:
https://chart.apis.google.com/chart?chxl=0:|11-22|11-23|11-24|11-25|11-26|11-27&chxt=x&chco=58838C,BF996B,BF5841,A61C1C&chf=bg,s,ffffff&chd=t:1385,1395,981,947,863,731|1083,1222,832,715,690,546|580,566,427,413,387,329|247,151,151,171,162,135&chds=0,1395&chdl=Visits|Visitors|New+Visits|Organic+Searches&chtt=Google+Analytics+-+Last+7+Days&cht=lc&chs=600x200&chxr=0,1385,1395|1,1083,1222|2,580,580|3,247,247
The chxr values were incorrect. The gem was generating them for multiple axes when it should have only been generating them for one. I manually overrode the min, max and step in the gem and it worked.
Here is my code using the gem, first getting the max value from all my data points:
[#visits,#visitors,#new_visits,#organic_searches].each do |array|
array.values.each do |value|
#max_value = value if (value > #max_value)
end
end
# Chart it
chart = Gchart.line(
:title => prop.to_s.upcase + ' Google Analytics - Past 7 Days',
:size => '600x200',
:bg => 'ffffff',
:axis_with_labels => ['x'],
:axis_labels => [#visits.keys],
:legend => ['Visits','Visitors','New Visits','Organic Searches'],
:line_colors => ['58838C','BF996B','BF5841','A61C1C'],
:encoding => 'text',
:data => [#visits.values,#visitors.values, #new_visits.values, #organic_searches.values],
:max_value => #max_value,
:axis_range => [nil, [0, #max_value, (#max_value / 10).to_i]],
:format => 'image_tag')