naiveproxy/components/payments/mojom/payment_request_data.mojom
2018-08-14 22:19:20 +00:00

80 lines
2.3 KiB
Plaintext

// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[JavaPackage="org.chromium.payments.mojom"]
module payments.mojom;
// The shipping address that the browser process provides to the renderer
// process. Built either by the browser or a payment app.
struct PaymentAddress {
// ISO 3166 country code. Two upper case ASCII letters.
string country;
array<string> address_line;
string region;
string city;
string dependent_locality;
string postal_code;
string sorting_code;
// Optional shortest ISO 639 language code. Two or three lower case ASCII
// letters.
string language_code;
// Optional ISO 15924 script code. Four ASCII letters. The first letter is
// upper case; the rest are lower case.
string script_code;
string organization;
string recipient;
string phone;
};
// The currency amount that the renderer provides to the browser process. The
// browser shows the amount in UI and forwards it on to the payment app, if it
// requires the amount.
struct PaymentCurrencyAmount {
// The most common identifiers are three-letter alphabetic codes as defined
// by [ISO4217] (for example, "USD" for US Dollars), however any string of at
// most 2048 characters is considered valid.
string currency;
// ISO 20022 CurrencyAnd30Amount. Up to 30 total digits. Up to 10 fraction
// digits. Separated by a dot.
string value;
};
// The |PaymentValidationErrors| data structure that the renderer provides to
// the browser process when calling retry() method in JavaScript. It contains
// merchant-defined error message strings.
struct PaymentValidationErrors {
PayerErrorFields payer;
AddressErrors shipping_address;
};
// The |PayerErrorFields| is used to represent validation errors with one or
// more payer details.
struct PayerErrorFields {
string email;
string name;
string phone;
};
// The |AddressErrors| is used to represent validation errors with specific
// parts of a physical address.
struct AddressErrors {
string address_line;
string city;
string country;
string dependent_locality;
string language_code;
string organization;
string phone;
string postal_code;
string recipient;
string region;
string region_code;
string sorting_code;
};