1

When creating a Order in schema.org syntax, I have paymentMethod with values like http://purl.org/goodrelations/v1#PayPal or http://purl.org/goodrelations/v1#DirectDebit but for cards I don't want to specify the specific type of card (Visa, American Express, etc).

¿Should I use http://purl.org/goodrelations/v1#PaymentMethodCreditCard as value?

For example in 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>
PhoneixS
  • 10,574
  • 6
  • 57
  • 73

1 Answers1

0

The GoodRelations vocabulary defines that gr:PaymentMethodCreditCard is a class, not an individual. (Schema.org’s CreditCard is derived from this.)

The idea is to use individuals that are defined to be of this class, not the class itself.

There doesn’t seem to be an individual that represents all credit cards (and in practice it probably wouldn’t be a good idea to use such an individual).

You could list all supported credit cards explicitly:

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

And if you support a credit card that hasn’t a predefined individual, you could define an individual yourself by making use of the gr:PaymentMethodCreditCard/schema:CreditCard types.

unor
  • 92,415
  • 26
  • 211
  • 360