Search code examples
paypalpaypal-sandbox

PayPal autofill the Credit Card details


I am using the PayPal Credit Card and i am trying to fill up the form using their code:

paypal.Buttons({
            style: {
                layout:  'vertical',
                shape: 'rect',
                height: 36
            },
            createOrder: function (data, actions) {
                return actions.order.create({
                    //https://developer.paypal.com/docs/checkout/integration-features/standard-card-fields/
                    payer: {
                        name: {
                            given_name: "PayPal",
                            surname: "Customer"
                        },
                        address: {
                            address_line_1: '123 ABC Street',
                            address_line_2: 'Apt 2',
                            admin_area_2: 'San Jose',
                            admin_area_1: 'CA',
                            postal_code: '95121',
                            country_code: 'US'
                        },
                        email_address: "customer@domain.com",
                        phone: {
                            phone_type: "MOBILE",
                            phone_number: {
                                national_number: "14082508100"
                            }
                        }
                    },
                    application_context: {
                        shipping_preference: 'NO_SHIPPING'
                    },
                    purchase_units: [{
                        description: getPurchaseDescription(),
                        amount: {
                            value: $("#Amount").val()
                        }
                    }]
                });
            },

Works well but i want to fill the credit card number and expiry date too. Is there any way to do this? I tried

card: {
          number: "378282246310005"
      }

But the credit number is not filled.

Thanks.


Solution

  • I want to fill the credit card number and expiry date too. Is there any way to do this?

    No. PayPal's SDK buttons should only ever be used by customers on their own devices who are entering their own payment information (login or card details)

    Also, be aware that card numbers and accompanying expiry dates are very sensitive information that in general should never be stored by most systems, but in the rare occasions where it makes sense to store them exacting measures must be taken, including a PCI SAQ of type D