I'm trying to use Shippo to get a USPS shipping label to send within the US, but can't seem to get any rates to appear - shippo

This is my request:
Address from:
Array(
[name] => Mr.John
[street1] => 1234 Market Street
[city] => San Francisco
[zip] => 95432
[state] => CA
[phone] => +1 415 123 1234
[email] => mrjohn+test#gmail.com
[country] => US
[object_purpose] => QUOTE
[company] => Shippo
)
Address to :
Array(
[name] => Ms. Jane
[street1] => 1234 Mission Street
[city] => San Francisco
[zip] => 91234
[state] => CA
[phone] => +1 415 234 2345
[email] => msjane+test#gmail.com
[country] => US
[object_purpose] => QUOTE
[street2] =>
[company] =>
)
Custom Item :
Shippo_Object Object(
[_apiKey:protected] => xxxx
[_values:protected] => Array (
[object_created] => [date]
[object_updated] => [date]
[object_id] => xxxxx
[object_owner] => sender+test#gmail.com
[object_state] => VALID
[description] => IPhone 6
[quantity] => 1
[net_weight] => 3
[mass_unit] => lb
[value_amount] => 450
[value_currency] => USD
[origin_country] => US
[tariff_number] =>
[metadata] => Order ID #123123
)
[_unsavedValues:protected] => Shippo_Util_Set Object (
[_elts:Shippo_Util_Set:private] => Array (
)
)
[_transientValues:protected] => Shippo_Util_Set Object (
[_elts:Shippo_Util_Set:private] => Array (
)
)
[_retrieveOptions:protected] => Array (
)
)
Custom Shipping :
Shippo_Object Object(
[_apiKey:protected] => xxxx
[_values:protected] => Array (
[object_created] => [date]
[object_updated] => [date]
[object_id] => xxxxx
[object_owner] => sender+test#gmail.com
[object_state] => VALID
[certify_signer] => Mr. John
[certify] => 1 [items] => Array (
[0] => xxxx
)
[non_delivery_option] => ABANDON
[contents_type] => MERCHANDISE
[contents_explanation] => IPhone 6
[exporter_reference] =>
[importer_reference] =>
[invoice] => #123123
[commercial_invoice] =>
[license] =>
[certificate] =>
[notes] =>
[eel_pfc] =>
[aes_itn] =>
[disclaimer] =>
[incoterm] =>
[metadata] => Order ID #123123
)
[_unsavedValues:protected] => Shippo_Util_Set Object (
[_elts:Shippo_Util_Set:private] => Array (
)
)
[_transientValues:protected] => Shippo_Util_Set Object (
[_elts:Shippo_Util_Set:private] => Array (
)
)
[_retrieveOptions:protected] => Array (
)
)
Am I miss something? I have address_to, address_from, custom item, and custom shipping all filled out.

I’m from the Shippo team here!
Everything in your call seems good. Please double check that you have your USPS account activated - you can edit it via the Carrier Accounts Endpoint or on the Carriers Page directly.
Since the shipment is domestic, you won’t need to add the “customs item”, nor “customs shipping” information. You should only provide this information when creating an international shipment.
Remove +1 from each phone number, that’s not needed and may cause problems.
Hope that’s helpful.

Related

Fetch protected data from object zend

I have response and I want to fetch referenceId from it, the response is
Application_Model_User Object
(
[_data:protected] => Array
(
[id] => 2
[email] => test#gmail.com
[password] => ef1dca60798e10a51e3b6201ae7c40fbe2a10887
[salt] => 87fc83906190d1e29b60c5813065af068e16459d
[name] => test
[creationDate] => 2011-07-05
[lastTimeStamp] => 2016-06-03 09:13:53
[enabled] => 1
[loginHash] =>
[employeeNumber] => 0007
[userphoneNumber] => +546546546545
[jobTitle] => Business Manager
)
[_references:protected] => Array
(
[role] => Array
(
[referenceClass] => Application_Model_Role
[referenceId] => 4
[mapperClass] => Application_Model_RoleMapper
[mapper] =>
)
[organisation] => Array
(
[referenceClass] => Application_Model_Organisation
[referenceId] => 1
[mapperClass] => Application_Model_OrganisationMapper
[mapper] =>
)
)
)
How can I fetch ?
In .phtml file in ajax after
success: function(response){
var data = jQuery.parseJSON(response);
for (var i in data)
{
var referenceId = data[i]['referenceId'];
}
}
You can use a getter. You can create a method to return the referenceId.

Can't Get Facebook User Info While Login Using Hybrid Auth in CodeIgniter 3.0

How to get any information from facebook login like Email,Name,Phone Etc. I'm using Hybrid Auth in CODEIGNITER
I get This Array:-
The site url : http://imedicalhub.nvkcoders.com/hauth/login/Facebook#=
Hybrid_User_Profile Object ( [identifier] => 955650971175283 [webSiteURL] => [profileURL] => [photoURL] => https://graph.facebook.com/955650971175283/picture?width=150&height=150 [displayName] => Lavish Tyagi [description] => [firstName] => [lastName] => [gender] => [language] => [age] => [birthDay] => [birthMonth] => [birthYear] => [email] => [emailVerified] => [phone] => [address] => [country] => [region] => [city] => [zip] => [username] => )
Dont use same account try different account.
dont use the account which has the facebook application. if you faced the same problem again then delete your app and recreate and try it again.
i hope this will help you,

(Salesforce Force.com REST API) How do I determine which products are associated with opportunities?

I'm using the Salesforce Force.com REST API. I need to determine which Products (Product2) are associated with Opportunities (Opportunity). Thus far, I've been unable to make the connection.
In the Salesofrce UI, opportunities can be associated with pricebooks and products. Pricebooks contain products, but it is also possible to associate products with an opportunity directly.
Querying an opportunity via the API yields the following:
Array
(
[0] => Array
(
[attributes] => Array
(
[type] => Opportunity
[url] => /services/data/v33.0/sobjects/Opportunity/xxxxxxxxxxxxxxxx
)
[Id] => xxxxxxxxxxxxxxxx
[IsDeleted] =>
[AccountId] => xxxxxxxxxxxxxxxxx
[Name] => Some Name
[Description] =>
[StageName] => Closed Won
[Amount] => 650
[Probability] => 100
[CloseDate] => 2012-04-12
[Type] => New Business
[NextStep] => A string
[LeadSource] => something
[IsClosed] => 1
[IsWon] => 1
[ForecastCategory] => Closed
[ForecastCategoryName] => Closed
[CampaignId] =>
[HasOpportunityLineItem] => 1
[Pricebook2Id] => xxxxxxxxxxxxxxxxxxxxx
[OwnerId] => xxxxxxxxxxxxxxxxxxx
[CreatedDate] => 2012-12-30T20:17:35.000+0000
[CreatedById] => xxxxxxxxxxxxxxxxxxxxxxxxxxx
[LastModifiedDate] => 2015-05-22T15:20:18.000+0000
[LastModifiedById] => xxxxxxxxxxxxxxxxxxxxxxxx
[SystemModstamp] => 2015-05-22T15:20:18.000+0000
[LastActivityDate] =>
[FiscalQuarter] => 1
[FiscalYear] => 2015
[Fiscal] => 2015 1
[LastViewedDate] => 2015-06-03T14:38:03.000+0000
[LastReferencedDate] => 2015-06-03T14:38:03.000+0000
[SyncedQuoteId] =>
[Type_of_Deal__c] => Monthly Contract Count
[Number_of_Contracts__c] => 999
[Fee_Per_Contract__c] => 999
[Installation_Fee__c] =>
[Roof_Top_Fee__c] =>
[LID__LinkedIn_Company_Id__c] =>
[inclusion_type__c] => inclusion type
[Total_Contract_Term__c] => 999
[Monthly_Value_of_Fee_Per_Contract__c] => 999
[Total_Value_of_Fee_Per_Contract__c] => 999
[Total_Value_of_Roof_Top_Fee__c] => 0
[Monthly_Fidels_Revenue__c] => 999
[Total_Value_of_Deal__c] => 999
[Number_of_Roof_Tops__c] =>
[Monthly_Value_of_Roof_Top_Fee__c] => 0
[Installation_Date__c] => 2012-01-01
[Reason_if_Lost__c] =>
[Total_Monthly_Revenue__c] => 999
[Existing_Agency__c] => Service Group
[Number_of_Contracts_in_Last_Batch__c] => 999
[Agent_Name__c] => John Smith
[Total_Value_of_Agency_Revenue__c] => 9999
[Contract_Start_Date__c] => 2012-01-01
[Batch_Received__c] => Yes
[Administrator__c] =>
[Per_Contract__c] => 999
[Integration_type__c] =>
[Last_Batch_ID__c] =>
[Last_Batch_Date__c] =>
)
)
From which you can see that no Product2 data is available. There is however, a Pricebook2Id. One might assume that querying that specific pricebook would yield information on which products are associated with it. However, querying a specific pricebook yields the following:
Array
(
[0] => Array
(
[attributes] => Array
(
[type] => Pricebook2
[url] => /services/data/v33.0/sobjects/Pricebook2/xxxxxxxxxxxx
)
[Id] => xxxxxxxxxxxxxxxxxxxx
[IsDeleted] =>
[Name] => Company Price Book
[CreatedDate] => 2011-11-14T18:36:23.000+0000
[CreatedById] => xxxxxxxxxxxxxxxxxxx
[LastModifiedDate] => 2011-11-14T18:36:23.000+0000
[LastModifiedById] => xxxxxxxxxxxxxxxxxxxxxxx
[SystemModstamp] => 2011-11-14T18:36:23.000+0000
[LastViewedDate] => 2015-06-04T19:41:20.000+0000
[LastReferencedDate] => 2015-06-04T19:41:20.000+0000
[IsActive] => 1
[Description] =>
[IsStandard] =>
)
)
As you can see, no information about products is available from the pricebook. So my question is:
How do I determine which products are associated with opportunities using the Salesforce Force.com REST API?
There is an object called 'Opportunity Product'. you need to get that object as well and link the proper opportunity to product.
It's a many to many relation and not one to many so more than one product might be related to each opportunity and vise versa.

PayPal pre-approval giving error

I have used PayPal api in which first i do preapproval and then make chained payment using that approval key. Everything works fine on my local server. But as on live its giving me below error.
Preapproval
Error
PreapprovalResponse Object
(
[responseEnvelope] => ResponseEnvelope Object
(
[timestamp] => 2015-05-01T08:38:40.374-07:00
[ack] => Failure
[correlationId] => 88fffca2a737c
[build] => 15743565
)
[preapprovalKey] =>
[error] => Array
(
[0] => ErrorData Object
(
[errorId] => 580001
[domain] => PLATFORM
[subdomain] => Application
[severity] => Error
[category] => Application
[message] => Invalid request: Data validation warning(line -1, col 0): null
[exceptionId] =>
[parameter] => Array
(
[0] => ErrorParameter Object
(
[name] =>
[value] => Data validation warning(line -1, col 0): null
)
[1] => ErrorParameter Object
(
[name] =>
[value] => Data validation warning(line -1, col 0): null
)
)
)
)
)
My request is
requestEnvelope.errorLanguage=en_US&cancelUrl=http%3A%2F%2Fredesignbox.com%2Fopendemo%2Fhappyfund%2Fcheckout&currencyCode=RUB&maxAmountPerPayment=1%2C032.00&maxNumberOfPayments=1&maxTotalAmountOfAllPayments=1%2C032.00&returnUrl=http%3A%2F%2Fredesignbox.com%2Fopendemo%2Fhappyfund%2Fcheckout_action%2Faction%2FafterApproval&startingDate=2015-05-01&feesPayer=PRIMARYRECEIVER
Response is
responseEnvelope.timestamp=2015-05-01T08%3A38%3A40.374-07%3A00&responseEnvelope.ack=Failure&responseEnvelope.correlationId=88fffca2a737c&responseEnvelope.build=15743565&error(0).errorId=580001&error(0).domain=PLATFORM&error(0).subdomain=Application&error(0).severity=Error&error(0).category=Application&error(0).message=Invalid+request%3A+Data+validation+warning%28line+-1%2C+col+0%29%3A+null&error(0).parameter(0)=Data+validation+warning%28line+-1%2C+col+0%29%3A+null&error(0).parameter(1)=Data+validation+warning%28line+-1%2C+col+0%29%3A+null
What's wrong i cannot understand.
EDIT
On local my ssl version is
OpenSSL/0.9.8y and
on live its NSS/3.16.2.3 Basic ECC
$maxpaymentss = floor(2000/68.50);
$data = array(
'ClientDetails' => array(
'applicationId' => 'My_APP',
),
'returnUrl' => 'http://www.yourdomain.com/success.html',
'cancelUrl' => 'http://www.yourdomain.com/cancel.html',
'startingDate' => gmdate("Y-m-d\TH:i:s\Z"),
'endingDate' => gmdate("Y-m-d\TH:i:s\Z"),
'maxAmountPerPayment' => 68.50,
'maxNumberOfPayments' => $maxpaymentss,
'maxTotalAmountOfAllPayments' => 2000.00,
'maxNumberOfPaymentsPerPeriod' => 1,
'currencyCode' => 'USD',
'requestEnvelope' => array(
'errorLanguage' => 'en_US',
'detailLevel' => 'ReturnAll'
)
);
these are the required fields for the live mode of PayPal adaptive preapproval.
Remove the "," in the "maxAmountPerPayment" and "maxTotalAmountOfAllPayments" field and try again . It should work fine

how to apply paypal discount on cart total?

Array
(
[return] => http://www.example.com/
[cancel] => http://www.example.com/
[currency] => EUR
[total] => 38.8
[shipping] => 6
[tax] => 2.85
[itemTotal] => 29.95
[items] => stdClass Object
(
[1] => stdClass Object
(
[quantity] => 1
[name] => Item one
[IDFull] => 1
[priceFull] => 32.8
[tax] => 2.85
[price] => 29.95
[priceWith] => 32.80
[attributes] => Array
(
)
[ID] => 1
)
)
)
This is my sample array for paypal checkout. How to add discount (eg. 20€) on card total price? I have tried many ways, but can't find it out. Thanks!
you can try it as below article
http://chevronscode.com/index.php/paypal-rest-api-add-discount-on-the-total-amount.html
add the discount as an item