Check out with Pay-Pal reset the connection - paypal

I have a web app that use paypal for checkout. It was working well few days ago. Now, I try to do a checkout and Paypal reset the connection. I'm using a sandbox account, sending the request to https://api.sandbox.paypal.com/2.0/. I have a valid certificate from Paypal. My XML request is:
<?xml version="1.0" encoding="utf-8"?>
<xsi:SetExpressCheckoutReq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetExpressCheckoutRequest xmlns="urn:ebay:api:PayPalAPI">
<ErrorLanguage xmlns="urn:ebay:apis:eBLBaseComponents">en_US</ErrorLanguage>
<Version xmlns="urn:ebay:apis:eBLBaseComponents">98.0</Version>
<SetExpressCheckoutRequestDetails xmlns="urn:ebay:apis:eBLBaseComponents">
<OrderTotal currencyID="USD" />
<ReturnURL>https://[my url site]?ppec=return</ReturnURL>
<CancelURL>https://[my url site]/checkout.aspx?ppec=cancel</CancelURL>
<Custom>100232</Custom>
<cpp-header-image>https://[my url site]/themes/default/images/layout/invoice_logo.gif</cpp-header-image>
<PaymentAction>Sale</PaymentAction>
<BuyerEmail>some#email.com</BuyerEmail>
<ChannelType>Merchant</ChannelType>
<PaymentDetails>
<OrderTotal currencyID="USD">280.51</OrderTotal>
<ItemTotal currencyID="USD">270.00</ItemTotal>
<ShippingTotal currencyID="USD">10.51</ShippingTotal>
<HandlingTotal currencyID="USD">0.00</HandlingTotal>
<TaxTotal currencyID="USD">0.00</TaxTotal>
<InvoiceID>100232</InvoiceID>
<ShipToAddress>
<Name>NAME SURNAME</Name>
<Street1>717 Some st</Street1>
<Street2 />
<CityName>City</CityName>
<StateOrProvince>ST</StateOrProvince>
<Country>US</Country>
<Phone>+15551234567</Phone>
<PostalCode>00000</PostalCode>
</ShipToAddress>
<PaymentDetailsItem>
<Name>Triángulo Isósceles</Name>
<Number>4444</Number>
<Quantity>1</Quantity>
<Amount currencyID="USD">300.00</Amount>
</PaymentDetailsItem>
<PaymentDetailsItem>
<Name>Discounts</Name>
<Quantity>1</Quantity>
<Amount currencyID="USD">-30.00</Amount>
</PaymentDetailsItem>
</PaymentDetails>
</SetExpressCheckoutRequestDetails>
</SetExpressCheckoutRequest>
</xsi:SetExpressCheckoutReq>
A month ago I change the security protocol type from Tls to Tls1.2. My tests when I made the change were ok but know is not working. I traced the connection with Wireshark and I got from sandbox Paypal (173.0.82.78)
443 → 60191 [RST, ACK] Seq=4163 Ack=2365 Win=0 Len=0
Any idea?
Thanks. Sorry my English. If you don't understand something because that, don't hesitate to ask me anything.

There are many apis that provided by paypal depend on your location .
please first check that the rest api is supported by your country or not .
go to http://developer.paypal.com it's the biggest documentation and guide to use paypal apis i think express payment is the best for you it'll connect to the paypal site and the checkout will be done in really secure place . the documents and the api properties are documented in paypal website with really help ful examples .
You have to send your request using query string to this url https://api.sandbox.paypal.com/2.0/ .
the properties that you have to send can find on paypal website express checkout api rest .
Good Luck

Related

Workday SOAP API : How to authenticate

I'm a newbie to workday soap api and I'm trying to figure out how to send a soap request to authenticate using SOAPUI.
Any suggestions, would be greatly appreciated.
Workday APIs use WS-Security for authentication.
Remember that the workday host is multi-tenant. So, you'll use the WSDL endpoint to connect to the correct server, and the user name field will contain both your user name and the tenant on that server.
User name format for SOAP Auth to Workday:
[user-name]#[tenant-name]
Example: youUserName#tenant6
Your workday account will need to be in the Integration Developer's group, as well.
You may need to adjust security and permissions beyond that to permit access to certain functional groups and domains which relate to the web service.
If you're using SoapUI, do the following:
Import the WSDL into a project.
In "Integration binding", go to settings.
On the "Service endpoints" tab, set the username as I've described above.
Set the password to your password in the tenant.
The WSS-Type should be set to PasswordText.
Now, you can make a request.
Not sure what exactly you are referring to. You authenticate implicitly - there is no separate request. The Workday API documentation is published here. You should read it. When you import the WSDL, for example in a .Net solution, it will give you access to various API classes.
For example, to connect to the Compensation API from an SSIS script task I use the following:
// Instantiate and configure compensation client
CompensationPortClient compClient = // I use custom binding - gives me more control
new CompensationPortClient(CompensationObjectFactory.getWorkdayBinding(),
new EndpointAddress(endpointURL));
compClient.ClientCredentials.UserName.UserName = userName;
compClient.ClientCredentials.UserName.Password = password;
(I created the CompensationObjectFactory to instantiate all the client-side API objects because the process is somewhat formulaic.)
Then you can make API calls with the client object, for example, query a one-time award:
Request_OneTime_Payment_RequestType request =
CompensationObjectFactory.getOneTimePaymentRequest(
CompensationObjectFactory.getBusinessProcessParameters(),
CompensationObjectFactory.getOneTimePaymentData(
planId, currency, amount, effDt, emplID, positionID));
Request_OneTime_Payment_ResponseType response =
compClient.Request_OneTime_Payment(request);
I finally figured this out after debugging a working SOAP UI example by installing wireshark and forcing my request over HTTP!
The previously posted header example did not work for me because it was missing some info. I noticed further that my captured header worked several hours later and I developed a theory that Workday was ignoring everything but username and password. So I tested the following and it worked:
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="bogus">
<wsse:Username>user#tenant</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">[PASSWORD HERE]</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">bogus</wsse:Nonce>
<wsu:Created>2000-10-02T21:12:28.365Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
Best of luck if you are reading this. SOAP is a complete nightmare!
To add to the responses already here, you may need to also add in your credentials in the SOAP header, like so:
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="bogus">
<wsse:Username>[user]#[tenant]</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">[PASSWORD HERE]</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">bogus</wsse:Nonce>
<wsu:Created>2000-10-02T21:12:28.365Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
Modifying "Request Properties" worked for me. The username is [user-name]#[tenant-name] as mentioned in #dbh's answer
Screenshot:

SIP calls POSTing StatusCallback when call ends even though no StatusCallback URL is configured

When SIP calls end, the last request that was POSTed to my app gets POSTed again, slightly modified, but with the params that the Twilio docs indicate will be included in a call StatusCallback POST. This is doubly weird because I don't have a StatusCallback URL configured!
So ...an example. The environment (all URLs are https):
Twilio SIP endpoint: test-myaccount.sip.twilio.com
Voice URL (POST): myapp.myserver.com/twilioapp
Fallback URL (GET): s3.amazonaws.com/somebucket/twilioerror.xml (can't imagine that's relevant, but I mention it in case it tips anyone off to weird side effects)
StatusCallback URL (POST): blank
The call flow:
1a. Call made to SIP endpoint - Twilio sends request to TwiML app server:
POST myapp.myserver.com/twilioapp
1b. TwiML app responds:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say language="en-US" voice="alice">May the fourth be with you!</Say>
<Redirect>myapp.myserver.com/twilioapp/secondstep?actualdate=20140503</Redirect>
</Response>
2a. Twilio plays the TTS speech, then POSTs back to the app server (per the Redirect verb):
POST myapp.myserver.com/twilioapp/secondstep?actualdate=20140503
2b. The app server responds:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say language="en-US" voice="alice">Whoops, wrong date. Goodbye!</Say>
<Hangup />
</Response>
3a. Here's the funkiness I'm seeing - Twilio is then POSTing another request:
POST myapp.myserver.com/twilioapp/secondstep/?actualdate=20140503
Note (a) that the POST is to the last URL that Twilio posted to and (b) a trailing slash has been added to the URL, before the querystring params.
Params that are sent with that final POST:
AccountSid: <MyAccountSid>
Caller: sip:55512345678#169.0.0.0
CallStatus: completed
Duration: 1
Called: sip:test-myaccount.sip.twilio.com
To: sip:test-myaccount.sip.twilio.com
CallDuration: 22
CallSid: <TheCallSid>
From: sip:55512345678#169.0.0.0
Direction: inbound
ApiVersion: 2010-04-01
More weird: both Duration and CallDuration are included in the POST params - Duration in (rounded up) minutes, CallDuration in seconds.
So - I have no idea what's up. I've got a support ticket in, but haven't heard back in several days; figured while I was waiting on the Twilio code spelunkers to work their magic I'd ping the community and see if anyone else has noticed this behavior too.
Twilo Evangelist here.
I just spoke with one of our customer support team members and it looks like we have an issue reported for this behavior. She should be reaching out to you shortly to give you a more detailed update.
If we identify a work-around, we'll make sure to update this SO post with those details.
Hope that helps.

linkedin connect API gives error 401 - iphone

hi i am sending connect invitation by email using linkedin iphone api
Request xml:
<?xml version='1.0' encoding='UTF-8'?>
<mailbox-item>
<recipients>
<recipient>
<person path="/people/email=%#">
<first-name>%#</first-name>
<last-name>%#</last-name>
</person>
</recipient>
</recipients>
<subject>Invitation to Connect</subject>
<body>Please join my professional network on LinkedIn.</body>
<item-content>
<invitation-request>
<connect-type>friend</connect-type>
</invitation-request>
</item-content>
</mailbox-item>
where %# indicates dynamic value.
Content Type: text/xml
Request Method: POST
Response xml :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<status>401</status>
<timestamp>1342092385484</timestamp>
<request-id>FX9SK3ZVG9</request-id>
<error-code>0</error-code>
<message>[unauthorized]. OAU:076lb67kcfe2|dc01dc46-4d78-44d2-9f9b-49053b8094db|*01|*01:1342092534:iZ/mDlOL7eo4fGv2O/rQZKe8oCA=</message>
</error>
Also verified that authorization header is proper.
I have also debugged with oAuth debug console, i have enter same values in debug console, but signature key are different.
So is it a problem with signature key ??
I have also gone through forums.
But still i am not able to find an exact problem.
Any help will be appreciated.
Thanks
There's a sample LinkedIn iPhone client on github here:
https://github.com/synedra/LinkedIn-OAuth-Sample-Client
You should be able to use that to see what the proper headers look like. As you're on a macintosh (or wouldn't be developing for the iPhone), I strongly encourage you to use HTTPScoop to watch the traffic when using the simulator and see what the differences are between what your application is doing and what the sample client does.

I have integrated yahoo into iphone app but i am getting error:400 bad request

I have to access social information for the logged-in user.i have used following link. http://developer.yahoo.com/social/sdk/objectivec
i have used send request method to get user information.
but i am getting following error message
<
?xml version='1.0' encoding='utf-8'?>
<error xmlns='http://yahooapis.com/v1/base.rng'
xml:lang='en'>
<description>400 Bad Request</description>
<detail>400 Error : syntax error, unexpected &apos;(&apos; at "*(*null)"
can any one help me?
thank you in advance.
The Yahoo Web server (running the Web site) thinks that the data stream sent by the client (e.g. your Web browser or our CheckUpDown robot) was 'malformed' i.e. did not respect the HTTP protocol completely. So the Web server was unable to understand the request and process it. so make sure you are sending the well structured request.
Based on your commented:
http://nullinfo.wordpress.com/oauth-yahoo/
http://developer.yahoo.com/oauth/guide/oauth-make-request.html
You should understand how to make request with oauth, first read that and later if you could not succeed, ask again.

Soap xml for Paypal API SetMobileCheckout (rolling my own objective-c request)

I have the generic structure here:
<?xml version=”1.0” encoding=”UTF-8”?>
<SOAP-ENV:Envelope xmlns:xsi= ” http://www.w3.org/2001/XMLSchema-instance”
xmlns:SOAP-ENC=”http://schemas.xmlsoap.org/soap/encoding/”
xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/envelope/”
xmlns:xsd=”http://www.w3.org/2001/XMLSchema”
SOAP-ENV:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/”
><SOAP-ENV:Header>
<RequesterCredentials xmlns=”urn:ebay:api:PayPalAPI”>
<Credentials xmlns=”urn:ebay:apis:eBLBaseComponents”>
<Username>api_username</Username>
<Password>api_password</Password>
<Signature/>
<Subject/>
</Credentials>
</RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<specific_api_name_Req xmlns=”urn:ebay:api:PayPalAPI”>
<specific_api_name_Request>
<Version xmlns=urn:ebay:apis:eBLBaseComponents”>service_version
</Version>
<required_or_optional_fields xsi:type=”some_type_here”> data
</required_or_optional_fields>
</specific_api_name_Request>
</specific_api_name_Req>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The specific calls (SetMobileCheckout and DoMobileCheckoutPayment) I need are here
I'm well on my way. But I am rolling my own xml request in objective-c and I I'm trying to make sure I get this right.
Has anyone got an actual example with a real request?
Bonus if it is wrapped in objective-C, but just naked xml would be great.
Thanks,
Corey
I eventually went around the problem.
You can use NVP in a HTTP POST. This was munch easier on the iPhone. Not sure why my SOAP response kept getting rejected, but it was too time consuming to keep going.
In search for my answer, I did run across gSoap, which may help others. I just needed to make 2 requests, so I didn't want to get wrapped up in leaning that framework.
I also ran across wsdl2objC, unfortunately, it is not working on the iPhone right now (Data Type issues).
Here is a link to the HTTP POST request which uses NVP instead:
Has anyone implemented the PayPal API through a native iPhone app?