blob: fe42e67becc9b65675331ac2c7c6e14231fedc91 [file] [log] [blame]
// 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;
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 {
string error;
PayerErrors payer;
AddressErrors shipping_address;
};
// The |PayerErrors| is used to represent validation errors with one or
// more payer details.
struct PayerErrors {
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 organization;
string phone;
string postal_code;
string recipient;
string region;
string sorting_code;
};