| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use WWW::Shopify; | ||
| 7 | |||
| 8 | package WWW::Shopify::Model::Dispute; | ||
| 9 | use parent "WWW::Shopify::Model::Item"; | ||
| 10 | |||
| 11 | my $fields; sub fields { return $fields; } | ||
| 12 | BEGIN { $fields = { | ||
| 13 | "id" => new WWW::Shopify::Field::Identifier(), | ||
| 14 | "order_id" => new WWW::Shopify::Field::Relation::ReferenceOne('WWW::Shopify::Model::Order'), | ||
| 15 | "type" => new WWW::Shopify::Field::String::Enum([qw(inquiry chargeback)]), | ||
| 16 | "amount" => new WWW::Shopify::Field::Money(), | ||
| 17 | "currency" => new WWW::Shopify::Field::Currency(), | ||
| 18 | "reason" => new WWW::Shopify::Field::String::Enum([qw(bank_not_process credit_not_processed customer_initiated debit_not_authorized duplicate fraudulent general incorrect_account_details insufficient_funds product_not_received product_unacceptable subscription_canceled unrecognized)]), | ||
| 19 | "network_reason_code" => new WWW::Shopify::Field::BigInt(), | ||
| 20 | "status" => new WWW::Shopify::Field::String::Enum([qw(needs_response under_review charge_refunded accepted won lost)]), | ||
| 21 | "evidence_due_by" => new WWW::Shopify::Field::Date(), | ||
| 22 | "evidence_sent_on" => new WWW::Shopify::Field::Date(), | ||
| 23 | "finalized_on" => new WWW::Shopify::Field::Date() | ||
| 24 | }; } | ||
| 25 | my $queries; sub queries { return $queries; } | ||
| 26 | BEGIN { $queries = { | ||
| 27 | since_id => new WWW::Shopify::Query::LowerBound('id'), | ||
| 28 | last_id => new WWW::Shopify::Query::UpperBound('id'), | ||
| 29 | status => new WWW::Shopify::Query::Enum('status', [qw(needs_response under_review charge_refunded accepted won lost)]), | ||
| 30 | #initiated_at => new WWW::Shopify::Query::Match('date') | ||
| 31 | }; } | ||
| 32 | |||
| 33 | sub updatable { undef }; | ||
| 34 | sub creatable { undef }; | ||
| 35 | |||
| 36 | sub read_scope { return "read_shopify_payments_disputes"; } | ||
| 37 | |||
| 38 | eval(__PACKAGE__->generate_accessors); die $@ if $@; | ||
| 39 | |||
| 40 | 1 |