Jump to content

unplugged_web

Members
  • Posts

    897
  • Joined

  • Last visited

Everything posted by unplugged_web

  1. If I remove the var_dump and change it so that it sends the login credentials as an array ( $result=$proxy->GetAddressBooks( array("username" => "username", "password" => "password") ); ) then I get this error: HTTP Error: no proper separation of headers and document If I get the results of $proxy then the top part is: Unfortunately the only documentation I've got is this: http://api.dotmailer.com/v2/api.svc#op.ApiService.GetAddressBooks which is for SOAP rather than NUSOAP
  2. I'm sorry I don't really understand what you mean. If I use var_dump on $result it outputs bool(false) while if I get a dump of $client then it looks like it outputs everything (I think it output everything from this page: https://apiconnector.com/v2/api.svc?wsdl). Although the first part of it is this: I'm not sure what to look for although I did try removing the values from the username and password fields and still got the same results. My thinking is that the username and password aren't being sent in this line - $result=$proxy->GetAddressBooks( $username,$password ); I don't know how to correct that though
  3. There's around a 1mb file that I don't understand but at the bottom it says:
  4. I'm trying to use a SOAP API with nusoap but am having some real problems with it. I've never used SOAP before (nor have I used NUSOAP either) and would be grateful for any help please. This is the page I'm using to help me: http://api.dotmailer.com/v2/api.svc#op.ApiService.GetAddressBooks and this is what I'm using this to get the results: <?php # initialise $username='username@apiconnector.com'; $password='password'; $error_message1="Something went wrong with client "; $error_message2="Something went wrong with proxy "; $error_message3="Something went wrong with result 1st "; $error_message4="Something went wrong with result 2nd "; $error_message5="Something went wrong with result 3rd "; $wsdlPath = "https://apiconnector.com/v2/api.svc?wsdl"; # perform lookup require $INSTALL['include']."/nusoap/lib/nusoap.php"; $client=new soapclient( $wsdlPath,'wsdl' ); $err=$client->getError(); if( $err ) { echo $error_message1; exit( $err ); } # create a proxy client. $proxy=$client->getproxy(); $err=$proxy->getError(); if( $err ) { echo $error_message2; exit( $err ); } # call the SOAP method for GetAddressBooks. $result=$proxy->GetAddressBooks( $username,$password ); if( $proxy->fault ) { echo $error_message3; } else { $err=$proxy->getError(); if( $err ) { echo $error_message4; exit( $err ); } else { if( $result['error_code']!='0' ){ echo $error_message5; exit( $err ); } GetAddressBooksResult( $result ); } } ?> That just outputs this Something went wrong with result 2nd wsdl error: phpType is struct, but value is not an array: see debug output for details. From the output I can see that the problem is here if( $err ) { echo $error_message4; exit( $err ); but I don't know how to fix that. I've also checked the debug log and says this: PHP Warning: Attempt to modify property of non-object in /ha/ha0/www/include/lib/nusoap.php on line 4694 Line 4694 is: $this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true;
  5. I found the error, it was in the php before - it was preventing the fp from being defined at all. Thanks
  6. That's here: <script type="text/javascript"> $(".player").flowplayer(); var fp=$(".player").data("flowplayer"); $("#fullscreen").click(function(){ if( !fp.playing && !fp.loading ) { fp.load(); } fp.fullscreen(); }); </script>
  7. I'm trying without much success to get flow player to work on a test website. I have it working on another site but on the test site it just doesn't work. I get an error saying ReferenceError: Can't find variable: fp. The full error is: Line 447 in the player.php is fp.load(); The code I'm using to load the video (when somebody clicks a button is should load) is: $(".thumb-vid").click(function(){ $("#pop").bPopup({ modalClose: true, opacity: 0.6, positionStyle: 'fixed', onClose: function(e){ if (fp.loading) { e.preventDefault(); } else { fp.unload(); } }, onOpen: function(){ fp.load(); } }); I'd be grateful for any help on this please, I've tried the flow player forum but they said they couldn't help because I'm not trying to get it to work on one of their pages. I also tried using console.log ('fp'); but that didn't show anything at all
  8. There should be a value there, when I send the request to PayPal it's sent as " $paymentAmount = $_SESSION["Payment_Amount"];" and has the total amount. But after confirming the payment in PayPal it's then redirected and the value of "$paymentAmount" should be there but it's not. I'm following this: https://devtools-paypal.com/integrationwizard/ and have downloaded their code.
  9. I'm trying to set up PayPal's Express Checkout on a custom built shopping cart but I've never done anything like this before and didn't know if anybody had dine this before? I've followed PayPal's instructions but when I add the code to the page that handles the billing I just get an error saying: Direct credit card payment API call failed. Detailed Error Message: OrderTotal (Amt) : Required parameter missingShort Error Message: Missing ParameterError Code: 81100Error Severity Code: Error I tried adding the code to the page where they click to pay with PP as well as on it's own page but I get the same error both times. I know I'm doing something wrong but am not sure exactly what and would be grateful for any help please Thanks
  10. So it's not necessarily me being dumb it may be their file. I'll contact them about it now Thanks
  11. I tried using their code but that gave the same error but for the ListAddressBooks method: PHP Fatal error: Call to undefined method soapclient::ListAddressBooks() Even if I try it with login instead of username it still fails. I've also double checked the credentials and they correct
  12. I was following the instructions from dot mailers website: https://support.dotmailer.com/entries/20668943-Accessing-the-API-using-PHP but will try it with login rather than username and remove the addressBookId. One question though, the error log says that the problem is on this line: $result = $client->GetContactsInAddressBook(array('withFullData')); which is after the username/login line, does that not mean that username is okay or have I misread the error? EDIT: I tried login instead of username and that gave the same "PHP Fatal error: Call to undefined method soap client::GetContactsInAddressBook() error."
  13. I changed that but am still getting the same PHP Fatal error: Call to undefined method soapclient::GetContactsInAddressBook() error. The code I'm using is: <?php$client = new SoapClient("https://apiconnector.com/v2/api.svc?wsdl", array("username" => "xxxxxxxxxx", "password" => "xxxxxxxxxx", "addressBookId" => "xxxxxxxxxx"));$result = $client->GetContactsInAddressBook(array('withFullData'));$array = $result->GetContactsInAddressBook->GetContacts;print "<table border='2'><tr><th></th><th>addressBookId</th><th>withFullData</th></tr>";foreach($array as $k=>$v){print "<tr><td align='right'>" . ($k+1) . "</td><td>" . $v->addressBookId . "</td><td align='right'>" . $v->withFullData . "</td></tr>";}print "</table>";?> I really don't know what I'm doing wrong here as I've followed help/tutorials and read about it but it's still not working
  14. I've tried to read up about SOAP API's and have now changed it to this: <?php$client = new SoapClient("https://apiconnector.com/v2/api.svc?wsdl");$params = array("username" => "username", "password" => "password");$result = $client->GetContactsInAddressBook(array('withFullData'=>5));$array = $result->GetContactsInAddressBook->GetContacts;print "<table border='2'><tr><th></th><th>addressBookId</th><th>withFullData</th></tr>";foreach($array as $k=>$v){print "<tr><td align='right'>" . ($k+1) . "</td><td>" . $v->addressBookId . "</td><td align='right'>" . $v->withFullData . "</td></tr>";}print "</table>";?> but I'm still not getting anything. I've checked the error log an it says this but I don't understand as it looks like that's what it says it should be?
  15. I've now URL encoded the signature but I'm still getting a SignatureDoesNotMatch error. Ive to this for the for action and method: <form action="https://payments-sandbox.amazon.co.uk/cba/api/purchasecontract/?AWSAccessKeyId=AWS_ACCESS_KEY&Action=SetPurchaseItems&PurchaseContractId=amzn1.contract.1.1.2.5a49fd0d6fab162cdd34dc868c8735db&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=<?php echo gmdate("Y-m-dTH:i:s", time()); ?>&Version=2010-08-31&Signature=<?php echo urlencode(hash_hmac('SHA256','AWS_SECRET_KEY','secret')); ?>" method="post">
  16. I thought that was what I had done and caused the two '=' error?
  17. I've followed that an changed the code to this <form action="https://payments-sandbox.amazon.co.uk/cba/api/purchasecontract/?AWSAccessKeyId=AWS_ACCESS_KEY_ID&Action=SetPurchaseItems&PurchaseContractId=amzn1.contract.1.1.1.e51e9a391b97ad59eabe0ab82a9370bc&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=<2014-11-04T10:25:53&Version=2010-08-31&Signature=<?php echo base64_encode(hash_hmac('SHA256','AWS_SECRET_KEY','secret')); ?>" method="post">........</form> but now get this error:
  18. I've followed this as best as I can: https://api.dotmailer.com/v2/api.svc#op.ApiService.GetContactsInAddressBook and have now changed the code to this: <?php$client = new SoapClient("http://apiconnector.com/v2/ApiService/GetContactsInAddressBook");$params = array("username" => "*******", "password" => "*******", "addressBookId" => "160189");$result = $client->GetContactsInAddressBook($params);var_dump($result);echo "done";?> but again that gives an error about the 'GetContactsInAddressBook'. If I replace that line with $result = $client; I get an output that doesn't give me the data I need
  19. I got the url wrong sorry, it's actually https://api.dotmailer.com/v2/address-books/160189/contacts?withFullData={withFullData} - I was worried about posting anything sensitive. The actual error I get in the logs is PHP Fatal error: Call to undefined method soapclient::GetAddressBookContacts() but GetAddressBookContacts() is the value I got from dot mailers site: https://api.dotmailer.com/v2/help/wadl#GetContactsInAddressBook
  20. I've never worked with SOAP before so am not exactly sure how to display the results from this: <?php$client = new SoapClient("https://api.massmailer.com/v2/address-books/{AddressBookId}/contacts?withFullData={withFullData}");$params = array("username" => "USERNAME", "password" => "PASSWORD");$result = $client->GetAddressBookContacts($params);var_dump($result);echo "done";?> If I go to the page this is on nothing is rendered at all. Even the var_dump() is empty, but if I go to https://api.massmailer.com/v2/address-books/{AddressBookId}/contacts?withFullData={withFullData} I'm prompted to enter the API username and password then it displays everything. Ideally I'd like to get everything from the address book.
  21. Thanks, I'm probably just being really dumb and not reading it properly, I don't understand these two lines: 3. Calculate an RFC 2104-compliant HMAC with the string you just created, your Secret Access Key as the key, and SHA256 or SHA1 as the hash algorithm. 4. Convert the resulting value to base64.
For example, 5nB7nu7PFbCiDg+vYyWMj1JzEH3S+IzFoVgwHGjG5Ms=
  22. Sorry to be so dumb but what parameters do they want? Whenever I enter them manually and then test the button I get the InvalidSignature error message. I thought I had the right details: I've also just found that this is the newest reference guide: http://amazonpayments.s3.amazonaws.com/documents/Inline_Checkout_API_Reference_Guide_UK.pdf
  23. I'm sorry but I still don't understand? What do I do with the parameters, do I just save them or send them to Amazon? I tried pasting this into the browser: https://payments-sandbox.amazon.co.uk/cba/api/purchasecontract/AWSAccessKeyId=AWS_ACCESS_KEY_ID&Action=SetPurchaseItems&PurchaseContractId=amzn1.contract.1.1.1.e51e9a391b97ad59eabe0ab82a9370bc&SignatureMethod=HmacSHA256&SignatureVersion=2&Version=2010-08-31 but all I got was <b><UnknownOperationException/></b> I also tried using Amazon's scratchpad but it didn't have any options for 'payments', 'purchase contract' or 'SetPurchaseItems' If it helps the full code for sending the order to amazon is: <form action="https://payments.amazon.co.uk/cba/api/purchasecontract/" method="get"><input type="hidden" name="Action" value="SetPurchaseItems" /><input type="hidden" name="AWSAccessKeyId" value="SAMPLE" /><input type="hidden" name="PurchaseContractId" value="<?php echo $_GET['purchaseContractId']; ?>" /><?php foreach( $order_line as $key=>$value ) { ?><input type="hidden" name="PurchaseItems.PurchaseItem.1.FulfillmentNetwork" value="MERCHANT" /><input type="hidden" name="PurchaseItems.PurchaseItem.1.MerchantId" value="SAMPLE" /><input type="hidden" name="PurchaseItems.PurchaseItem.1.MerchantItemId" value="<?php echo $products_all[$value['product_id']]['id'] ?>" /><input type="hidden" name="PurchaseItems.PurchaseItem.1.Quantity" value="<?php echo $value['product_qty'] ?>" /><input type="hidden" name="PurchaseItems.PurchaseItem.1.Title" value="<?php echo htmldisplay( $products_all[$value['product_id']]['name'] ) ?>" /><?php if( count( $value['detail'] ) ) { ?><?php if( is_array( $product_detail ) ) { foreach( $product_detail as $key2=>$value2 ) { if( isset( $value['detail'][$key2] ) ) { ?><input type="hidden" name="PurchaseItems.PurchaseItem.1.Description" value="Option: <?php echo htmldisplay( $value2['name'] ) ?>" /><?php } } ?><input type="hidden" name="PurchaseItems.PurchaseItem.1.UnitPrice.Amount" value="<?php if( $value['price_total']<0.01 ) { echo "00.00"; } else { echo (number_format( $value['price_total']/$value['product_qty']*$companydetails['exchange'],2 )); } ?>" /><input type="hidden" name="PurchaseItems.PurchaseItem.1.UnitPrice.CurrencyCode" value="<?php echo htmldisplay( $companydetails['currency_iso']); ?>" /><input type="hidden" name="PurchaseItems.PurchaseItem.1.URL" value="product/<?php echo $products_all[$value['product_id']]['linkword'] ?>" /><?php } } } ?><input type="hidden" name="SignatureSignature" value="SAMPLE" /><input type="hidden" name="SignatureMethod" value="METHOD" /><input type="hidden" name="SignatureVersion" value="SIGNATUREVERSION" /> <input type="hidden" name="Timestamp" value="<?php echo gmdate("Y-m-dTH:i:s.000Z", time()); ?>" /><input type="hidden" name="Version" value="VERSION" /> <input type="submit" class="input_button input_red" value="Complete order" /> </form> If I try to send that to Amazon the next page says this:
  24. I'm trying to add 'Checkout With Amazon' to our website and have got to the section where I need to create a signature but I'm not sure how to do this. It says I need a canonicalized query string, what does that mean? I've been trying to follow page 10 (Create the Signature) of this document I'd be really grateful for any help please.
×
×
  • Create New...