New smart button does not show city, street name and house number on no_shipping version.

Andras98
Contributor
Contributor

Hi there,

I'm integrating Paypal's new smart button for an online in-game purchase.

I would like to take out the shipping, because that doesn't happen here.
After 
"purchase_units: .."
I write that
"application_context: {shipping_preference: 'NO_SHIPPING'}"

After that it really shows no delivery. When purchasing a debit or credit card, it asks for the card number, expiration date, CSC, last name, first name, postal code, mobile phone and e-mail. However, it does not ask for the city name, street name, or house number.
I have a separate billing program. It requires the name of the settlement, street name, and house number.

Is it correct that you do not request full billing information without shipping?
Maybe the missing fields need to be added separately?
If so, what is its code?
The phone number is not necessary either, how can it be taken out so that the customer does not have to provide it? There is no need for that.

 

My code is

<div id="smart-button-container">
<div style="text-align: center;">
<div id="paypal-button-container"></div>
</div>
</div>
<script src="https://www.paypal.com/sdk/js?client-id=client-id&enable-funding=venmo&currency=USD" data-sdk-integration-source="button-factory"></script>
<script>
function initPayPalButton() {
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'paypal',

},

createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{"amount":{"currency_code":"USD","value":1}}],
application_context: {shipping_preference: 'NO_SHIPPING'}
});
},

onApprove: function(data, actions) {
return actions.order.capture().then(function(orderData) {

// Full available details
console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));

// Show a success message within this page, e.g.
const element = document.getElementById('paypal-button-container');
element.innerHTML = '';
element.innerHTML = '<h3>Thank you for your payment!</h3>';

// Or go to another URL: actions.redirect('thank_you.html');

});
},

onError: function(err) {
console.log(err);
}
}).render('#paypal-button-container');
}
initPayPalButton();
</script>


I'm happy for any help.

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.