« Shopify/Model/ShopifyPayment/Dispute.pm
↑ Summary
Shopify/Model/ShopifyPayment/Payout/Summary.pm »
| 1 | use strict; | ||
| 2 | use warnings; | ||
| 3 | |||
| 4 | use WWW::Shopify; | ||
| 5 | |||
| 6 | package WWW::Shopify::Model::ShopifyPayment::Payout; | ||
| 7 | use parent "WWW::Shopify::Model::Item"; | ||
| 8 | |||
| 9 | my $fields; sub fields { return $fields; } | ||
| 10 | BEGIN { $fields = { | ||
| 11 | "id" => new WWW::Shopify::Field::Identifier(), | ||
| 12 | "status" => new WWW::Shopify::Field::String::Enum([qw(scheduled in_transit paid failed cancelled)]), | ||
| 13 | "date" => new WWW::Shopify::Field::Date(), | ||
| 14 | "currency" => new WWW::Shopify::Field::Currency(), | ||
| 15 | "amount" => new WWW::Shopify::Field::Money(), | ||
| 16 | "summary" => new WWW::Shopify::Field::Relation::OwnOne('WWW::Shopify::Model::ShopifyPayment::Payout::Summary') | ||
| 17 | }; } | ||
| 18 | |||
| 19 | sub creatable { undef; } | ||
| 20 | sub updatable { undef; } | ||
| 21 | sub read_scope { "read_shopify_payments_payouts"; } | ||
| 22 | sub write_scope { undef; } | ||
| 23 | |||
| 24 | |||
| 25 | # When getting all, if there are no payments, it actually returns a 404 error, rather than empty array. | ||
| 26 | # SIGH. | ||
| 27 | my $queries; sub queries { return $queries; } | ||
| 28 | BEGIN { $queries = { | ||
| 29 | since_id => new WWW::Shopify::Query::LowerBound('id'), | ||
| 30 | last_id => new WWW::Shopify::Query::UpperBound('id'), | ||
| 31 | date_min => new WWW::Shopify::Query::LowerBound('date'), | ||
| 32 | date_max => new WWW::Shopify::Query::UpperBound('date'), | ||
| 33 | date => new WWW::Shopify::Query::Match('date'), | ||
| 34 | payout_id => new WWW::Shopify::Query::Match('payout_id'), | ||
| 35 | payout_status => new WWW::Shopify::Query::Match('payout_status'), | ||
| 36 | last_id => new WWW::Shopify::Query::UpperBound('id'), | ||
| 37 | }; } | ||
| 38 | |||
| 39 | eval(__PACKAGE__->generate_accessors); die $@ if $@; | ||
| 40 | |||
| 41 | sub prefix { '/shopify_payments/'; } | ||
| 42 | |||
| 43 | 1 |