I'm currently using this code to accept payments on my website using PayPal Express Checkout. I removed the shipping fields using the 'NO_SHIPPING' option. Since I'm selling digital goods, I would also like to remove the billing address fields (firstname, lastname, zip, phone, email) or at least any of them. How to do that?
<script src="https://www.paypal.com/sdk/js?client-id={client-id}"></script>
<script>
render_paypal_button();
function render_paypal_button() {
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: 1.00
}
}],
application_context: {
shipping_preference: 'NO_SHIPPING'
}
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
});
}
}).render('#paypal-button-container');
</script>
Billing fields are used for payment processing by PayPal, as they are for communication with credit card companies for example, to better check against fraud and ensure the payment attempt is authentic. They are not returned to you or included as part of the transaction that you see. You can't remove them.
Note that with PayPal billing information is kept private within the PayPal account by design. All the receiver will see is a successful PayPal payment (and any shipping details if applicable). If using the JS SDK for the checkout the site owner may know which local payment method button was clicked (yellow PayPal button, Pay Later button, or black "Debit or Credit Card" button for instance--and other that can vary by payer country) but the receiver won't know which funding source or billing details the customer ultimately chose within PayPal. But again this is by design, any billing information is stored and kept private. And that's one of the reasons there are many online payers who prefer using PayPal, as they know and trust it vs. entering their sensitive billing info into whichever random website they've never used before.