Paypal Express Checkout - More details for the customer - paypal

I use Paypal Express checkout with checkout.js
with the standard javascript code provided by paypal.
Everything works fine and the payment popup looks like this:
Now my question: Is it possible to add more details about the product to this popup?
Like for example, the name and description for the product?
(This code is not working).
return paypal.rest.payment.create(this.props.env, this.props.client, {
transactions: [
{
amount: { total: '{{ entry.itemPreis }}', currency: 'CHF' },
description: 'this is some description',
// description: works and shows up in the paypal backend
// but is not visible to the customer
title: 'this would be the title' // doesn't work
}
],
});
I find the paypal docs to be quite messy.

This works for me
transactions: [
{
amount: { total: '100', currency: 'CHF' },
item_list: {
items: [
{
name: 'Whateveryoufancy',
description: 'Lorem ipsum',
quantity: '1',
price: '100',
currency: 'CHF'
}
]
}
}
]

Related

Actions on google reservations for transaction API

We are building boot using action on builder SDK. In bot we have transaction related feature so we want to implement reservation feature to make appointment reservation. In our Bot we just need reservation. user can't cancel/delete reservation (As our member can contact the user for next 3 4 days, we are just asking user free time so we can contact user). (We did't have reservation feature yet but google team force us to do so). My Question is while implementing reservation we have https://developers.google.com/assistant/transactions/physical/dev-guide-physical-reservations#validate_transaction_requirements_optional this feature optional we are not implementing this, for second step we have to build Order like this https://developers.google.com/assistant/transactions/physical/dev-guide-physical-reservations#build_the_order
const order = {
createTime: '2019-09-24T18:00:00.877Z',
lastUpdateTime: '2019-09-24T18:00:00.877Z',
merchantOrderId: orderId, // A unique ID String for the order
userVisibleOrderId: orderId,
transactionMerchant: {
id: 'http://www.example.com',
name: 'Example Merchant',
},
contents: {
lineItems: [
{
id: 'LINE_ITEM_ID',
name: 'Dinner reservation',
description: 'A world of flavors all in one destination.',
reservation: {
status: 'PENDING',
userVisibleStatusLabel: 'Reservation is pending.',
type: 'RESTAURANT',
reservationTime: {
timeIso8601: '2020-01-16T01:30:15.01Z',
},
userAcceptableTimeRange: {
timeIso8601: '2020-01-15/2020-01-17',
},
partySize: 6,
staffFacilitators: [
{
name: 'John Smith',
},
],
location: {
zipCode: '94086',
city: 'Sunnyvale',
postalAddress: {
regionCode: 'US',
postalCode: '94086',
administrativeArea: 'CA',
locality: 'Sunnyvale',
addressLines: [
'222, Some other Street',
],
},
},
},
},
],
},
buyerInfo: {
email: 'janedoe#gmail.com',
firstName: 'Jane',
lastName: 'Doe',
displayName: 'Jane Doe',
},
followUpActions: [
{
type: 'VIEW_DETAILS',
title: 'View details',
openUrlAction: {
url: 'http://example.com',
},
},
{
type: 'CALL',
title: 'Call us',
openUrlAction: {
url: 'tel:+16501112222',
},
},
{
type: 'EMAIL',
title: 'Email us',
openUrlAction: {
url: 'mailto:person#example.com',
},
},
],
termsOfServiceUrl: 'http://www.example.com'
};
According to doc we have to create order object like above, but we are unable to find any doc what are optional filed in above object and what value to pass for reservationTime and userAcceptableTimeRange.
reservationTime: {
timeIso8601: '2020-01-16T01:30:15.01Z',
},
userAcceptableTimeRange: {
timeIso8601: '2020-01-15/2020-01-17',
}
Further more do we need to implement Set up asynchronous requests to the Orders API (https://developers.google.com/assistant/transactions/physical/dev-guide-physical-reservations#set_up_asynchronous_requests_to_the_orders_api) as we don't need to update user appoint time and user can't cancel appointment.
Is there any other way we can avoid reservation? please guide me, thanks in advance.

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.
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

Payment token not in response

==== SOLVED ====
Problem is solved. Adyen wants you to send the whole string as an object. JSON.parse(token). Make sure Google pay is enabled in the Adyen platform.
================
I'm working on transactions with Actions on Google and integration Google Pay. I followed all steps according to the documentation of Actions on Google.
To propose an order I send the following snippet seen below.
Notes:
gateway value is replaced for security reasons.
gatewayMerchantId value is replaced for security reasons.
I'm using a registered gateway.
I have not yet registered as Google partner though the business console so I have no access to the production API.
// Handle order with Google Pay.
conv.ask(new TransactionDecision({
orderOptions: {
requestDeliveryAddress: true,
userInfoOptions: {
userInfoProperties: [
'EMAIL',
],
},
},
paymentParameters: {
googlePaymentOption: {
facilitationSpec: JSON.stringify({
apiVersion: 2,
apiVersionMinor: 0,
environment: 'TEST',
merchantInfo: {
merchantName: 'Example Merchant',
merchantId: '12345678901234567890',
},
allowedPaymentMethods: [
{
type: 'CARD',
parameters: {
allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'],
allowedCardNetworks: [
'AMEX', 'DISCOVER', 'JCB', 'MASTERCARD', 'VISA',
],
},
tokenizationSpecification: {
type: 'PAYMENT_GATEWAY',
parameters: {
'gateway': 'my_gateway',
'gatewayMerchantId': 'my_gateway_id',
},
},
},
],
transactionInfo: {
totalPriceStatus: 'FINAL',
totalPrice: prodPriceInclBtwInMicros.toString(),
currencyCode: 'EUR',
},
}),
},
},
presentationOptions: {
actionDisplayName: 'PLACE_ORDER',
},
order: order,
}));
The intent that handles the transaction decision value obtains the following arg value:
const arg = conv.arguments.get('TRANSACTION_DECISION_VALUE');
{
'#type': 'type.googleapis.com/google.actions.transactions.v3.TransactionDecisionValue',
transactionDecision: 'ORDER_ACCEPTED',
order: {
googleOrderId: '02458320178127324049',
merchantOrderId: 'example',
userVisibleOrderId: 'example',
buyerInfo: {
email: 'example#example.com',
firstName: 'example',
lastName: 'example',
displayName: 'example example'
},
createTime: '2020-07-21T10:59:16.624Z',
lastUpdateTime: '2020-07-21T10:59:16.624Z',
transactionMerchant: { name: 'Example Merchant' },
contents: { lineItems: [Array] },
priceAttributes: [ [Object], [Object], [Object] ],
paymentData: { paymentResult: [Object], paymentInfo: [Object] },
purchase: {
status: 'CREATED',
type: 'RETAIL',
userVisibleStatusLabel: 'CREATED'
},
vertical: {
'#type': 'type.googleapis.com/google.actions.orders.v3.verticals.purchase.PurchaseOrderExtension',
status: 'CREATED',
type: 'RETAIL',
userVisibleStatusLabel: 'CREATED'
}
}
}
According to [Adyen][1] I should provide the payment token: 'Get the token from PaymentData response from the Google Pay API.' [Google][2] states that the token will be returned in a response object after the user approves the payment. This is certainly not the case as can be seen in the `arg` object.
By digging deeper into the paymentData, we get the following values:
{
paymentResult: {
googlePaymentData: '{"signature":"MEYCIQDS8Tiu9bprWqamQ24oNx+Wa43Wg6Vi3sP5PArDeOtOEAIhAOBqe4sQvN5tD390qWzDn9DIgwA8gjS8ajynrusOix6O","protocolVersion":"ECv1","signedMessage":"{\\"encryptedMessage\\":\\"Some_tokens_IUHASIDHUSAGFUAHS\\",\\"ephemeralPublicKey\\":\\"SOMEKEYSASD\\\\u003d\\",\\"tag\\":\\"SOMETAG_OIASJDJSOIJ\\\\u003d\\"}"}'
},
paymentInfo: {
paymentMethodDisplayInfo: {
paymentType: 'PAYMENT_CARD',
paymentMethodDisplayName: 'Visa •••• 1234'
},
paymentMethodProvenance: 'PAYMENT_METHOD_PROVENANCE_GOOGLE'
}
}
Still no token returned in the response... This will be necessary for the gateway.
Does anyone know how to resolve this? Or does this have to with the production Transaction API?
Any help is appreciated.
[1]: https://docs.adyen.com/payment-methods/google-pay/api-only
[2]: https://developers.google.com/pay/api/web/reference/response-objects#PaymentData

PayPal Express Checkout default Country

I'm trying to default the billing country to the UK, but no matter what i try it always defaults to the US.
Any ideas?
Note, that we do not require the customer to enter a shipping address so this has been hidden as per the json but have tried setting this to see if it makes a difference with no joy.
I've tried the following:
json_patch_request: [
{
op: 'replace',
path: '/payer/payer_info/billing_address',
value: {
country_code: 'GB',
}
}
],
payer: {
payer_info: {
country_code: 'GB',
billing_address: {
country_code: 'GB',
},
shipping_address: {
country_code: 'GB',
}
}
},
payment: {
transactions: [
{
amount: {
total: 10,
currency: 'GBP'
},
custom: 'x',
},
],
},
experience: {
input_fields: {
no_shipping: 1
},
flow_config: {
landing_page_type: "billing",
},
presentation: {
locale_code: "GB",
},
}
You need to set that in your seller profile:
Log in to your PayPal account
Click Money at the top of the page
Click Manage Currency
Choose the currency to make Primary
Click Make Primary
See https://www.paypal-community.com/t5/About-Payments-Archive/How-to-change-Paypal-default-currency-to-USD/td-p/616528

JSON Facebook Payment marked "FRAUD"

In the following JSON, I make a payment in the ChefChili game to purchase virtual currency with my credit card (I am not in the payment testers list). This is showing as FRAUD, whereas it was a genuine payment made by me.
https://graph.facebook.com/382606235186483?access_token=193512574007560|75d4646925b860ec194c69d6cd717ad0
The output of JSON code :
{
id: "382606235186483",
user: {
name: "Abhishek Srivastava",
id: "100001441415841"
},
application: {
name: "ChefChili",
namespace: "chefchili",
id: "193512574007560"
},
actions: [
{
type: "charge",
status: "completed",
currency: "USD",
amount: "1.00",
time_created: "2013-07-26T11:36:49+0000",
time_updated: "2013-07-26T11:36:51+0000"
}
],
refundable_amount: {
currency: "USD",
amount: "1.00"
},
items: [
{
type: "IN_APP_PURCHASE",
product: "https://chefchili.mediaagility.com/product_desc.html",
quantity: 10
}
],
country: "IN",
created_time: "2013-07-26T11:36:49+0000",
fraud_status: "UNKNOWN",
payout_foreign_exchange_rate: 1
}
Also can any one tell me that what is this "fraud_status:UNKNOWN"? and why it is showing "refundable_amount" ?