このハウツー ガイドハウツーガイドの例をコピーしようとしていますが、常に次のエラーが表示されます。
XMLHttpRequest cannot load https://svcs.sandbox.paypal.com/AdaptiveAccounts/CreateAccount. Origin http://my.domain.com is not allowed by Access-Control-Allow-Origin.
実際の例やヒントを教えてもらえますか? ありがとう!
これは私のコードです:
Meteor.http.post("https://svcs.sandbox.paypal.com/AdaptiveAccounts/CreateAccount",{
headers: {
"X-PAYPAL-SANDBOX-EMAIL-ADDRESS": "myemail@domain.com",
"X-PAYPAL-SECURITY-USERID": "myuserid",
"X-PAYPAL-SECURITY-PASSWORD": "somepassword",
"X-PAYPAL-SECURITY-SIGNATURE": "thelongsignature",
"X-PAYPAL-APPLICATION-ID": "APP-80W284485P519543T",
"X-PAYPAL-DEVICE-IPADDRESS": "192.0.2.0",
"X-PAYPAL-REQUEST-DATA-FORMAT": "JSON",
"X-PAYPAL-RESPONSE-DATA-FORMAT": "JSON"
},
data: {
accountType: "PERSONAL",
name:{
firstName: "John",
lastName: "Doe"
},
address:{
line1: "123 Main Street",
city: "Sydney",
state: "NSW",
postalCode: "2000",
countryCode: "AU",
citizenshipCountryCode: "AU",
contactPhoneNumber: "12345678",
dateOfBirth: "1990-01-01Z",
createAccountWebOptions:{
returnUrl: "http://my.domain.com/"
},
currencyCode: "AUD",
emailAddress: "anotheremail@somedomain.com",
preferredLanguageCode: "en_AU",
registrationType: "Web",
requestEnvelope:{
errorLanguage: "en_US"
}
}
}
},
function(error,result){
alert(error);
alert(result.statuscode);
})