【问题标题】:Can I use "PaymentMethodCreditCard" as paymentMethod?我可以使用“PaymentMethodCreditCard”作为支付方式吗?
【发布时间】:2017-10-26 01:59:43
【问题描述】:

在 schema.org 语法中创建订单时,我有 paymentMethod 的值,如 http://purl.org/goodrelations/v1#PayPalhttp://purl.org/goodrelations/v1#DirectDebit 但对于卡片,我不想指定特定类型的卡片(Visa、美国运通等) )。

¿我应该使用http://purl.org/goodrelations/v1#PaymentMethodCreditCard 作为值吗?

例如在 JSON-LD 中:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Order",
  "merchant": {
    "@type": "Organization",
    "name": "My Company"
  },
  "orderNumber": "546846486",
  "orderStatus": "http://schema.org/OrderDelivered",
  "paymentMethod": "http://purl.org/goodrelations/v1#PaymentMethodCreditCard",
  "priceCurrency": "EUR",
  "price": "125.48",
  "acceptedOffer": {
    "@type": "Offer",
    "itemOffered": {
      "@type": "Product",
      "name": "Towel 42"
    "price": "125.48",
    "priceCurrency": "EUR",
    "eligibleQuantity": {
      "@type": "QuantitativeValue",
      "value": "1"
    }
  }
}
</script>

【问题讨论】:

    标签: schema.org credit-card json-ld


    【解决方案1】:

    GoodRelations 词汇表定义gr:PaymentMethodCreditCard 是一个类,而不是一个个体。 (Schema.org 的CreditCard 就是由此衍生而来的。)

    这个想法是使用被定义为这个类的个体,而不是类本身。

    似乎没有代表所有信用卡的个人(实际上使用这样的个人可能不是一个好主意)。

    您可以明确列出所有支持的信用卡:

    "paymentMethod": [
      {"@id": "http://purl.org/goodrelations/v1#VISA"}, 
      {"@id": "http://purl.org/goodrelations/v1#MasterCard"}, 
      {"@id": "http://purl.org/goodrelations/v1#JCB"}
    ],
    

    如果您支持没有预定义个人的信用卡,您可以使用gr:PaymentMethodCreditCard/schema:CreditCard 类型自己定义个人。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-19
      • 2021-12-26
      • 2022-12-06
      • 1970-01-01
      • 1970-01-01
      • 2012-09-12
      • 2017-03-06
      相关资源
      最近更新 更多