I'm setting up Paypal on a site at the moment as an alternative payment method for customers. In general, it's working fine; I can put an order through and it goes through to Paypal's site, shows the correct information, and all is fine. When a user applies a discount to the order, things still work fine, no worries at all.
When a user applies a discount for the full order value (ie. order is for £20, they have a discount code for £20 off) I'm getting the error "Item total is invalid." back from Paypal. The cost being sent across is £0, and the shipping being sent across is £5.
First off, is there anything wrong with the fields I'm sending across, and if so, what's wrong? :) If you need any more info, feel free to ask.
Sample express checkout fields:
Array
(
[METHOD] => SetExpressCheckout
[RETURNURL] => /snip/
[CANCELURL] => /snip/
[NOTIFYURL] =>
[AMT] => 5.00
[DESC] =>
[CURRENCYCODE] => GBP
[MAXAMT] =>
[USERACTION] => commit
[INVNUM] =>
[ADDROVERRIDE] => 0
[SHIPTONAME] =>
[SHIPTOSTREET] =>
[SHIPTOSTREET2] =>
[SHIPTOCITY] =>
[SHIPTOSTATE] =>
[SHIPTOZIP] =>
[SHIPTOCOUNTRYCODE] =>
[LOCALECODE] => GB
[PAGESTYLE] =>
[HDRIMG] =>
[BUTTONSOURCE] => /snip/
[L_SHIPPINGOPTIONISDEFAULT0] => true
[L_SHIPPINGOPTIONNAME0] => Royal Mail Tracked Next Day Ref:/snip (int)/
[L_SHIPPINGOPTIONLABEL0] =>
[L_SHIPPINGOPTIONAMOUNT0] => 5.00
[L_SHIPPINGOPTIONISDEFAULT1] => false
[L_SHIPPINGOPTIONNAME1] => Interlink Express Next Day Delivery (Ord Ref:/snip (int)/
[L_SHIPPINGOPTIONLABEL1] =>
[L_SHIPPINGOPTIONAMOUNT1] => 7.00
[L_SHIPPINGOPTIONISDEFAULT2] => false
[L_SHIPPINGOPTIONNAME2] => Collect In Store Ref:/snip (int)/
[L_SHIPPINGOPTIONLABEL2] =>
[L_SHIPPINGOPTIONAMOUNT2] => 0.00
[L_NAME0] => /snip/
[L_NUMBER0] => /snip (item id)/
[L_DESC0] =>
[L_AMT0] => 8.33
[L_TAXAMT0] => 1.67
[L_QTY0] => 1
[L_NAME1] => /snip/
[L_NUMBER1] => /snip (item id)/
[L_DESC1] =>
[L_AMT1] => 8.33
[L_TAXAMT1] => 1.67
[L_QTY1] => 1
[L_AMT2] => -16.66
[L_TAXAMT2] => -3.34
[L_NAME2] => /snip/
[L_DESC2] => /snip/
[L_QTY2] => 1
[ALLOWNOTE] => 1
[BUYEREMAILOPTINENABLE] => 1
[CALLBACK] => /snip/
[CALLBACKURL] => /snip/
[CALLBACKTIMEOUT] => 6
[REQCONFIRMSHIPPING] => 0
[SHIPPINGAMT] => 5.00
[ITEMAMT] => 0.00
[TAXAMT] => 0.00
)
You can't send an empty or zero amount to PayPal. $0.01 is the lowest you can go.
You can try and work around this by taking a cent from the shipping and adding it to the total or swap the shipping and item charges if the item charge is zero.
Related
In my web application, I want to implement a date field. For this i am using CJuiDatePicker. But for me it not showing calendar.
My code is,
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'name' => 'Employee[employee_joiningdate]',
'id' => 'Employee_employee_joiningdate',
'value' => Yii::app()->dateFormatter->format("d-M-y", strtotime($model->employee_joiningdate)),
'options' => array(`
'showAnim' => 'slide', //'slide','fold','slideDown','fadeIn','blind','bounce','clip','drop'
'showOtherMonths' => true, // Show Other month in jquery
'selectOtherMonths' => true, // Select Other month in jquery
),
'htmlOptions' => array(
'class' => 'form-control'
),
));`
What i am doing wrong?
Please help me....
Thanks in advance.
i've had my first Shopify store running for about a month now, using a PHP batch script to either create new products and variants, or to update as and when needed from an existing web-based product management system. All seems to have been running fine but i've just noticed that i'm getting an exception thrown when updating variants. I'm sure this has been working fine previously (been able to update a variant as needed) so I could do with a bit of help figuring out why this is failing now.
Here's an example:
ShopifyApiException Object
(
[method:protected] => PUT
[path:protected] => /admin/variants/4294967295.json
[params:protected] => Array
(
[variant] => Array
(
[price] => 8.00
[sku] => 2217
[id] => 2217
[product_id] => 21880
[inventory_management] => shopify
[inventory_policy] => deny
[inventory_quantity] => 1
[option1] => Plain \/ EX
[option2] => Strictly Rhythm
[option3] => SR12216
[weight] => 330
[weight_unit] => g
)
)
[response_headers:protected] => Array
(
[http_status_message] => Not Found
[http_status_code] => 404
[server] => nginx
[date] => Fri, 21 Aug 2015 14:27:03 GMT
[content-type] => application/json; charset=utf-8
[transfer-encoding] => chunked
[connection] => keep-alive
[vary] => Accept-Encoding
[x-sorting-hat-podid] => 3
[x-sorting-hat-shopid] => 2234339
[x-sorting-hat-podid-cached] => 1
[x-sorting-hat-shopid-cached] => 1
[status] => 404 Not Found
[x-frame-options] => DENY
[x-shopid] => 2234339
[x-shardid] => 3
[x-shopify-shop-api-call-limit] => 1/40
[http_x_shopify_shop_api_call_limit] => 1/40
[x-stats-userid] => 0
[x-stats-apiclientid] => 152673
[x-stats-apipermissionid] => 3265975
[x-xss-protection] => 1; mode=block; report=/xss-report/97471013-3a3c-4b82-a94d-868f9b7ac073?source%5Baction%5D=update&source%5Bcontroller%5D=admin%2Fproduct_variants&source%5Bsection%5D=admin
[set-cookie] => request_method=PUT; path=/
[x-request-id] => 97471013-3a3c-4b82-a94d-868f9b7ac073
)
[response:protected] => Array
(
[errors] => Not Found
)
[message:protected] => Not Found
[string:Exception:private] =>
[code:protected] => 404
[file:protected] => /var/www/MY-SERVER/httpdocs/shopify_tools/shopify.php
[line:protected] => 70
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => /var/www/MY-SERVER/httpdocs/shopify_tools/batch_upload_items.php
[line] => 347
[function] => call
[class] => ShopifyClient
[type] => ->
[args] => Array
(
[0] => PUT
[1] => /admin/variants/4294967295.json
[2] => Array
(
[variant] => Array
(
[price] => 8.00
[sku] => 2217
[id] => 2217
[product_id] => 21880
[inventory_management] => shopify
[inventory_policy] => deny
[inventory_quantity] => 1
[option1] => Plain \/ EX
[option2] => Strictly Rhythm
[option3] => SR12216
[weight] => 330
[weight_unit] => g
)
)
)
)
)
[previous:Exception:private] =>
)
I've realised the problem - hopefully this may help someone else.
I was storing the Shopify Variant ID in an INT column in my database and Shopify Variant IDs have just recently passed the INT limit of 4294967295 - switching to BIGINT and reimporting all the Variant IDs solved the problem.
How on installation step I can get store url? Because store hash is not the thing I really need I guess, as then I can't access is somehow by link.
if you are using the bigcommerce api, you can get the store information: https://developer.bigcommerce.com/api/stores/v2/store_information according the documentation
the api response give you:
stdClass Object
(
[id] => [your-store-identifier]
[domain] => [youstore-domain-name].mybigcommerce.com
[name] => test
[address] =>
[phone] =>
[admin_email] => test#domain.com
[order_email] => test#domain.com
[language] => en
[currency] => USD
[currency_symbol] => $
[decimal_separator] => .
[thousands_separator] => ,
[decimal_places] => 2
[currency_symbol_location] => left
[weight_units] => LBS
[dimension_units] => Inches
[dimension_decimal_places] => 2
[dimension_decimal_token] => .
[dimension_thousands_token] => ,
[plan_name] => Professional Application Developer Store
[logo] => Array
(
)
[is_price_entered_with_tax] =>
[active_comparison_modules] => Array
(
)
)
i have one doubt in ruby on rails...i have a problem in routes file.i am working for 1 week.but i am not getting a appropriate result.my problem is. i am working on a project called canvas which is a online tutorial.In that project in the course home page it have a side menu called pages.when clicking that it goes to the url. The canvas version is rails 2
http://localhost:3000/courses/1/wiki/front-page
and its routes file for the page is
concern :wikis do
get 'pages' => 'wiki_pages#pages_index'
get 'pages/:wiki_page_id' => 'wiki_pages#show_page', :wiki_page_id => /[^\/]+/, :as => :named_page
get 'pages/:wiki_page_id/edit' => 'wiki_pages#edit_page', :wiki_page_id => /[^\/]+/, :as => :edit_named_page
resources :wiki_pages, :path => :wiki do
match 'revisions/latest' => 'wiki_page_revisions#latest_version_number', :as => :latest_version_number
resources :wiki_page_revisions, :path => :revisions
end
match 'wiki/:id' => 'wiki_pages#show', :as => :named_wiki_page, :id => /[^\/]+/
end
my task is to add two more links to side menu named as faq and career without controller and view. i have put the routes for faq and career routes as below:
concern :faq do
get 'faq' => 'wiki_pages#pages_index'
get 'faq/:wiki_page_id' => 'wiki_pages#show_page', :wiki_page_id => /[^\/]+/, :as => :named_page
get 'faq/:wiki_page_id/edit' => 'wiki_pages#edit_page', :wiki_page_id => /[^\/]+/, :as => :edit_named_page
resources :wiki_pages, :path => :wiki do
match 'revisions/latest' => 'wiki_page_revisions#latest_version_number', :as => :latest_version_number
resources :wiki_page_revisions, :path => :revisions
end
match 'faq/:id' => 'wiki_pages#show', :as => :named_faq_page, :id => /[^\/]+/
end
the career routes is
concern :career do
get 'career' => 'wiki_pages#pages_index'
get 'career/:wiki_page_id' => 'wiki_pages#show_page', :wiki_page_id => /[^\/]+/, :as => :named_page
get 'career/:wiki_page_id/edit' => 'wiki_pages#edit_page', :wiki_page_id => /[^\/]+/, :as => :edit_named_page
resources :wiki_pages, :path => :wiki do
match 'revisions/latest' => 'wiki_page_revisions#latest_version_number', :as => :latest_version_number
resources :wiki_page_revisions, :path => :revisions
end
match 'career/:id' => 'wiki_pages#show', :as => :named_wiki_page, :id => /[^\/]+/
end
using the above wiki_controller i want to change the url like below
when i clicking the faq the url must like this:
http://localhost:3000/courses/1/faq/front-page
but the actions are wikipages_index and show.
when i clicked the career link it must be.
http://localhost:3000/courses/1/career/front-page
like this the url must come for all index and show,edit and update.plz apologize me that it is not an standard english.can anybody help me.
thanks in advance
with regards
saran
I have working on SANDBOX. I am getting error :
[0] => Array
(
[L_ERRORCODE] => 11502
[L_SHORTMESSAGE] => Invalid Token
[L_LONGMESSAGE] => The token is invalid
[L_SEVERITYCODE] => Error
)
This is what i passing in CreateRecurringProfile :
[REQUESTDATA] => Array
(
[USER] => "API_USER"
[PWD] => "API_PASS"
[VERSION] => 74.0
[BUTTONSOURCE] => AngellEYE_PHPClass
[SIGNATURE] => "API_SING"
[METHOD] => CreateRecurringPaymentsProfile
[TOKEN] => EC-8F723718H3002730R
[SUBSCRIBERNAME] => Tester Testerson
[PROFILESTARTDATE] => 2012-09-06T00:00:00\Z
[DESC] => Item 1 Name
[AUTOBILLAMT] => 1
[BILLINGPERIOD] => Month
[BILLINGFREQUENCY] => 1
[TOTALBILLINGCYCLES] => 0
[AMT] => 10.00
[CURRENCYCODE] => USD
[EMAIL] => hide#address.com
[BUSINESS] => Testers, LLC
[FIRSTNAME] => Tester
[LASTNAME] => Testerson
)
NOTE: I have removed SANDBOX API Credential. To show here.
Please give me solution what is missing here or what is fault in my posting request.
Thanks for advance
Did you include L_BILLINGTYPE0=RecurringPayments in your SetExpressCheckout and DoExpressCheckoutPayment API calls?