| 1 | package Faker::Plugin::Payment; | ||
| 2 | |||
| 3 | use 5.014; | ||
| 4 | |||
| 5 | use strict; | ||
| 6 | use warnings; | ||
| 7 | |||
| 8 | use registry; | ||
| 9 | use routines; | ||
| 10 | |||
| 11 | use Data::Object::Class; | ||
| 12 | use Data::Object::ClassHas; | ||
| 13 | |||
| 14 | extends 'Data::Object::Plugin'; | ||
| 15 | |||
| 16 | our $VERSION = '1.03'; # VERSION | ||
| 17 | |||
| 18 | # ATTRIBUTES | ||
| 19 | |||
| 20 | has 'faker' => ( | ||
| 21 | is => 'ro', | ||
| 22 | isa => 'ConsumerOf["Faker::Maker"]', | ||
| 23 | req => 1, | ||
| 24 | ); | ||
| 25 | |||
| 26 | # METHODS | ||
| 27 | |||
| 28 | method data_for_vendor() { | ||
| 29 | [ | ||
| 30 | 'Visa', | ||
| 31 | 'Visa', | ||
| 32 | 'Visa', | ||
| 33 | 'Visa', | ||
| 34 | 'Visa', | ||
| 35 | 'MasterCard', | ||
| 36 | 'MasterCard', | ||
| 37 | 'MasterCard', | ||
| 38 | 'MasterCard', | ||
| 39 | 'MasterCard', | ||
| 40 | 'American Express', | ||
| 41 | 'Discover Card', | ||
| 42 | ] | ||
| 43 | } | ||
| 44 | |||
| 45 | method format_for_americanexpress_card() { | ||
| 46 | [ | ||
| 47 | '34############', | ||
| 48 | '37############', | ||
| 49 | ] | ||
| 50 | } | ||
| 51 | |||
| 52 | method format_for_discovercard_card() { | ||
| 53 | [ | ||
| 54 | '6011###########', | ||
| 55 | ] | ||
| 56 | } | ||
| 57 | |||
| 58 | method format_for_mastercard_card() { | ||
| 59 | [ | ||
| 60 | '51#############', | ||
| 61 | '52#############', | ||
| 62 | '53#############', | ||
| 63 | '54#############', | ||
| 64 | '55#############', | ||
| 65 | ] | ||
| 66 | } | ||
| 67 | |||
| 68 | method format_for_visa_card() { | ||
| 69 | [ | ||
| 70 | '4539########', | ||
| 71 | '4539###########', | ||
| 72 | '4556########', | ||
| 73 | '4556###########', | ||
| 74 | '4916########', | ||
| 75 | '4916###########', | ||
| 76 | '4532########', | ||
| 77 | '4532###########', | ||
| 78 | '4929########', | ||
| 79 | '4929###########', | ||
| 80 | '40240071####', | ||
| 81 | '40240071#######', | ||
| 82 | '4485########', | ||
| 83 | '4485###########', | ||
| 84 | '4716########', | ||
| 85 | '4716###########', | ||
| 86 | '4###########', | ||
| 87 | '4##############', | ||
| 88 | ] | ||
| 89 | } | ||
| 90 | |||
| 91 | 1; |