Passing the Billing Address to Paypal Express API - paypal

I am working on a small membership site in WordPress. We already have the users Name and Address and wish to pass that information to PayPal Express to prepopulate the Billing Information if the user chooses to pay by Debit or Credit Card. The site only sells to 5 countries at present (UK, US, AU, CA, NZ).
Using the Paypal Sandbox I can get the Billing information across to CA, AU and NZ but using the same nvp string (with variations for currency / country code) I can't pass it to the UK or US.
Here's my Working CA String:
&PAYMENTREQUEST_0_ITEMAMT=250.00
&PAYMENTREQUEST_0_CURRENCYCODE=CAD
&PAYMENTREQUEST_0_SHIPTONAME=Test User
&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=CA
&PAYMENTREQUEST_0_SHIPTOPHONENUM=01234567890
&PAYMENTREQUEST_0_SHIPTOSTREET=Test Address 1
&PAYMENTREQUEST_0_SHIPTOSTREET2=Test Address 2
&PAYMENTREQUEST_0_SHIPTOCITY=Test City
&PAYMENTREQUEST_0_SHIPTOSTATE=Test State
&PAYMENTREQUEST_0_SHIPTOZIP=123456
&DESC=Example+Description
&NOTIFYURL=http%3A%2F%2Fwww.example.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dipnhandler
&PAYMENTREQUEST_0_SHIPPINGAMT=30.00
&NOSHIPPING=0
&PAYMENTREQUEST_0_AMT=280
&L_BILLINGAGREEMENTDESCRIPTION0=Billing+Description
&L_PAYMENTTYPE0=Any
&ReturnUrl=http%3A%2F%2Fwww.example.com%2Freturnurl
&CANCELURL=http%3A%2F%2Fwww.example.com%2Fcancelurl
&SOLUTIONTYPE=Sole
&LANDINGPAGE=Billing
And here's my non-working UK string:
&PAYMENTREQUEST_0_ITEMAMT=135.00
&PAYMENTREQUEST_0_CURRENCYCODE=GBP
&PAYMENTREQUEST_0_SHIPTONAME=User Name
&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=UK
&PAYMENTREQUEST_0_SHIPTOPHONENUM=01234567890
&PAYMENTREQUEST_0_SHIPTOSTREET=Test Address 1
&PAYMENTREQUEST_0_SHIPTOSTREET2=Test Address 2
&PAYMENTREQUEST_0_SHIPTOCITY=Test City
&PAYMENTREQUEST_0_SHIPTOSTATE=Test State
&PAYMENTREQUEST_0_SHIPTOZIP=123456
&DESC=Example+Description
&NOTIFYURL=http%3A%2F%2Fwww.example.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dipnhandler
&PAYMENTREQUEST_0_SHIPPINGAMT=20.00
&NOSHIPPING=0
&PAYMENTREQUEST_0_AMT=155
&L_BILLINGAGREEMENTDESCRIPTION0=Billing+Description
&L_PAYMENTTYPE0=Any
&ReturnUrl=http%3A%2F%2Fwww.example.com%2Freturnurl
&CANCELURL=http%3A%2F%2Fwww.example.com%2Fcancelurl
&SOLUTIONTYPE=Sole
&LANDINGPAGE=Billing
As you can see virtually identical. The country does get populated correctly in all cases, just not the actual address info. What fundamental thing am I missing??

UK country code is not UK it is GB

Related

In shipping address i wants shipping rate calculate by City as they default work with Country and postalcode

I have to calculate shipping rate by City on shipping address, currently it show shipping rate by postal code and Country update.
I did it on cart page by following tutorial https://webkul.com/blog/enable-city-field-cart-page-magento2/comment-page-1/?unapproved=17654&moderation-hash=d1044923b0b9b89f10efedb9102fd063#comment-17654
Please help me for same on shipping address.
Thank you
I did it, First i make city field as drop-down by layoutprocess.php .
After that magento have API to calculate shipping rate which is estimate-shipping-methods . This API run via following path
/vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js
There have method where we can set field name for which we wants to call API.
checkoutProvider.on('shippingAddress', function (shippingAddrsData) {
...... }
Thank you

show facebook product price in local currency

I have some Items in my game that can be bought.
I need to show the price in local currency BEFORE user click "buy".
It is easy, when the default price is in USD,
so that I call
FB.api('/me/?fields=currency')
and as an response I get
user_currency
usd_exchange_inverse
With that, local price is:
PRICE_IN_USD * usd_exchange_inverse.
But what if default price is in EURO?
It seems that I need to get exchange rate from EURO to LOCAL CURRENCY.
But how?
thanks

Mapping payments in IIF to QBXML

For having deprecated IIF, you'd think Intuit would make it easier to map the calls but I've found myself in something of a corner.
I have a fairly old script mapping our stuff to IIF.
!TRNS TRNSTYPE DATE ACCNT NAME AMOUNT DOCNUM MEMO CLEAR REP PAYMETH ADDR1 ADDR2 ADDR3 ADDR4
!SPL TRNSTYPE DATE ACCNT NAME AMOUNT DOCNUM MEMO CLEAR QNTY PRICE INVITEM PAYMETH EXTRA
!ENDTRNS
TRNS PAYMENT 1/21/2010 Paypal Account Dear Customer 1230.9 PAYPAL - Invoice123 N PAYPAL Dear Customer 123 Dear Dr
SPL PAYMENT 1/21/2010 Accounts Receivable Dear Customer -1230.9 Invoice123 PAYPAL - Invoice123 N PAYPAL
ENDTRNS
TRNS CHECK 1/21/2010 Paypal Account Paypal Account -29.84 Transaction Fees - Invoice123 N
SPL CHECK 1/21/2010 Fees:Paypal Fees Dear Customer 29.84 Transaction Fees - Invoice123 N
ENDTRNS
Now, I have a script that handles the customer and finding the right record in QB but I'm trying to find the right call to put all these records in. It looks like the first two can fit into ReceivePaymentAddRq but it's less clear on the second set.
Then I have another set that starts with BILL
TRNS BILL 5/15/2014 Accounts Payable Our Vendor -344.81 450608 N 6/14/2014 Net 30
SPL BILL 5/15/2014 Cost of Goods Sold:Purchases Dear Customer 344.81 450608 Invoice123 N
ENDTRNS
I think both fall under BillAdd but that COGS line could also fall under ChargeAdd
The transaction type PAYMENT would indeed be a ReceivePaymentAddRq. The CHECK type would be a CheckAddRq as you are not effecting an Accounts Receivable account. The transaction type of BILL would be a BillAddRq, as you are wanting to effect Accounts Payable. The ChargeAddRq is used for a customer charge, which is not the same as a CreditCardChargeAddRq.
It helps to have used QuickBooks manually a bit to understand the types of transactions that are used, but here's a quick little reference (these include the AddRq, QueryRq and ModRq where applicable). Note that this is not 100% as there are situations where you might use a different transaction type, but it's a good starting point:
Effect Accounts Receivable:
Invoice
ReceivePayment
Charge
CreditMemo
Effect Accounts Payable:
Bill
ItemReceipt
VendorCredit
BillPaymentCheck
BillPaymentCreditCard
Effect Bank Account:
Check
Deposit
Effect Credit Card Account:
CreditCardCharge
CreditCardCredit

How do I use address_override for addresses that are not in the U.S.?

I am using Paypal IPN to process orders on an ecommerce site. One issue I'm having is figuring out how to send address information to PayPal for the address_override function.
For a U.S. address it's easy. You just do something like this:
first_name = first
last_name = last
address1 = 1 main st
address2 = APT 304
city = Cityname
zip = 01234
state = NY
country = US
But for a Canadian address, for example, the state field cannot be entered and I cannot find a "Province" field to replace it.
What do I do in this situation? What about all the other countries?
The documentation list all the countries and country codes that they accept. But I see nothing on how to actually send these.
Alright, apparently the PayPal documentation is wrong. The description given for the state variable is:
U.S. state
For allowable values; use the Official U.S. Postal Service
Abbreviations.
This is incorrect. The state variable can be the abbreviation of the selected country's equivalent of a state. So if shipping to an address in Ontario you need to put ON in the state field.

can't pay with undefined currency in facebook Local Currency Payments

my app product defined USD,and not defined GBP.when I use GBP to pay, the pay dialog return
the error that Sorry, there was a problem and we can’t complete your request. Please try again later.
I'm confusion about that,the facebook offical doucument show that If you do not define a price point for a particular local currency, users of that currency will have their price automatically calculated based upon the current exchange rate between the first currency you specify and that target currency.
Can anyone help me?
Could it be that you were trying 0.01 USD? that converts to less than 0.01 GBP
Defining a single unit of in-game currency that has a product:price:amount less than 0.01. For example, selling 1,000 Coins for USD 1.00 would require a unit price of 0.001, which is not supported.
https://developers.facebook.com/docs/howtos/payments/definingproducts/#pricing_static