I am hoping someone can help me.
I have discount sets on my products to apply a percentage discount when ordering a certain amount of one produt.
I am having issues when my site sends the total to PayPal as I am gettign the following error (example) -
num products: 2
array(2) {
[0]=> string(5) "38649"
[1]=> string(5) "40119" }
discount: g total: 326.02
array(2) {
[0]=> string(28) "API_L_PAYMENTREQUEST_0_NAME0"
[1]=> string(28) "API_L_PAYMENTREQUEST_0_NAME1"
}
name: 101.6 x 152.4mm Direct Thermal Labels - Permanent Adhesive Select core size:: 76mm; - Multibuy!
name: 110 x 45mm Thermal Transfer Labels - Freezer Adhesive Select core size:: 76mm; - Multibuy!
&RETURNURL=https://www.labelmetrics.co.uk/store/paypal_return.php
&CANCELURL=https://www.labelmetrics.co.uk/store/view_cart.php
&PAYMENTREQUEST_0_CURRENCYCODE=GBP
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_AMT=326.02
&BRANDNAME=
&PAYMENTREQUEST_0_ITEMAMT=326.02
&PAYMENTREQUEST_0_SHIPPINGAMT=
&PAYMENTREQUEST_0_TAXAMT=
&L_PAYMENTREQUEST_0_NAME0=101.6 x 152.4mm Direct Thermal Labels - Permanent Adhesive Select core size:: 76mm; - Multibuy!
&L_PAYMENTREQUEST_0_DESC0=
&L_PAYMENTREQUEST_0_AMT0=13.81
&L_PAYMENTREQUEST_0_QTY0=20
&L_PAYMENTREQUEST_0_TAXAMT0=0.00
&L_PAYMENTREQUEST_0_NAME1=110 x 45mm Thermal Transfer Labels - Freezer Adhesive Select core size:: 76mm; - Multibuy!
&L_PAYMENTREQUEST_0_DESC1=
&L_PAYMENTREQUEST_0_AMT1=19.16
&L_PAYMENTREQUEST_0_QTY1=6
&L_PAYMENTREQUEST_0_TAXAMT1=0.00
SetExpressCheckout failed: Array (
[TIMESTAMP] => 2018-09-06T09:11:59Z
[CORRELATIONID] => a7547fbde80c6
[ACK] => Failure
[VERSION] => 64.0
[BUILD] => 48666477
[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
)
Has anyone seen this before and can anyone help?
Related
I have a list of this structure List messages = [ [{body: QGB59WIO57 Confirmed. Your account balance was: M-PESA Account : Ksh0.00 on 11/7/22 at 12:42 PM. Transaction cost, Ksh0.00. Dial *334# now to get your stamped M-Pesa Statement., address: MPESA, timestamp: 1657532523000, status: failed}],
I/flutter ( 4659): [{body: QGB7A3UGAX Confirmed. Your account balance was: M-PESA Account : Ksh0.00 on 11/7/22 at 2:18 PM. Transaction cost, Ksh0.00. Dial *334# now to get your stamped M-Pesa Statement., address: MPESA, timestamp: 1657538312000, status: failed}] ]
I want to get the index of where timestamp is equal to 1657538312000 in this case the ondex of the second element of the list
I didn't fully get the structure but you should be able to do seomthing like
var index = messages.indexOf(messages.firstWhere((element) => /*your check here*/ ));
I'm using in_app_purchase 3.0.6 package but i get wrong prices for the inapp i have created in Google Play e AppStoreConnect.
On AppStoreConnect i have 3 inapp with those settings :
1 - identifier: com.inapp_1 , tier 1 ( 0,99 € )
2 - identifier: com.inapp_2 , tier 2 ( 1,99 € )
3 - identifier: com.inapp_3 , tier 3 ( 2,99 € )
On Google Play i have those settings :
1 - identifier: com.inapp_1 ( 0,99 € )
2 - identifier: com.inapp_2 ( 1,99 € )
3 - identifier: com.inapp_3 ( 2,99 € )
with this code i retrive the inapp prices to show the product:
final ProductDetailsResponse response = await InAppPurchase.instance.queryProductDetails(inappidentifier);
if (response.notFoundIDs.isNotEmpty) {
//empty
} else {
List<ProductDetails> products = response.productDetails;
final ProductDetails productDetails = products[0];
//ProductDetails contains the informations i need to use
}
the prices i retrive from ProductDetailsResponse are:
on IOS :
1 - identifier: com.inapp_1 ( 1,09 € )
2 - identifier: com.inapp_2 ( 2,49 € )
3 - identifier: com.inapp_3 ( 3,49 € )
on Android :
1 - identifier: com.inapp_1 ( 1,19 € )
2 - identifier: com.inapp_2 ( 2,39 € )
3 - identifier: com.inapp_3 ( 3,69 € )
Those prices are extracted from productDetails!.rawPrice and it seems the real price user will pay if complete the transaction (At least it is the price i see in the native device dialog during payment).
The currency is € and that's correct.
I can't find anything in docs that can justify those strange prices. How i can do to retrive the prices i set in Google Play and AppStoreConnect?
I have an issue on using SimpleRemoteObject. (sdk 0.9.6)
My actual website is using this code to call remote function with Amfphp :
<mx:RemoteObject id="ro" source="aadmin" destination="amfphp">
<mx:method name="siteLogin" fault="{onRcv_siteLoginErr(event)}" result="{onRcv_siteLogin(event)}"/>
</mx:RemoteObject>
As <mx:method/> does't exist in Apache Royale I set this code :
</js:beads>
<js:SimpleRemoteObject id="sro" source="aadmin" result="onResult(event)" fault="onFault(event)"
endPoint = "http://amfphp.myserver_url.com/gateway.php"
destination = "amfphp" />
</js:beads>
aadmin is my php class service name
To call my function I do :
sro.send("siteLogin",["123"]);
where siteLogin is my function to call inside aadmin class
Running this, I have this issue :
The class {Amf3Broker} could not be found under the class path {/home/www/amfphp/services/amfphp/Amf3Broker.php}
Why does it show Amf3Broker ? Does anyone have an exemple of working SimpleRemoteObject with amfphp ?
Server side I use https://github.com/silexlabs/amfphp-1.9
Do I need to setup a service-config.xml file ? If yes how to use it with compiler ? (I tried "services": "services-config.xml" in compilerOptions but not working)
Here is my service-config.xml :
<services-config>
<services>
<service id="amfphp-flashremoting-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage">
<destination id="amfphp">
<channels>
<channel ref="my-amfphp"/>
</channels>
<properties>
<source>*</source>
</properties>
</destination>
</service>
</services>
<channels>
<channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://amfphp.myserver.com/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties><add-no-cache-headers>false</add-no-cache-headers></properties>
</channel-definition>
</channels>
</services-config>
Now I have do a test with amfphp V2.0 from https://github.com/silexlabs/amfphp-2.0
This is a little better, but I have an error. It seem that there is an issue with _explicitType property. Moreover I don't see my argument ('123') in [requestMessage]
/onStatusî$flex.messaging.messages.ErrorMessage
correlationId faultCode# faultDetailfaultStringvUndefined property: stdClass::$_explicitType .
<br>file: /home/www/mysite.com/amfphpv2/Plugins/AmfphpFlexMessaging/AmfphpFlexMessaging.php
<br>line: 113
<br>context: Array
(
[requestMessage] => Amfphp_Core_Amf_Message Object
(
[targetUri] => null
[responseUri] => /1
[data] => Array
(
[0] => stdClass Object
(
[body] => stdClass Object
(
)
[clientId] =>
[correlationId] =>
[destination] => amfphp
[headers] => stdClass Object
(
)
[messageId] => EF4BF9E3-5C02-1060-1FF3-5D9781F55A31
[operation] => 13
[timeToLive] => 0
[timestamp] => 0
)
)
)
[serviceRouter] => Amfphp_Core_Common_ServiceRouter Object
(
[serviceFolders] => Array
(
[0] => /home/www/mysite.com/amfphpv2/Core/../Services/
)
[serviceNames2ClassFindInfo] => Array
(
[AmfphpMonitorService] => Amfphp_Core_Common_ClassFindInfo Object
(
[absolutePath] => /home/www/mysite.com/amfphpv2/Plugins/AmfphpMonitor/AmfphpMonitorService.php
[className] => AmfphpMonitorService
)
[AmfphpDiscoveryService] => Amfphp_Core_Common_ClassFindInfo Object
(
[absolutePath] => /home/www/mysite.com/amfphpv2/Plugins/AmfphpDiscovery/AmfphpDiscoveryService.php
[className] => AmfphpDiscoveryService
)
)
[checkArgumentCount] => 1
)
[explicitTypeField] => _explicitType
)
rootCause
Thanks in advance for any help...
Here is some tested working code on 0.9.6 sdk (please notice that you must use config flex to be able to use mx if you have mx library issue). tested with v1.9 and v2.0 AMFPHP from silexlabs :
<fx:Declarations>
<mx:RemoteObject id="ro" result="onResult(event)" fault="onFault(event)" source="your-service-php-class"
endpoint = "https://www.your-amfphp-server.com/amfphp/gateway.php"
destination = "amfphp" />
</fx:Declarations>
Then in script
ro.getOperation("your-php-function-to-call").send("your-param");
[update]
Important : be sure to have this in your application else you will have error like *The class {Amf3Broker} could not be found*
<mx:beads>
<js:ClassAliasBead />
</mx:beads>
[update#2]
You what to use config royale but also wants MX libs to use MX remote object ? Here is how :
https://github.com/apache/royale-asjs/issues/495#issuecomment-539906300
the backends I know are working (from my own experience) are Java and .NET(Fluorine). AMFPHP must work too. Others tried it but was almost a year ago when AMF was not completely developed. Right now AMF in Royale is very robust and works very good with all types with the exception of Vector and Dictionary (I suppose those will come some day but since are AS3 types, has lower priority for now).
The main thing here is to use MXRoyale version of RemoteObject (mx:RemoteObject emulation) since this one is the most closest to Flex RemoteObject. The others in Network lib are more lighter classes implemented as beads that were the first ones to come to Royale. But at least in my case I switched to mx:RemoteObject, so I can ensure the others are working at the same level.
I am developing a php-mongodb project. I have installed the php-mongodb driver using composer. connectivity is working fine.
used reference link for any guidance :
http://mongodb.github.io/mongo-php-library/tutorial/crud/#crud-operations
and http://php.net/manual/en/mongocollection.find.php
I could not find much reliable theory for php-7 except those.
How to fire a query with php-7 to get a result from database greater than specified number?
The code I tried is :
$rs=$collection->find(['$gte'=>['avg'=>50]]);
this is not working. The error it produced was:
Fatal error: Uncaught MongoDB\Driver\Exception\ConnectionException: unknown top level operator: $gte in /var/www/example.com/public_html/vendor/mongodb/mongodb/src/Operation/Find.php:180 Stack trace: #0 /var/www/example.com/public_html/vendor/mongodb/mongodb/src/Operation/Find.php(180): MongoDB\Driver\Server->executeQuery('training.tbl', Object(MongoDB\Driver\Query), Object(MongoDB\Driver\ReadPreference))#1 /var/www/example.com/public_html/vendor/mongodb/mongodb/src/Collection.php(437): MongoDB\Operation\Find->execute(Object(MongoDB\Driver\Server)) #2 /var/www/example.com/public_html/list.php(5): MongoDB\Collection->find(Array) #3 {main} thrown in /var/www/example.com/public_html/vendor/mongodb/mongodb/src/Operation/Find.php on line 180
found this answer from following here
// search for documents where 5 < x < 20
$rangeQuery = array('x' => array( '$gt' => 5, '$lt' => 20 ));
for above example the answer comes to be:
$rangeQuery = ['avg' => ['$gt' => '50' ]];
$rs=$collection->find($rangeQuery);
I was trying to stream import data into big query using tabledata.insert_all
job_data = {
kind: 'bigquery#tableDataInsertAllRequest',
rows: [
{ json: { column_name: value} }
]
}
response = execute(
api_method: bigquery.tabledata.insert_all,
parameters: {
projectId: config['project_id'],
datasetId: DATASET_ID,
tableId: table_id
},
body_object: job_data
)
But I always get the following error message
Google::APIClient::Request Sending API request post https://www.googleapis.com/bigquery/v2/projects/propane-tribute-90023/datasets/development/tables/api_requests_20150414/insertAll {"User-Agent"=>"My Test App/1.0 google-api-ruby-client/0.8.5 Mac OS X/10.9.5\n (gzip)", "Content-Type"=>"application/json", "Accept-Encoding"=>"gzip", "Authorization"=>"Bearer ya29.VgFYvU2nxGDhWiCdS47XRw0J-7GLenRry0Cd3AA2D1RDzMh5gnf-m85I5GeSr9oNW51OuUb9mdwObg", "Cache-Control"=>"no-store"}
Decompressing gzip encoded response (155 bytes)
Decompressed (261 bytes)
Google::APIClient::Request Result: 400 {"Vary"=>"X-Origin", "Content-Type"=>"application/json; charset=UTF-8", "Date"=>"Wed, 15 Apr 2015 03:14:17 GMT", "Expires"=>"Wed, 15 Apr 2015 03:14:17 GMT", "Cache-Control"=>"private, max-age=0", "X-Content-Type-Options"=>"nosniff", "X-Frame-Options"=>"SAMEORIGIN", "X-XSS-Protection"=>"1; mode=block", "Server"=>"GSE", "Alternate-Protocol"=>"443:quic,p=0.5", "Transfer-Encoding"=>"chunked"} => {"error"=>{"errors"=>[{"domain"=>"global", "reason"=>"invalid", "message"=>"No rows present in the request.", "locationType"=>"other", "location"=>"rows"}], "code"=>400, "message"=>"No rows present in the request."}}
Does anyone have the same the issue and know how to fix it?
Thanks.
Make sure you are providing appropriate values for all of the column headers present in your table’s schema. Providing separate “json” entries will populate individual rows with the column data you provide. Unless you have already assigned values to the variables named column_name and value, you need to provide those values in the statement following the json declaration.
A sample Ruby syntax for a tabledata.insert_all “rows” operation would look as follows:
body = {
"rows" =>[
{"json" => { "person_id" => 10, "person_name" => "test"}},
{"json" => { "person_id" => 11, "person_name" => "test2"}}
]
}