2017-05-25 144 views
1

在schema.org語法中創建訂單時,我有paymentMethod,其值爲http://purl.org/goodrelations/v1#PayPalhttp://purl.org/goodrelations/v1#DirectDebit,但對於卡片,我不想指定特定類型的卡片(Visa,American Express等)。我可以使用「PaymentMethodCreditCard」作爲paymentMethod嗎?

¿我應該使用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> 

回答

0

的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類型自己定義的個人。

相關問題